com.lowagie.text.pdf
class TrueTypeFontSubSet extends Object
Field Summary | |
---|---|
static int | ARG_1_AND_2_ARE_WORDS |
protected int | directoryOffset |
static int[] | entrySelectors |
protected String | fileName The file name. |
protected int | fontPtr |
protected int | glyfTableRealSize |
protected ArrayList | glyphsInList |
protected HashMap | glyphsUsed |
static int | HEAD_LOCA_FORMAT_OFFSET |
protected boolean | includeCmap |
protected boolean | includeExtras |
protected boolean | locaShortTable |
protected int[] | locaTable |
protected int | locaTableRealSize |
static int | MORE_COMPONENTS |
protected byte[] | newGlyfTable |
protected int[] | newLocaTable |
protected byte[] | newLocaTableOut |
protected byte[] | outFont |
protected RandomAccessFileOrArray | rf The file in use. |
protected HashMap | tableDirectory Contains the location of the several tables. |
protected int | tableGlyphOffset |
static String[] | tableNamesCmap |
static String[] | tableNamesExtra |
static String[] | tableNamesSimple |
static int | TABLE_CHECKSUM |
static int | TABLE_LENGTH |
static int | TABLE_OFFSET |
static int | WE_HAVE_AN_X_AND_Y_SCALE |
static int | WE_HAVE_A_SCALE |
static int | WE_HAVE_A_TWO_BY_TWO |
Constructor Summary | |
---|---|
TrueTypeFontSubSet(String fileName, RandomAccessFileOrArray rf, HashMap glyphsUsed, int directoryOffset, boolean includeCmap, boolean includeExtras) Creates a new TrueTypeFontSubSet |
Method Summary | |
---|---|
protected void | assembleFont() |
protected int | calculateChecksum(byte[] b) |
protected void | checkGlyphComposite(int glyph) |
protected void | createNewGlyphTables() |
protected void | createTableDirectory() |
protected void | flatGlyphs() |
protected void | locaTobytes() |
byte[] | process() Does the actual work of subsetting the font. |
protected void | readLoca() |
protected String | readStandardString(int length) Reads a String from the font file as bytes using the Cp1252
encoding. |
protected void | writeFontInt(int n) |
protected void | writeFontShort(int n) |
protected void | writeFontString(String s) |
int[3]
where position 0
is the checksum, position 1 is the offset from the start of the file
and position 2 is the length of the table.Parameters: directoryOffset The offset from the start of the file to the table directory fileName the file name of the font glyphsUsed the glyphs used includeCmap true
if the table cmap is to be included in the generated font
Returns: the subset font
Throws: IOException on error DocumentException on error
String
from the font file as bytes using the Cp1252
encoding.Parameters: length the length of bytes to read
Returns: the String
read
Throws: IOException the font file could not be read