public class TrueTypeFontProgram extends BaseTrueTypeProgram implements FontProgram
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isSymbolic |
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 |
containsCode(int code)
Checks if font contains character with given ID.
|
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.
|
getCmapEncodingPlatform, getFontProgramResource, getNGlyphs, 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 float getWidth(String glyphName)
getWidth in interface FontProgramglyphName - is name for glyph.public boolean isSymbolic()
Copyright © 2015–2017 The veraPDF Consortium. All rights reserved.