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

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

public class TtfTableLOCA
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The 'loca' table stores the offsets to the locations of the glyphs in the font relative to the beginning of the 'glyf' table. Its purpose is to provide quick access to the data for a particular character.

Glyph Index Offset Glyph length
0 0 100
1 100 150
2 250
.. .. ..
n-1 1170 120
extra 1290

'loca' short version

Type Name Description
uint16 offsets[n] The actual local offset divided by 2 is stored. The value of n is the number of glyphs in the font + 1. The number of glyphs in the font is found in the maximum profile table.

'loca' long version

Type Name Description
uint32 offsets[n] The actual local offset is stored. The value of n is the number of glyphs in the font + 1. The number of glyphs in the font is found in the maximum profile table.

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Constructor Summary
TtfTableLOCA(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object.
 
Method Summary
 int getInitOrder()
          Returns a order number to sort the tables for the init process.
 int getOffset(int i)
          Returns the offset.
 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

TtfTableLOCA

public TtfTableLOCA(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

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

getOffset

public int getOffset(int i)
Returns the offset.

Parameters:
i - index
Returns:
Returns the offset

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