Package com.itextpdf.io.font
Class CFFFont
java.lang.Object
com.itextpdf.io.font.CFFFont
- Direct Known Subclasses:
-
CFFFontSubset
Class containing base Compact Font Format functionality
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classA dictionary number on the list.protected static final classAn unknown offset in a dictionary for the list.protected final classRepresents font contained by the CFF font in a FontSet.protected static final classprotected static final classprotected static final classAn index-offset item for the list.protected static classList items for the linked list that builds the new CID font.protected static final classAn offset-marker item for the list.protected static classAn offset item, representing a data object.protected static final classA range item.protected static final classA String itemprotected static final classprotected static final classA SID or Card16 item.protected static final classCard24 item.protected static final classA Card32 item.protected static final classA Card8 item. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Object[]protected RandomAccessFileOrArrayA random Access File or an arrayprotected CFFFont.Font[]protected intprotected int[]protected Stringprotected intprotected int[]protected intprotected int[]protected intprotected int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks for font existence in FontSet.byte[]Gets a single CID font.protected voidprotected CFFFont.RangeItemgetEntireIndexRange(int indexOffset) A utility that creates a range item for an entire indexString[]getNames()Gets all font names from FontSet table.getString(char sid) Gets string from INDEX structure which corresponds to provided SID.booleanisCID()Determines whether the first font in FontSet is CID font.booleanDetermines whether specified font is CID font.
-
Field Details
-
key
-
args
-
arg_count
protected int arg_count -
buf
A random Access File or an array -
nameIndexOffset
protected int nameIndexOffset -
topdictIndexOffset
protected int topdictIndexOffset -
stringIndexOffset
protected int stringIndexOffset -
gsubrIndexOffset
protected int gsubrIndexOffset -
nameOffsets
protected int[] nameOffsets -
topdictOffsets
protected int[] topdictOffsets -
stringOffsets
protected int[] stringOffsets -
gsubrOffsets
protected int[] gsubrOffsets -
fonts
-
-
Constructor Details
-
CFFFont
public CFFFont(byte[] cff) Creates a new CFF font instance from CFF font data.- Parameters:
-
cff- cff font binary data
-
-
Method Details
-
getString
Gets string from INDEX structure which corresponds to provided SID.- Parameters:
-
sid- 2-byte string identifier - Returns:
- string value
-
getDictItem
protected void getDictItem() -
getEntireIndexRange
A utility that creates a range item for an entire index- Parameters:
-
indexOffset- where the index is - Returns:
- a range item representing the entire index
-
getCID
Gets a single CID font. The PDF architecture (1.4) supports 16-bit strings only with CID CFF fonts, not in Type-1 CFF fonts, so we convert the font to CID if it is in the Type-1 format. Two other tasks that we need to do are to select only a single font from the CFF package (this again is a PDF restriction) and to subset the CharStrings glyph description.- Parameters:
-
fontName- name of the font - Returns:
- byte array represents the CID font
-
isCID
public boolean isCID()Determines whether the first font in FontSet is CID font.- Returns:
-
trueif font is CID,falseotherwise
-
isCID
Determines whether specified font is CID font.- Parameters:
-
fontName- font name to check in fonts table - Returns:
-
trueif specified font is CID,falseotherwise
-
exists
Checks for font existence in FontSet.- Parameters:
-
fontName- font name to search for - Returns:
-
trueif font exists in FontSet,falseotherwise
-
getNames
Gets all font names from FontSet table.- Returns:
- font names contained by this CFF font
-