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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CFFCharset
protected byte[][]
protected String
protected byte[][]
private CFFParser.ByteSource
-
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.(package private) void
setCharset
(CFFCharset charset) Sets the CFFCharset of the font.(package private) final void
setData
(CFFParser.ByteSource source) Sets a byte source to re-read the CFF data in the future.(package private) void
setGlobalSubrIndex
(byte[][] globalSubrIndexValue) Sets the global subroutine index data.(package private) void
Sets the name of the font.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 -
source
-
-
Constructor Details
-
CFFFont
public CFFFont()
-
-
Method Details
-
getName
The name of the font.- Specified by:
getName
in interfaceFontBoxFont
- Returns:
- the name of the font
-
setName
Sets the name of the font.- Parameters:
name
- 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
-
setCharset
Sets the CFFCharset of the font.- Parameters:
charset
- the given CFFCharset
-
getCharStringBytes
Returns the character strings dictionary. For expert users only.- Returns:
- the character strings dictionary as a list of byte arrays.
-
setData
Sets a byte source to re-read the CFF data in the future. -
getData
Returns the CFF data.- Throws:
IOException
-
getNumCharStrings
public int getNumCharStrings()Returns the number of charstrings in the font. -
setGlobalSubrIndex
void setGlobalSubrIndex(byte[][] globalSubrIndexValue) Sets the global subroutine index data.- Parameters:
globalSubrIndexValue
- a list of the global subroutines.
-
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
-