org.extex.font.format.xtf.tables
Class TtfTableHMTX

java.lang.Object
  extended by org.extex.font.format.xtf.tables.AbstractXtfTable
      extended by org.extex.font.format.xtf.tables.TtfTableHMTX
All Implemented Interfaces:
XtfGlyphName, XtfTable, XMLWriterConvertible

public class TtfTableHMTX
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The 'hmtx' table contains metric information for the horizontal layout each of the glyphs in the font.

Field Type Description
hMetrics longHorMetric[numberOfHMetrics] Paired advance width and left side bearing values for each glyph. The value numOfHMetrics comes from the ‘hhea’ table. If the font is monospaced, only one entry need be in the array, but that entry is required. The last entry applies to all subsequent glyphs.
leftSideBearing FWord[ ] Here the advanceWidth is assumed to be the same as the advanceWidth for the last entry above. The number of entries in this array is derived from numGlyphs (from ‘maxp’ table) minus numberOfHMetrics. This generally is used with a run of monospaced glyphs (e.g., Kanji fonts or Courier fonts). Only one run is allowed and it must be at the end. This allows a monospaced font to vary the left side bearing values for each glyph.

Version:
$Revision: 7274 $
Author:
Michael Niedermair

Constructor Summary
TtfTableHMTX(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object
 
Method Summary
 int getAdvanceWidth(int i)
          Returns the advanced width
 int getInitOrder()
          Returns a order number to sort the tables for the init process.
 short getLeftSideBearing(int i)
          Return the left side bearing
 java.lang.String getShortcut()
          Returns the table shortcut.
 int getType()
          Get the table type, as a table directory value.
 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, 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
getTableMap
 

Constructor Detail

TtfTableHMTX

public TtfTableHMTX(XtfTableMap tablemap,
                    XtfTableDirectory.Entry de,
                    RandomAccessR rar)
             throws java.io.IOException
Create a new object

Parameters:
tablemap - the tablemap
de - entray
rar - input
Throws:
java.io.IOException - if an IO-error occurs
Method Detail

getAdvanceWidth

public int getAdvanceWidth(int i)
Returns the advanced width

Parameters:
i - index
Returns:
Returns the advanced width

getInitOrder

public int getInitOrder()
Returns a order number to sort the tables for the init process.

Specified by:
getInitOrder in interface XtfTable
Overrides:
getInitOrder in class AbstractXtfTable
Returns:
Returns the order number.
See Also:
AbstractXtfTable.getInitOrder()

getLeftSideBearing

public short getLeftSideBearing(int i)
Return the left side bearing

Parameters:
i - index
Returns:
Return the left side bearing

getShortcut

public java.lang.String getShortcut()
Returns the table shortcut.

Specified by:
getShortcut in interface XtfTable
Returns:
Returns the table shortcut.
See Also:
XtfTable.getShortcut()

getType

public int getType()
Get the table type, as a table directory value.

Specified by:
getType in interface XtfTable
Returns:
Returns the table type

init

public void init()
Description copied from class: AbstractXtfTable
Initialize the table.

Specified by:
init in interface XtfTable
Overrides:
init in class AbstractXtfTable
See Also:
AbstractXtfTable.init()

writeXML

public void writeXML(XMLStreamWriter writer)
              throws java.io.IOException
Write the data to a XMLStreamWriter.

Specified by:
writeXML in interface XMLWriterConvertible
Parameters:
writer - the XML-Writer
Throws:
java.io.IOException - if an IO-error occurs.
See Also:
XMLWriterConvertible.writeXML( org.extex.util.xml.XMLStreamWriter)