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,
CMap cMap,
boolean isSubset)
Constructor from stream.
|
| 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 |
containsGlyph(String glyphName)
Checks if this font program has glyph for given glyph name.
|
List<Integer> |
getCIDList() |
FontProgram |
getFont() |
ASFileStreamCloser |
getFontProgramResource() |
String |
getGlyphName(int code)
Returns glyph name for glyph with given code.
|
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, CMap cMap, boolean isSubset) throws IOException
stream - is stream with CFF program.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 String getGlyphName(int code)
FontProgramgetGlyphName in interface FontProgramcode - is code of glyph.public boolean isCIDFont()
public boolean containsCode(int code)
containsCode in interface FontProgramcode - is character code.public boolean containsGlyph(String glyphName)
FontProgramcontainsGlyph in interface FontProgramglyphName - is the name of glyph.public boolean containsCID(int cid)
FontProgramcontainsCID in interface FontProgrampublic 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.