Package org.apache.fontbox.cff
Class CFFFont
java.lang.Object
org.apache.fontbox.cff.CFFFont
- All Implemented Interfaces:
FontBoxFont
- Direct Known Subclasses:
CFFCIDFont
,CFFType1Font
An Adobe Compact Font Format (CFF) font. Thread safe.
- Author:
- Villu Ruusmann, John Hewson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CFFCharset
protected byte[][]
protected String
protected byte[][]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addValueToTopDict
(String name, Object value) Adds the given key/value pair to the top dictionary.Returns the CFFCharset of the font.final List
<byte[]> Returns the character strings dictionary.byte[]
getData()
Returns the CFF data.Returns the FontBBox.Returns the FontMatrix.List
<byte[]> Returns the list containing the global subroutines.getName()
The name of the font.int
Returns the number of charstrings in the font.Returns the top dictionary.abstract Type2CharString
getType2CharString
(int cidOrGid) Returns the Type 2 charstring for the given CID.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.fontbox.FontBoxFont
getPath, getWidth, hasGlyph
-
Field Details
-
fontName
-
topDict
-
charset
-
charStrings
protected byte[][] charStrings -
globalSubrIndex
protected byte[][] globalSubrIndex
-
-
Constructor Details
-
CFFFont
public CFFFont()
-
-
Method Details
-
getName
The name of the font.- Specified by:
getName
in interfaceFontBoxFont
- Returns:
- the name of the font
-
addValueToTopDict
Adds the given key/value pair to the top dictionary.- Parameters:
name
- the given keyvalue
- the given value
-
getTopDict
Returns the top dictionary.- Returns:
- the dictionary
-
getFontMatrix
Returns the FontMatrix.- Specified by:
getFontMatrix
in interfaceFontBoxFont
-
getFontBBox
Returns the FontBBox.- Specified by:
getFontBBox
in interfaceFontBoxFont
-
getCharset
Returns the CFFCharset of the font.- Returns:
- the charset
-
getCharStringBytes
Returns the character strings dictionary. For expert users only.- Returns:
- the character strings dictionary as a list of byte arrays.
-
getData
Returns the CFF data.- Throws:
IOException
-
getNumCharStrings
public int getNumCharStrings()Returns the number of charstrings in the font. -
getGlobalSubrIndex
Returns the list containing the global subroutines.- Returns:
- a list of the global subroutines.
-
getType2CharString
Returns the Type 2 charstring for the given CID.- Parameters:
cidOrGid
- CID for CIFFont, or GID for Type 1 font- Throws:
IOException
- if the charstring could not be read
-
toString
-