|
||||||||||
| 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.TtfTableHDMX
public class TtfTableHDMX
The table 'hdmx' (Horizontal Device Metrics).
The hdmx table relates to OpenType fonts with TrueType outlines. The Horizontal Device Metrics table stores integer advance widths scaled to particular pixel sizes. This allows the font manager to build integer width tables without calling the scaler for each glyph. Typically this table contains only selected screen sizes. This table is sorted by pixel size. The checksum for this table applies to both subtables listed.
Note that for non-square pixel grids, the character width (in pixels) will be used to determine which device record to use. For example, a 12 point character on a device with a resolution of 72x96 would be 12 pixels high and 16 pixels wide. The hdmx device record for 16 pixel characters would be used.
If bit 4 of the flag field in the 'head' table is not set, then it is assumed that the font scales linearly; in this case an 'hdmx' table is not necessary and should not be built. If bit 4 of the flag field is set, then one or more glyphs in the font are assumed to scale nonlinearly. In this case, performance can be improved by including the 'hdmx' table with one or more important DeviceRecord's for important sizes.
hdmx Header
| Type | Name | Description | |
| USHORT | version | Table version number (0) | |
| SHORT | numRecords | Number of device records. | |
| LONG | sizeDeviceRecord | Size of a device record, long aligned. | |
| DeviceRecord | records[numRecords] | Array of device records. |
Device Record
| Type | Name | Description |
| BYTE | pixelSize | Pixel size for following widths (as ppem). |
| BYTE | maxWidth | Maximum width. |
| BYTE | Widths[numGlyphs] | Array of widths (numGlyphs is from the 'maxp' table). |
| Nested Class Summary | |
|---|---|
class |
TtfTableHDMX.DeviceRecord
the device record |
| Constructor Summary | |
|---|---|
TtfTableHDMX(XtfTableMap tablemap,
XtfTableDirectory.Entry de,
RandomAccessR rar)
Create a new object |
|
| Method Summary | |
|---|---|
TtfTableHDMX.DeviceRecord[] |
getDeviceRecord()
Returns the deviceRecord. |
int |
getNumRecords()
Returns the numRecords. |
java.lang.String |
getShortcut()
Returns the table shortcut. |
int |
getSizeDeviceRecord()
Returns the sizeDeviceRecord. |
int |
getType()
Get the table type, as a table directory value. |
int |
getVersion()
Returns the version. |
void |
init()
Initialize the table. |
void |
writeXML(XMLStreamWriter writer)
Write the data to a XMLStreamWriter. |
| Methods inherited from class org.extex.font.format.xtf.tables.AbstractXtfTable |
|---|
getGlyphName, getInitOrder, getTableMap, 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 |
| Constructor Detail |
|---|
public TtfTableHDMX(XtfTableMap tablemap,
XtfTableDirectory.Entry de,
RandomAccessR rar)
throws java.io.IOException
tablemap - the tablemapde - entryrar - input
java.io.IOException - if an IO-error occurs| Method Detail |
|---|
public TtfTableHDMX.DeviceRecord[] getDeviceRecord()
public int getNumRecords()
public java.lang.String getShortcut()
getShortcut in interface XtfTableXtfTable.getShortcut()public int getSizeDeviceRecord()
public int getType()
getType in interface XtfTablepublic int getVersion()
public void init()
throws java.io.IOException
init in interface XtfTableinit in class AbstractXtfTablejava.io.IOException - if a IO-error is occurred.AbstractXtfTable.init()
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 | |||||||||