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

java.lang.Object
  extended by org.extex.font.format.xtf.tables.XtfTableDirectory
All Implemented Interfaces:
XMLWriterConvertible

public class XtfTableDirectory
extends java.lang.Object
implements XMLWriterConvertible

Class for a TTF/OTF TableDirectory.

Type Name Description
Fixed sfnt version 0x00010000 for version 1.0.
USHORT numTables Number of tables.
USHORT searchRange (Maximum power of 2  numTables) x 16.
USHORT entrySelector 2 (maximum power of 2  numTables).
USHORT rangeShift NumTables x 16-searchRange.

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Nested Class Summary
static class XtfTableDirectory.Entry
          Class for a TTF TableDirectory-Entry.
 
Constructor Summary
XtfTableDirectory(RandomAccessR rar)
          Create a new object.
 
Method Summary
 XtfTableDirectory.Entry[] getEntries()
          Returns the entries.
 XtfTableDirectory.Entry getEntry(int index)
          Returns the DirectoryEntry at the index
 XtfTableDirectory.Entry getEntryByTag(int tag)
          Returns the DirectoryEntry with a tag
 short getEntrySelector()
          Returns the entrySelector.
 short getNumTables()
          Returns the numTables.
 short getRangeShift()
          Returns the rangeShift.
 short getSearchRange()
          Returns the searchRange.
 int getVersion()
           
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtfTableDirectory

public XtfTableDirectory(RandomAccessR rar)
                  throws java.io.IOException
Create a new object.

Parameters:
rar - input
Throws:
java.io.IOException - if an error occurs
Method Detail

getEntries

public XtfTableDirectory.Entry[] getEntries()
Returns the entries.

Returns:
Returns the entries.

getEntrySelector

public short getEntrySelector()
Returns the entrySelector.

Returns:
Returns the entrySelector.

getNumTables

public short getNumTables()
Returns the numTables.

Returns:
Returns the numTables.

getRangeShift

public short getRangeShift()
Returns the rangeShift.

Returns:
Returns the rangeShift.

getSearchRange

public short getSearchRange()
Returns the searchRange.

Returns:
Returns the searchRange.

getVersion

public int getVersion()
Returns:
Returns the version.

getEntry

public XtfTableDirectory.Entry getEntry(int index)
Returns the DirectoryEntry at the index

Parameters:
index - the index
Returns:
Returns the DirectoryEntry at the index

getEntryByTag

public XtfTableDirectory.Entry getEntryByTag(int tag)
Returns the DirectoryEntry with a tag

Parameters:
tag - the tag
Returns:
Returns the DirectoryEntry with a tag

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)