public class TrueTypeFont
extends java.lang.Object
Constructor and Description |
---|
TrueTypeFont(int type)
Creates a new instance of TrueTypeParser
|
Modifier and Type | Method and Description |
---|---|
void |
addTable(java.lang.String tagString,
java.nio.ByteBuffer data)
Add a table to the font
|
void |
addTable(java.lang.String tagString,
TrueTypeTable table)
Add a table to the font
|
short |
getEntrySelector()
Get the entry selector
|
short |
getNumTables()
Get the number of tables
|
short |
getRangeShift()
Get the range shift
|
short |
getSearchRange()
Get the search range
|
TrueTypeTable |
getTable(java.lang.String tagString)
Get a table by name.
|
int |
getType()
Get the type of this font
|
static void |
main(java.lang.String[] args) |
static TrueTypeFont |
parseFont(byte[] orig)
Parses a TrueType font from a byte array
|
static TrueTypeFont |
parseFont(java.nio.ByteBuffer inBuf)
Parses a TrueType font from a byte buffer
|
void |
removeTable(java.lang.String tagString)
Remove a table by name
|
java.lang.String |
toString()
Write the font to a pretty string
|
byte[] |
writeFont()
Write a font given the type and an array of Table Directory Entries
|
public TrueTypeFont(int type)
public static TrueTypeFont parseFont(byte[] orig)
public static TrueTypeFont parseFont(java.nio.ByteBuffer inBuf)
public int getType()
public void addTable(java.lang.String tagString, java.nio.ByteBuffer data)
tagString
- the name of this table, as a 4 character string
(i.e. cmap or head)data
- the data for this table, as a byte bufferpublic void addTable(java.lang.String tagString, TrueTypeTable table)
tagString
- the name of this table, as a 4 character string
(i.e. cmap or head)table
- the tablepublic TrueTypeTable getTable(java.lang.String tagString)
tagString
- the name of this table, as a 4 character string
(i.e. cmap or head)public void removeTable(java.lang.String tagString)
tagString
- the name of this table, as a 4 character string
(i.e. cmap or head)public short getNumTables()
public short getSearchRange()
public short getEntrySelector()
public short getRangeShift()
public byte[] writeFont()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- the command line arguments