org.foray.font.format.ttf
Class TTFOffsetTableRecord

java.lang.Object
  extended by org.foray.font.format.ttf.TTFOffsetTableRecord

public final class TTFOffsetTableRecord
extends Object

A TrueType or OpenType Offset Table Record. This stores the offset and length of one table in the font.


Field Summary
static byte ENTRY_BYTES
          The size, in bytes, of each Table Directory entry.
 
Method Summary
 TTFOffsetTable getDirectory()
          Returns the parent directory.
 int getLength()
          Returns the length, in bytes, of this table entry.
 int getOffset()
          Returns the offset from the beginning of the file, in bytes, of this table entry.
 org.foray.font.format.ttf.TTFTable getTable()
          Returns the TTFTable that this entry points to.
 String getTag()
          Return this table's tag name.
static TTFOffsetTableRecord parse(TTFOffsetTable directory, RandomAccessInput raInput)
          Constructor.
protected  void setTable(org.foray.font.format.ttf.TTFTable table)
          Sets the TTFTable that corresponds to this table directory entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTRY_BYTES

public static final byte ENTRY_BYTES
The size, in bytes, of each Table Directory entry.

See Also:
Constant Field Values
Method Detail

parse

public static TTFOffsetTableRecord parse(TTFOffsetTable directory,
                                         RandomAccessInput raInput)
                                  throws IOException
Constructor.

Parameters:
directory - The parent directory instance from which this entry is read.
raInput - The input being parsed.
Returns:
The parsed entry.
Throws:
IOException - For i/o errors when parsing the entry.

getDirectory

public TTFOffsetTable getDirectory()
Returns the parent directory.

Returns:
The parent directory.

getTag

public String getTag()
Return this table's tag name.

Returns:
this table's tag name.

getOffset

public int getOffset()
Returns the offset from the beginning of the file, in bytes, of this table entry.

Returns:
The offset from the beginning of the file, in bytes, of this table entry.

getLength

public int getLength()
Returns the length, in bytes, of this table entry.

Returns:
The length, in bytes, of this table entry.

setTable

protected void setTable(org.foray.font.format.ttf.TTFTable table)
Sets the TTFTable that corresponds to this table directory entry. The table directory is typically read first, then the table itself is read and parsed later.

Parameters:
table - The table that corresponds to this entry.

getTable

public org.foray.font.format.ttf.TTFTable getTable()
Returns the TTFTable that this entry points to.

Returns:
The TTFTable that this entry points to, if it has been parsed, or null otherwise.


Copyright © 2017. All rights reserved.