Package com.tom_roush.fontbox.cff
Class CFFType1Font
- java.lang.Object
-
- com.tom_roush.fontbox.cff.CFFFont
-
- com.tom_roush.fontbox.cff.CFFType1Font
-
- All Implemented Interfaces:
EncodedFont,FontBoxFont
public class CFFType1Font extends CFFFont implements EncodedFont
A Type 1-equivalent font program represented in a CFF file. Thread safe.
-
-
Field Summary
-
Fields inherited from class com.tom_roush.fontbox.cff.CFFFont
charset, charStrings, fontName, globalSubrIndex, topDict
-
-
Constructor Summary
Constructors Constructor Description CFFType1Font()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CFFEncodinggetEncoding()Returns the CFFEncoding of the font.List<Number>getFontMatrix()Returns the FontMatrix.android.graphics.PathgetPath(String name)Returns the path for the character with the given name.Map<String,Object>getPrivateDict()Returns the private dictionary.Type1CharStringgetType1CharString(String name)Returns the Type 1 charstring for the given PostScript glyph name.Type2CharStringgetType2CharString(int gid)Returns the Type 1 charstring for the given GID.floatgetWidth(String name)Returns the advance width for the character with the given name.booleanhasGlyph(String name)Returns true if the font contains the given glyph.intnameToGID(String name)Returns the GID for the given PostScript glyph name.-
Methods inherited from class com.tom_roush.fontbox.cff.CFFFont
addValueToTopDict, getCharset, getData, getFontBBox, getGlobalSubrIndex, getName, getNumCharStrings, getTopDict, toString
-
-
-
-
Method Detail
-
getPath
public android.graphics.Path getPath(String name) throws IOException
Description copied from interface:FontBoxFontReturns the path for the character with the given name.- Specified by:
getPathin interfaceFontBoxFont- Returns:
- glyph path
- Throws:
IOException- if the path could not be read
-
getWidth
public float getWidth(String name) throws IOException
Description copied from interface:FontBoxFontReturns the advance width for the character with the given name.- Specified by:
getWidthin interfaceFontBoxFont- Returns:
- glyph advance width
- Throws:
IOException- if the path could not be read
-
hasGlyph
public boolean hasGlyph(String name)
Description copied from interface:FontBoxFontReturns true if the font contains the given glyph.- Specified by:
hasGlyphin interfaceFontBoxFont- Parameters:
name- PostScript glyph name
-
getFontMatrix
public List<Number> getFontMatrix()
Description copied from class:CFFFontReturns the FontMatrix.- Specified by:
getFontMatrixin interfaceFontBoxFont- Specified by:
getFontMatrixin classCFFFont
-
getType1CharString
public Type1CharString getType1CharString(String name) throws IOException
Returns the Type 1 charstring for the given PostScript glyph name.- Parameters:
name- PostScript glyph name- Throws:
IOException- if the charstring could not be read
-
nameToGID
public int nameToGID(String name)
Returns the GID for the given PostScript glyph name.- Parameters:
name- a PostScript glyph name.- Returns:
- GID
-
getType2CharString
public Type2CharString getType2CharString(int gid) throws IOException
Returns the Type 1 charstring for the given GID.- Specified by:
getType2CharStringin classCFFFont- Parameters:
gid- GID- Throws:
IOException- if the charstring could not be read
-
getPrivateDict
public Map<String,Object> getPrivateDict()
Returns the private dictionary.- Returns:
- the dictionary
-
getEncoding
public CFFEncoding getEncoding()
Returns the CFFEncoding of the font.- Specified by:
getEncodingin interfaceEncodedFont- Returns:
- the encoding
-
-