Package org.apache.fontbox.cff
Class CFFCIDFont
java.lang.Object
org.apache.fontbox.cff.CFFFont
org.apache.fontbox.cff.CFFCIDFont
- All Implemented Interfaces:
FontBoxFont
A Type 0 CIDFont represented in a CFF file. Thread safe.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classPrivate implementation of Type1CharStringReader, because only CFFType1Font can expose this publicly, as CIDFonts only support this for legacy 'seac' commands. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Integer,CIDKeyedType2CharString> private FDSelectprivate Stringprivate final CFFCIDFont.PrivateType1CharStringReaderprivate Stringprivate intFields inherited from class org.apache.fontbox.cff.CFFFont
charset, charStrings, fontName, globalSubrIndex, topDict -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intgetDefaultWidthX(int gid) Returns the defaultWidthX for the given GID.Returns the fdSelect value.Returns the font dictionaries.Returns the FontMatrix.private byte[][]getLocalSubrIndex(int gid) Returns the LocalSubrIndex for the given GID.private intgetNominalWidthX(int gid) Returns the nominalWidthX for the given GID.Returns the ordering value.Returns the path for the character with the given name.Returns the private dictionary.Returns the registry value.intReturns the supplement value.getType2CharString(int cid) Returns the Type 2 charstring for the given CID.floatReturns the advance width for the character with the given name.booleanReturns true if the font contains the given glyph.private intselectorToCID(String selector) Parses a CID selector of the form \ddddd.(package private) voidsetFdSelect(FDSelect fdSelect) Sets the fdSelect value.(package private) voidsetFontDict(List<Map<String, Object>> fontDict) Sets the font dictionaries.(package private) voidsetOrdering(String ordering) Sets the ordering value.(package private) voidsetPrivDict(List<Map<String, Object>> privDict) Sets the private dictionary.(package private) voidsetRegistry(String registry) Sets the registry value.(package private) voidsetSupplement(int supplement) Sets the supplement value.Methods inherited from class org.apache.fontbox.cff.CFFFont
addValueToTopDict, getCharset, getCharStringBytes, getData, getFontBBox, getGlobalSubrIndex, getName, getNumCharStrings, getTopDict, setCharset, setData, setGlobalSubrIndex, setName, toString
-
Field Details
-
registry
-
ordering
-
supplement
private int supplement -
fontDictionaries
-
privateDictionaries
-
fdSelect
-
charStringCache
-
reader
-
-
Constructor Details
-
CFFCIDFont
public CFFCIDFont()
-
-
Method Details
-
getRegistry
Returns the registry value. * @return the registry -
setRegistry
Sets the registry value.- Parameters:
registry- the registry to set
-
getOrdering
Returns the ordering value.- Returns:
- the ordering
-
setOrdering
Sets the ordering value.- Parameters:
ordering- the ordering to set
-
getSupplement
public int getSupplement()Returns the supplement value.- Returns:
- the supplement
-
setSupplement
void setSupplement(int supplement) Sets the supplement value.- Parameters:
supplement- the supplement to set
-
getFontDicts
Returns the font dictionaries.- Returns:
- the fontDict
-
setFontDict
Sets the font dictionaries.- Parameters:
fontDict- the fontDict to set
-
getPrivDicts
Returns the private dictionary.- Returns:
- the privDict
-
setPrivDict
Sets the private dictionary.- Parameters:
privDict- the privDict to set
-
getFdSelect
Returns the fdSelect value.- Returns:
- the fdSelect
-
setFdSelect
Sets the fdSelect value.- Parameters:
fdSelect- the fdSelect to set
-
getDefaultWidthX
private int getDefaultWidthX(int gid) Returns the defaultWidthX for the given GID.- Parameters:
gid- GID
-
getNominalWidthX
private int getNominalWidthX(int gid) Returns the nominalWidthX for the given GID.- Parameters:
gid- GID
-
getLocalSubrIndex
private byte[][] getLocalSubrIndex(int gid) Returns the LocalSubrIndex for the given GID.- Parameters:
gid- GID
-
getType2CharString
Returns the Type 2 charstring for the given CID.- Specified by:
getType2CharStringin classCFFFont- Parameters:
cid- CID- Throws:
IOException- if the charstring could not be read
-
getFontMatrix
Description copied from class:CFFFontReturns the FontMatrix.- Specified by:
getFontMatrixin interfaceFontBoxFont- Specified by:
getFontMatrixin classCFFFont
-
getPath
Description copied from interface:FontBoxFontReturns the path for the character with the given name.- Returns:
- glyph path
- Throws:
IOException- if the path could not be read
-
getWidth
Description copied from interface:FontBoxFontReturns the advance width for the character with the given name.- Returns:
- glyph advance width
- Throws:
IOException- if the path could not be read
-
hasGlyph
Description copied from interface:FontBoxFontReturns true if the font contains the given glyph.- Parameters:
selector- PostScript glyph name- Throws:
IOException
-
selectorToCID
Parses a CID selector of the form \ddddd.
-