|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.font.format.xtf.tables.gps.ClassDefTable
public abstract class ClassDefTable
Class for a ClassDef table.
In OpenType Layout, index values identify glyphs. For efficiency and ease of representation, a font developer can group glyph indices to form glyph classes. Class assignments vary in meaning from one lookup subtable to another. For example, in the GSUB and GPOS tables, classes are used to describe glyph contexts. GDEF tables also use the idea of glyph classes.
Consider a substitution action that replaces only the lowercase ascender glyphs in a glyph string. To more easily describe the appropriate context for the substitution, the font developer might divide the font's lowercase glyphs into two classes, one that contains the ascenders and one that contains the glyphs without ascenders.
A font developer can assign any glyph to any class, each identified with an integer called a class value. A Class Definition table (ClassDef) groups glyph indices by class, beginning with Class 1, then Class 2, and so on. All glyphs not assigned to a class fall into Class 0. Within a given class definition table, each glyph in the font belongs to exactly one class.
The ClassDef table can have either of two formats: one that assigns a range of consecutive glyph indices to different classes, or one that puts groups of consecutive glyph indices into the same class.
| Nested Class Summary | |
|---|---|
static class |
ClassDefTable.ClassDef1Table
ClassDefTable for Format 1. |
static class |
ClassDefTable.ClassDef2Table
ClassDefTable for Format 2. |
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
classMap
The map for the classRangeRecord (to increase the search speed). |
protected int |
defNr
class def number. |
protected int |
format
The class format. |
protected XtfGlyphName |
xtfGlyph
The glyph names. |
| Constructor Summary | |
|---|---|
ClassDefTable()
|
|
| Method Summary | |
|---|---|
void |
addClass0(int[] glyphs)
Add glyphs in Class 0. |
int |
getClass(int glyph)
Returns the class for the glyph or -1 if not found. |
int |
getFormat()
Getter for format. |
static ClassDefTable |
newInstance(RandomAccessR rar,
XtfGlyphName xtfGlyph,
int defNr)
Returns a new instance of the ClassDefTable. |
void |
writeXML(XMLStreamWriter writer)
Write the data to a XMLStreamWriter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<java.lang.Integer,java.lang.Integer> classMap
protected int defNr
protected int format
protected XtfGlyphName xtfGlyph
| Constructor Detail |
|---|
public ClassDefTable()
| Method Detail |
|---|
public static ClassDefTable newInstance(RandomAccessR rar,
XtfGlyphName xtfGlyph,
int defNr)
throws java.io.IOException
rar - The input.xtfGlyph - The glyph name.defNr - The class def number.
java.io.IOException - if a IO-error occurred.public void addClass0(int[] glyphs)
All glyphs not assigned to a class fall into Class 0.
glyphs - The glyphs (number) from the coverage list.public int getClass(int glyph)
glyph - The glyph number.
public int getFormat()
public void writeXML(XMLStreamWriter writer)
throws java.io.IOException
writeXML in interface XMLWriterConvertiblewriter - the XML-Writer
java.io.IOException - if an IO-error occurs.XMLWriterConvertible.writeXML(org.extex.util.xml.XMLStreamWriter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||