public class CFFType1Font extends CFFFont implements EncodedFont
Modifier and Type | Class and Description |
---|---|
private class |
CFFType1Font.PrivateType1CharStringReader
Private implementation of Type1CharStringReader, because only CFFType1Font can
expose this publicly, as CIDFonts only support this for legacy 'seac' commands.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Integer,Type2CharString> |
charStringCache |
private CFFEncoding |
encoding |
private java.util.Map<java.lang.String,java.lang.Object> |
privateDict |
private CFFType1Font.PrivateType1CharStringReader |
reader |
charset, charStrings, fontName, globalSubrIndex, topDict
Constructor and Description |
---|
CFFType1Font() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addToPrivateDict(java.lang.String name,
java.lang.Object value)
Adds the given key/value pair to the private dictionary.
|
private int |
getDefaultWidthX() |
CFFEncoding |
getEncoding()
Returns the CFFEncoding of the font.
|
java.util.List<java.lang.Number> |
getFontMatrix()
Returns the FontMatrix.
|
private byte[][] |
getLocalSubrIndex() |
private int |
getNominalWidthX() |
java.awt.geom.GeneralPath |
getPath(java.lang.String name)
Returns the path for the character with the given name.
|
java.util.Map<java.lang.String,java.lang.Object> |
getPrivateDict()
Returns the private dictionary.
|
private java.lang.Object |
getProperty(java.lang.String name) |
Type1CharString |
getType1CharString(java.lang.String name)
Returns the Type 1 charstring for the given PostScript glyph name.
|
Type2CharString |
getType2CharString(int gid)
Returns the Type 1 charstring for the given GID.
|
private Type2CharString |
getType2CharString(int gid,
java.lang.String name) |
float |
getWidth(java.lang.String name)
Returns the advance width for the character with the given name.
|
boolean |
hasGlyph(java.lang.String name)
Returns true if the font contains the given glyph.
|
int |
nameToGID(java.lang.String name)
Returns the GID for the given PostScript glyph name.
|
(package private) void |
setEncoding(CFFEncoding encoding)
Sets the CFFEncoding of the font.
|
addValueToTopDict, getCharset, getCharStringBytes, getData, getFontBBox, getGlobalSubrIndex, getName, getNumCharStrings, getTopDict, setCharset, setData, setGlobalSubrIndex, setName, toString
private final java.util.Map<java.lang.String,java.lang.Object> privateDict
private CFFEncoding encoding
private final java.util.Map<java.lang.Integer,Type2CharString> charStringCache
private final CFFType1Font.PrivateType1CharStringReader reader
public java.awt.geom.GeneralPath getPath(java.lang.String name) throws java.io.IOException
FontBoxFont
getPath
in interface FontBoxFont
java.io.IOException
- if the path could not be readpublic float getWidth(java.lang.String name) throws java.io.IOException
FontBoxFont
getWidth
in interface FontBoxFont
java.io.IOException
- if the path could not be readpublic boolean hasGlyph(java.lang.String name)
FontBoxFont
hasGlyph
in interface FontBoxFont
name
- PostScript glyph namepublic java.util.List<java.lang.Number> getFontMatrix()
CFFFont
getFontMatrix
in interface FontBoxFont
getFontMatrix
in class CFFFont
public Type1CharString getType1CharString(java.lang.String name) throws java.io.IOException
name
- PostScript glyph namejava.io.IOException
- if the charstring could not be readpublic int nameToGID(java.lang.String name)
name
- a PostScript glyph name.public Type2CharString getType2CharString(int gid) throws java.io.IOException
getType2CharString
in class CFFFont
gid
- GIDjava.io.IOException
- if the charstring could not be readprivate Type2CharString getType2CharString(int gid, java.lang.String name) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,java.lang.Object> getPrivateDict()
void addToPrivateDict(java.lang.String name, java.lang.Object value)
name
- the given keyvalue
- the given valuepublic CFFEncoding getEncoding()
getEncoding
in interface EncodedFont
void setEncoding(CFFEncoding encoding)
encoding
- the given CFFEncodingprivate byte[][] getLocalSubrIndex()
private java.lang.Object getProperty(java.lang.String name)
private int getDefaultWidthX()
private int getNominalWidthX()