Package com.tom_roush.fontbox.cff
Class CFFFont
- java.lang.Object
-
- com.tom_roush.fontbox.cff.CFFFont
-
- All Implemented Interfaces:
FontBoxFont
- Direct Known Subclasses:
CFFCIDFont,CFFType1Font
public abstract class CFFFont extends Object implements FontBoxFont
An Adobe Compact Font Format (CFF) font. Thread safe.
-
-
Field Summary
Fields Modifier and Type Field Description protected CFFCharsetcharsetprotected List<byte[]>charStringsprotected StringfontNameprotected IndexDataglobalSubrIndexprotected Map<String,Object>topDict
-
Constructor Summary
Constructors Constructor Description CFFFont()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddValueToTopDict(String name, Object value)Adds the given key/value pair to the top dictionary.CFFCharsetgetCharset()Returns the CFFCharset of the font.byte[]getData()Returns the the original data.BoundingBoxgetFontBBox()Returns the FontBBox.abstract List<Number>getFontMatrix()Returns the FontMatrix.IndexDatagetGlobalSubrIndex()Returns the global subroutine index data.StringgetName()The name of the font.intgetNumCharStrings()Returns the number of charstrings in the font.Map<String,Object>getTopDict()Returns the top dictionary.abstract Type2CharStringgetType2CharString(int cidOrGid)Returns the Type 2 charstring for the given CID.StringtoString()-
Methods inherited from interface com.tom_roush.fontbox.FontBoxFont
getPath, getWidth, hasGlyph
-
-
-
-
Method Detail
-
getName
public String getName()
The name of the font.- Specified by:
getNamein interfaceFontBoxFont- Returns:
- the name of the font
-
addValueToTopDict
public void addValueToTopDict(String name, Object value)
Adds the given key/value pair to the top dictionary.- Parameters:
name- the given keyvalue- the given value
-
getTopDict
public Map<String,Object> getTopDict()
Returns the top dictionary.- Returns:
- the dictionary
-
getFontMatrix
public abstract List<Number> getFontMatrix()
Returns the FontMatrix.- Specified by:
getFontMatrixin interfaceFontBoxFont
-
getFontBBox
public BoundingBox getFontBBox()
Returns the FontBBox.- Specified by:
getFontBBoxin interfaceFontBoxFont
-
getCharset
public CFFCharset getCharset()
Returns the CFFCharset of the font.- Returns:
- the charset
-
getData
public byte[] getData()
Returns the the original data.- Returns:
- the dictionary
-
getNumCharStrings
public int getNumCharStrings()
Returns the number of charstrings in the font.
-
getGlobalSubrIndex
public IndexData getGlobalSubrIndex()
Returns the global subroutine index data.- Returns:
- the dictionary
-
getType2CharString
public abstract Type2CharString getType2CharString(int cidOrGid) throws IOException
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
-
-