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

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

public class TtfTableKERN
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The 'kern' table contains the values that adjust the intercharacter spacing for glyphs in a font.

The number of subtables included in the kerning table.
Type Name Description
fixed32 version The version number of the kerning table (0x00010000 for the current version).
uint32 nTables

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Nested Class Summary
static class TtfTableKERN.KerningPair
          KerningPair
static class TtfTableKERN.KernSubtable
          Abstract class for all kerntables
static class TtfTableKERN.KernSubtableFormat0
          Format 0.
static class TtfTableKERN.KernSubtableFormat2
          Format 2.
 
Constructor Summary
TtfTableKERN(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object
 
Method Summary
 int getKerning(int l, int r)
          Returns the kerning size.
 int getNumberOfTables()
          Returns the number of tables.
 java.lang.String getShortcut()
          Returns the table shortcut.
 TtfTableKERN.KernSubtable getTable(int i)
          Returns the table
 int getType()
          Get the table type, as a table directory value.
 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

TtfTableKERN

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

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

getKerning

public int getKerning(int l,
                      int r)
Returns the kerning size.

Parameters:
l - The left value (glyph position).
r - The rigth value (glyph position).
Returns:
Returns the kerning size.

getNumberOfTables

public int getNumberOfTables()
Returns the number of tables.

Returns:
Returns the number of tables.

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()

getTable

public TtfTableKERN.KernSubtable getTable(int i)
Returns the table

Parameters:
i - index
Returns:
Returns the table

getType

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

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

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)