|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.font.format.xtf.tables.AbstractXtfTable
org.extex.font.format.xtf.tables.OtfTableCFF
public class OtfTableCFF
The 'CFF' - PostScript font program.
This table contains a compact representation of a PostScript Type 1, or CIDFont and is structured according to Adobe Technical Note #5176: " The Compact BaseFont Format Specification" and Adobe Technical Note #5177: "Type 2 Charstring Format".
CFF Data Types
| Name | Range | Description |
| Card8 | 0 255 | 1-byte unsigned number |
| Card16 | 0 65535 | 2-byte unsigned number |
| Offset | varies | 1, 2, 3, or 4 byte offset (specified by OffSize field) |
| OffSize | 1 - 4 | 1-byte unsigned number specifies the size of an Offset field or fields |
| SID | 0 - 64999 | 2-byte string identifier |
CFF Data Layout
| Entry | Comments |
| Header | - |
| Name INDEX | - |
| Top DICT INDEX | - |
| String INDEX | ->/td> |
| Global Subr INDEX | - |
| Encodings | - |
| Charsets | - |
| FDSelect | CIDFonts only |
| CharStrings INDEX | per-font |
| BaseFont DICT INDEX | per-font, CIDFonts only |
| Private DICT | per-font |
| Local Subr INDEX | per-font or per-Private DICT for CIDFonts |
| Copyright and Trademark Notices | -/td> |
| Constructor Summary | |
|---|---|
OtfTableCFF(XtfTableMap tablemap,
XtfTableDirectory.Entry de,
RandomAccessR rar)
Create a new object |
|
| Method Summary | |
|---|---|
CffFont |
getFont(int number)
Returns the font. |
int |
getHdrSize()
Returns the hdrSize. |
int |
getNumGlyphs()
Returns the number of glyphs |
java.lang.String |
getShortcut()
Returns the table shortcut. |
java.lang.String |
getStringIndex(int sid)
Returns the String for the SID. |
int |
getType()
Get the table type, as a table directory value. |
int |
getVersionmajor()
Returns the version major. |
int |
getVersionminor()
Returns the version minor. |
int |
mapGlyphNameToGlyphPos(java.lang.String glyphname,
int fontnumber)
Map the glyph name to the glyph position. |
java.lang.String |
mapGlyphPosToGlyphName(int glyphpos,
int fontnumber)
Map the glyph position to the name of the glyph. |
byte[] |
readDataFromIndex(int start,
int end,
RandomAccessR rar)
An INDEX is an array of variable-sized objects. |
int[] |
readOffsets(RandomAccessR rar)
Read the offsets. |
void |
writeXML(XMLStreamWriter writer)
Write the data to a XMLStreamWriter. |
| Methods inherited from class org.extex.font.format.xtf.tables.AbstractXtfTable |
|---|
getGlyphName, getInitOrder, getTableMap, init, writeStartElement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.extex.font.format.xtf.tables.XtfTable |
|---|
getInitOrder, getTableMap, init |
| Constructor Detail |
|---|
public OtfTableCFF(XtfTableMap tablemap,
XtfTableDirectory.Entry de,
RandomAccessR rar)
throws java.io.IOException
tablemap - the table mapde - entryrar - input
java.io.IOException - if an IO-error occurs| Method Detail |
|---|
public CffFont getFont(int number)
number - The font numer.
public int getHdrSize()
public int getNumGlyphs()
public java.lang.String getShortcut()
XtfTable
getShortcut in interface XtfTableXtfTable.getShortcut()public java.lang.String getStringIndex(int sid)
sid - the SID for the string.
null, if not found.public int getType()
getType in interface XtfTablepublic int getVersionmajor()
public int getVersionminor()
public int mapGlyphNameToGlyphPos(java.lang.String glyphname,
int fontnumber)
glyphname - The glyph namefontnumber - The fontnumber.
public java.lang.String mapGlyphPosToGlyphName(int glyphpos,
int fontnumber)
glyphpos - The glyph positionfontnumber - The font number.
null, if not
found.
public byte[] readDataFromIndex(int start,
int end,
RandomAccessR rar)
throws java.io.IOException
It comprises a header, an offset array, and object data. The offset array specifies offsets within the object data. An object is retrieved by indexing the offset array and fetching the object at the specified offset. The object's length can be determined by subtracting its offset from the next offset in the offset array. An additional offset is added at the end of the offset array so the length of the last object may be determined.
| Type | Name | Description |
| Card16 | count | Number of objects stored in INDEX. An empty INDEX is represented by a count field with a 0 value and no additional fields. Thus, the total size of an empty INDEX is 2 bytes. |
| OffSize | offSize | Offset array element size |
| Offset | offset [count+1] | Offset array (from byte preceding object data). Offsets in the offset array are relative to the byte that precedes the object data. Therefore the first element of the offset array is always 1. (This ensures that every object has a corresponding offset which is always nonzero and permits the efficient implementation of dynamic object loading.) |
| Card8 | data [<varies>] | Object data |
start - the start offsetend - the end offsetrar - the input
java.io.IOException - if an IO-error occurs
public int[] readOffsets(RandomAccessR rar)
throws java.io.IOException
rar - The input.
java.io.IOException - if a IO-error occurred.
public void writeXML(XMLStreamWriter writer)
throws java.io.IOException
XMLWriterConvertible
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 | |||||||||