Class TrueTypeFont
java.lang.Object
com.sun.pdfview.font.ttf.TrueTypeFont
- Author:
- jkaplan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTable(String tagString, TrueTypeTable table) Add a table to the fontvoidaddTable(String tagString, ByteBuffer data) Add a table to the fontshortGet the entry selectorshortGet the number of tablesshortGet the range shiftshortGet the search rangeGet a table by name.intgetType()Get the type of this fontstatic voidstatic TrueTypeFontparseFont(byte[] orig) Parses a TrueType font from a byte arraystatic TrueTypeFontparseFont(ByteBuffer inBuf) Parses a TrueType font from a byte buffervoidremoveTable(String tagString) Remove a table by nametoString()Write the font to a pretty stringbyte[]Write a font given the type and an array of Table Directory Entries
-
Constructor Details
-
TrueTypeFont
public TrueTypeFont(int type) Creates a new instance of TrueTypeParser
-
-
Method Details
-
parseFont
Parses a TrueType font from a byte array -
parseFont
Parses a TrueType font from a byte buffer -
getType
public int getType()Get the type of this font -
addTable
Add a table to the font- Parameters:
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 buffer
-
addTable
Add a table to the font- Parameters:
tagString- the name of this table, as a 4 character string (i.e. cmap or head)table- the table
-
getTable
Get a table by name. This command causes the table in question to be parsed, if it has not already been parsed.- Parameters:
tagString- the name of this table, as a 4 character string (i.e. cmap or head)
-
removeTable
Remove a table by name- Parameters:
tagString- the name of this table, as a 4 character string (i.e. cmap or head)
-
getNumTables
public short getNumTables()Get the number of tables -
getSearchRange
public short getSearchRange()Get the search range -
getEntrySelector
public short getEntrySelector()Get the entry selector -
getRangeShift
public short getRangeShift()Get the range shift -
writeFont
public byte[] writeFont()Write a font given the type and an array of Table Directory Entries -
toString
-
main
- Parameters:
args- the command line arguments
-