public class CFFFontProgram extends Object implements FontProgram
| Modifier and Type | Field and Description |
|---|---|
protected CFFIndex |
definedNames |
protected SeekableInputStream |
source |
| Constructor and Description |
|---|
CFFFontProgram(ASInputStream stream,
Encoding pdEncoding,
CMap cMap,
boolean isSubset)
Constructor from stream.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsCode(int code)
Checks if font contains character with given ID.
|
FontProgram |
getFont() |
ASFileStreamCloser |
getFontProgramResource() |
protected String |
getStringBySID(int sid) |
float |
getWidth(int code)
Returns width of glyph for given character code.
|
float |
getWidth(String glyphName)
Returns width of glyph for given glyph name.
|
boolean |
isAttemptedParsing() |
boolean |
isCIDFont() |
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 |
readHeader() |
protected CFFIndex |
readIndex() |
protected CFFNumber |
readNumber() |
protected SeekableInputStream source
protected CFFIndex definedNames
public CFFFontProgram(ASInputStream stream, Encoding pdEncoding, CMap cMap, boolean isSubset) throws IOException
stream - is stream with CFF program.pdEncoding - is encoding object specified in font dictionary.IOException - if creation of @{link SeekableStream} fails.public void parseFont()
throws IOException
parseFont in interface FontProgramIOException - if error in font parsing occurs.public float getWidth(int code)
getWidth in interface FontProgramcode - is code for glyph.public float getWidth(String glyphName)
getWidth in interface FontProgramglyphName - is name for glyph.public boolean isCIDFont()
public boolean containsCode(int code)
containsCode in interface FontProgramcode - is character code.public boolean isAttemptedParsing()
isAttemptedParsing in interface FontProgrampublic boolean isSuccessfulParsing()
isSuccessfulParsing in interface FontProgrampublic FontProgram getFont()
public ASFileStreamCloser getFontProgramResource()
getFontProgramResource in interface FontProgramprotected 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–2017 The veraPDF Consortium. All rights reserved.