com.sun.pdfview.font.ttf

Class TrueTypeTable

public class TrueTypeTable extends Object

The base class for TrueType tables. Specific tables can extend this to add more functionality
Field Summary
static intCMAP_TABLE
Well known tables
static intGLYF_TABLE
static intHEAD_TABLE
static intHHEA_TABLE
static intHMTX_TABLE
static intLOCA_TABLE
static intMAXP_TABLE
static intNAME_TABLE
static intPOST_TABLE
Constructor Summary
protected TrueTypeTable(int tag)
Creates a new instance of TrueTypeTable.
Method Summary
static TrueTypeTablecreateTable(TrueTypeFont ttf, String tagString)
Get a new instance of an empty table by tag string
static TrueTypeTablecreateTable(TrueTypeFont ttf, String tagString, ByteBuffer data)
Get a new instance of a table with provided data
ByteBuffergetData()
Get the data in the table
intgetLength()
Get the size of the table, in bytes
intgetTag()
Get the table's tag
voidsetData(ByteBuffer data)
Set the data in the table
static intstringToTag(String tag)
Turn a string into a tag
static StringtagToString(int tag)
Get the tag as a string
StringtoString()
Put into a nice string

Field Detail

CMAP_TABLE

public static final int CMAP_TABLE
Well known tables

GLYF_TABLE

public static final int GLYF_TABLE

HEAD_TABLE

public static final int HEAD_TABLE

HHEA_TABLE

public static final int HHEA_TABLE

HMTX_TABLE

public static final int HMTX_TABLE

LOCA_TABLE

public static final int LOCA_TABLE

MAXP_TABLE

public static final int MAXP_TABLE

NAME_TABLE

public static final int NAME_TABLE

POST_TABLE

public static final int POST_TABLE

Constructor Detail

TrueTypeTable

protected TrueTypeTable(int tag)
Creates a new instance of TrueTypeTable. This method is protected. Use the getTable() methods to get new instances.

Parameters: tag the tag for this table

Method Detail

createTable

public static TrueTypeTable createTable(TrueTypeFont ttf, String tagString)
Get a new instance of an empty table by tag string

Parameters: ttf the font that contains this table tagString the tag for this table, as a 4 character string (e.g. head or cmap)

createTable

public static TrueTypeTable createTable(TrueTypeFont ttf, String tagString, ByteBuffer data)
Get a new instance of a table with provided data

Parameters: ttf the font that contains this table tagString the tag for this table, as a 4 character string (e.g. head or cmap) data the table data

getData

public ByteBuffer getData()
Get the data in the table

getLength

public int getLength()
Get the size of the table, in bytes

getTag

public int getTag()
Get the table's tag

setData

public void setData(ByteBuffer data)
Set the data in the table

stringToTag

public static int stringToTag(String tag)
Turn a string into a tag

tagToString

public static String tagToString(int tag)
Get the tag as a string

toString

public String toString()
Put into a nice string