public class CFFFontProgram extends Object implements FontProgram
| Modifier and Type | Field and Description |
|---|---|
protected CFFIndex |
definedNames |
protected SeekableStream |
source |
| Constructor and Description |
|---|
CFFFontProgram(ASInputStream stream,
Encoding pdEncoding,
CMap cMap)
Constructor from stream.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsCode(int code)
Checks if font contains character with given ID.
|
FontProgram |
getFont() |
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 |
isCIDFont() |
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 SeekableStream source
protected CFFIndex definedNames
public CFFFontProgram(ASInputStream stream, Encoding pdEncoding, CMap cMap) 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 FontProgram getFont()
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–2016 The veraPDF Consortium. All rights reserved.