public class OpenTypeFontProgram extends Object implements FontProgram
| Constructor and Description |
|---|
OpenTypeFontProgram(ASInputStream source,
boolean isCFF,
boolean isSymbolic,
COSObject encoding,
CMap externalCMap,
boolean isSubset)
Constructor from stream, containing font data, and encoding details.
|
| 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.
|
FontProgram |
getFont() |
ASFileStreamCloser |
getFontProgramResource() |
String |
getGlyphName(int code)
Returns glyph name for glyph with given code.
|
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 |
isSuccessfulParsing() |
void |
parseFont()
This method does parsing of font, after it all the data needed should be
extracted.
|
public OpenTypeFontProgram(ASInputStream source, boolean isCFF, boolean isSymbolic, COSObject encoding, CMap externalCMap, boolean isSubset)
source - is stream containing font data.isSymbolic - is true if font is marked as symbolic.encoding - is value of /Encoding in font dictionary.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 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 String getGlyphName(int code)
FontProgramgetGlyphName in interface FontProgramcode - is code of glyph.public boolean isAttemptedParsing()
isAttemptedParsing in interface FontProgrampublic boolean isSuccessfulParsing()
isSuccessfulParsing in interface FontProgrampublic void parseFont()
throws IOException
parseFont in interface FontProgramIOException - if error in font parsing occurs.public FontProgram getFont()
public ASFileStreamCloser getFontProgramResource()
getFontProgramResource in interface FontProgramCopyright © 2015–2019 The veraPDF Consortium. All rights reserved.