org.extex.font.format.xtf.tables
Class TtfTableKERN.KernSubtableFormat0

java.lang.Object
  extended by org.extex.font.format.xtf.tables.TtfTableKERN.KernSubtable
      extended by org.extex.font.format.xtf.tables.TtfTableKERN.KernSubtableFormat0
All Implemented Interfaces:
XMLWriterConvertible
Enclosing class:
TtfTableKERN

public static class TtfTableKERN.KernSubtableFormat0
extends TtfTableKERN.KernSubtable

Format 0.

This is the only format that will be properly interpreted by Windows and OS/2.

Type Field Description
USHORT nPairs This gives the number of kerning pairs in the table.
USHORT searchRange The largest power of two less than or equal to the value of nPairs, multiplied by the size in bytes of an entry in the table.
USHORT entrySelector 2 of the largest power of two less than or equal to the value of nPairs. This value indicates how many iterations of the search loop will have to be made. (For example, in a list of eight items, there would have to be three iterations of the loop).
USHORT rangeShift The value of nPairs minus the largest power of two less than or equal to nPairs, and then multiplied by the size in bytes of an entry in the table.

This is followed by the list of kerning pairs and values. Each has the following format:

Type
Field Description
USHORT left The glyph index for the left-hand glyph in the kerning pair.
USHORT right The glyph index for the right-hand glyph in the kerning pair.
FWORD value The kerning value for the above pair, in FUnits. If this value is greater than zero, the characters will be moved apart. If this value is less than zero, the character will be moved closer together.


Method Summary
 int getEntrySelector()
          Returns the entrySelector.
 TtfTableKERN.KerningPair getKerning(int i)
          Returns the kerning
 int getKerningCount()
          Returns the number of kerning pairs.
 int getRangeShift()
          Returns the rangeShift.
 int getSearchRange()
          Returns the searchRange.
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class org.extex.font.format.xtf.tables.TtfTableKERN.KernSubtable
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEntrySelector

public int getEntrySelector()
Returns the entrySelector.

Returns:
Returns the entrySelector.

getKerning

public TtfTableKERN.KerningPair getKerning(int i)
Returns the kerning

Specified by:
getKerning in class TtfTableKERN.KernSubtable
Parameters:
i - index
Returns:
Returns the kerning
See Also:
TtfTableKERN.KernSubtable.getKerning(int)

getKerningCount

public int getKerningCount()
Returns the number of kerning pairs.

Specified by:
getKerningCount in class TtfTableKERN.KernSubtable
Returns:
Returns the number of kerning pairs.
See Also:
TtfTableKERN.KernSubtable.getKerningCount()

getRangeShift

public int getRangeShift()
Returns the rangeShift.

Returns:
Returns the rangeShift.

getSearchRange

public int getSearchRange()
Returns the searchRange.

Returns:
Returns the searchRange.

writeXML

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

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