public class CFFType1FontProgram extends Object implements FontProgram
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
attemptedParsing |
protected long |
charSetOffset |
protected CFFIndex |
charStrings |
protected long |
charStringsOffset |
protected int |
charStringType |
protected static float[] |
DEFAULT_FONT_MATRIX |
protected int |
defaultWidthX |
protected CFFIndex |
definedNames |
protected float[] |
fontMatrix |
protected CFFIndex |
globalSubrs |
protected boolean |
isSubset |
protected int |
nGlyphs |
protected int |
nominalWidthX |
protected long |
privateDictOffset |
protected long |
privateDictSize |
protected SeekableInputStream |
source |
protected ArrayList<CFFNumber> |
stack |
protected long |
subrsOffset |
protected boolean |
successfullyParsed |
protected long |
topDictBeginOffset |
protected long |
topDictEndOffset |
protected CharStringsWidths |
widths |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsCID(int cid)
Method works only for fonts where cid notation is used.
|
boolean |
containsCode(int code)
Checks if font contains character with given code.
|
boolean |
containsGID(int gid) |
boolean |
containsGlyph(String glyphName)
Checks if this font program has glyph for given glyph name.
|
static CFFType1FontProgram |
getCFFType1(FontProgram fontProgram)
Gets CFF Type 1 font program for given font program (CFF font program
with inner CFF Type 1 or CFF Type 1).
|
Set<String> |
getCharSet() |
String[] |
getEncoding() |
ASFileStreamCloser |
getFontProgramResource() |
String |
getGlyphName(int code)
Returns glyph name for glyph with given code.
|
int |
getNGlyphs() |
protected String |
getStringBySID(int sid) |
float |
getWidth(int charCode)
Returns width of glyph for given character code.
|
float |
getWidth(String charName)
Returns width of glyph for given glyph name.
|
float |
getWidthFromGID(int gid) |
boolean |
isAttemptedParsing() |
boolean |
isSuccessfulParsing() |
void |
parseFont()
This method does parsing of font, after it all the data needed should be
extracted.
|
protected int |
readCard16() |
protected int |
readCard8() |
protected void |
readCharStrings() |
protected void |
readHeader() |
protected CFFIndex |
readIndex() |
protected CFFNumber |
readNumber() |
protected void |
readPrivateDictUnit() |
protected void |
readTopDictOneByteOps(int lastRead) |
protected void |
readTopDictTwoByteOps(int lastRead) |
protected void |
readTopDictUnit() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFontProgramResourceprotected boolean attemptedParsing
protected boolean successfullyParsed
protected static final float[] DEFAULT_FONT_MATRIX
protected CFFIndex globalSubrs
protected boolean isSubset
protected long privateDictOffset
protected long privateDictSize
protected long topDictBeginOffset
protected long topDictEndOffset
protected float[] fontMatrix
protected long charStringsOffset
protected long charSetOffset
protected int charStringType
protected int nGlyphs
protected CFFIndex charStrings
protected CharStringsWidths widths
protected int defaultWidthX
protected int nominalWidthX
protected long subrsOffset
protected SeekableInputStream source
protected CFFIndex definedNames
public void parseFont()
throws IOException
parseFont in interface FontProgramIOException - if error in font parsing occurs.protected void readTopDictOneByteOps(int lastRead)
public String getGlyphName(int code)
FontProgramgetGlyphName in interface FontProgramcode - is code of glyph.public float getWidth(int charCode)
getWidth in interface FontProgramcharCode - is code for glyph.public float getWidthFromGID(int gid)
public boolean containsGID(int gid)
public boolean containsGlyph(String glyphName)
FontProgramcontainsGlyph in interface FontProgramglyphName - is the name of glyph.public float getWidth(String charName)
getWidth in interface FontProgramcharName - is name for glyph.public boolean containsCode(int code)
containsCode in interface FontProgramcode - is character code.public boolean containsCID(int cid)
FontProgramcontainsCID in interface FontProgrampublic String[] getEncoding()
public boolean isAttemptedParsing()
isAttemptedParsing in interface FontProgrampublic boolean isSuccessfulParsing()
isSuccessfulParsing in interface FontProgrampublic static CFFType1FontProgram getCFFType1(FontProgram fontProgram)
protected void readTopDictUnit()
throws IOException
IOExceptionprotected void readTopDictTwoByteOps(int lastRead)
throws IOException
IOExceptionprotected void readCharStrings()
throws IOException
IOExceptionprotected void readPrivateDictUnit()
throws IOException
IOExceptionpublic int getNGlyphs()
public ASFileStreamCloser getFontProgramResource()
protected int readCard8()
throws IOException
IOExceptionprotected int readCard16()
throws IOException
IOExceptionprotected CFFIndex readIndex() throws IOException
IOExceptionprotected void readHeader()
throws IOException
IOExceptionprotected CFFNumber readNumber() throws IOException
IOExceptionprotected String getStringBySID(int sid) throws IOException
IOExceptionCopyright © 2015–2020 The veraPDF Consortium. All rights reserved.