public class TrueTypeFontProgram extends BaseTrueTypeProgram implements FontProgram
encodingMappingArray, parser, widths| Constructor and Description |
|---|
TrueTypeFontProgram(ASInputStream stream,
boolean isSymbolic,
COSObject encoding)
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.
|
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 |
isSymbolic() |
void |
parseFont()
Parses True Type font from given stream and extracts all the data needed.
|
getFontProgramResource, getNGlyphs, getNrOfCMaps, getWidthWithCheck, isAttemptedParsing, isCmapPresent, isSuccessfulParsingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFontProgramResource, isAttemptedParsing, isSuccessfulParsingpublic TrueTypeFontProgram(ASInputStream stream, boolean isSymbolic, COSObject encoding) throws IOException
stream - is stream containing font data.isSymbolic - is true if font is marked as symbolic.encoding - is value of /Encoding in font dictionary.IOException - if creation of @{link SeekableStream} fails.public void parseFont()
throws IOException
BaseTrueTypeProgramparseFont in interface FontProgramparseFont in class BaseTrueTypeProgramIOException - if stream-reading error occurs.public boolean containsCode(int code)
containsCode in interface FontProgramcode - is character code.public float getWidth(int code)
getWidth in interface FontProgramcode - is code for glyph.public String getGlyphName(int code)
FontProgramgetGlyphName in interface FontProgramcode - is code of glyph.public float getWidth(String glyphName)
getWidth in interface FontProgramglyphName - is name for glyph.public boolean containsGlyph(String glyphName)
FontProgramcontainsGlyph in interface FontProgramglyphName - is the name of glyph.public boolean isSymbolic()
public boolean containsCID(int cid)
FontProgramcontainsCID in interface FontProgramCopyright © 2015–2018 The veraPDF Consortium. All rights reserved.