public abstract class PDFont extends PDResource
| Modifier and Type | Field and Description |
|---|---|
protected COSDictionary |
dictionary |
protected Encoding |
encoding |
protected PDFontDescriptor |
fontDescriptor |
protected FontProgram |
fontProgram |
protected boolean |
isFontParsed |
protected PDCMap |
toUnicodeCMap |
| Constructor and Description |
|---|
PDFont(COSDictionary dictionary)
Constructor from COSDictionary.
|
| Modifier and Type | Method and Description |
|---|---|
Double |
getDefaultWidth() |
COSDictionary |
getDictionary() |
Map<Integer,String> |
getDifferences() |
static Map<Integer,String> |
getDifferencesFromCosEncoding(COSObject e) |
COSObject |
getEncoding() |
Encoding |
getEncodingMapping() |
static Encoding |
getEncodingMappingFromCOSObject(COSObject e)
Gets encoding object from COSObject.
|
Long |
getFirstChar() |
PDFontDescriptor |
getFontDescriptor() |
COSStream |
getFontFile2() |
ASAtom |
getFontName() |
abstract FontProgram |
getFontProgram() |
Long |
getLastChar() |
String |
getName() |
ASAtom |
getProgramSubtype() |
ASAtom |
getSubtype() |
String |
getType() |
Double |
getWidth(int code)
Gets width for glyph with given code in this font.
|
abstract float |
getWidthFromProgram(int code)
Gets width of given code from font program.
|
COSObject |
getWidths() |
abstract boolean |
glyphIsPresent(int code)
Checks if glyph for given code is present in this font.
|
protected boolean |
isSubset() |
boolean |
isSuccessfullyParsed() |
boolean |
isSymbolic() |
int |
readCode(InputStream stream)
Method reads next character code from stream according to font data.
|
void |
setSuccessfullyParsed(boolean successfullyParsed)
Sets flag indicating successful parsing of embedded font program.
|
String |
toUnicode(int code)
Gets Unicode string for given character code.
|
isInherited, setInheritedclear, empty, getBooleanKey, getIntegerKey, getKey, getNameKey, getObject, getRealKey, getStringKey, knownKey, removeKey, setBooleanKey, setIntegerKey, setKey, setNameKey, setObject, setObject, setStringKey, updateFromObject, updateToObjectprotected COSDictionary dictionary
protected PDFontDescriptor fontDescriptor
protected PDCMap toUnicodeCMap
protected boolean isFontParsed
protected FontProgram fontProgram
protected Encoding encoding
public PDFont(COSDictionary dictionary)
dictionary - is font dictionary.public COSDictionary getDictionary()
public PDFontDescriptor getFontDescriptor()
public String getType()
public ASAtom getSubtype()
public ASAtom getFontName()
IllegalStateException - if font names specified in font dictionary
and font descriptor are different.public boolean isSymbolic()
public Encoding getEncodingMapping()
public static Encoding getEncodingMappingFromCOSObject(COSObject e)
e - is value of Encoding key in font dictionary.public String getName()
public COSObject getEncoding()
public COSStream getFontFile2()
public Map<Integer,String> getDifferences()
public static Map<Integer,String> getDifferencesFromCosEncoding(COSObject e)
public COSObject getWidths()
public Long getFirstChar()
public Long getLastChar()
public int readCode(InputStream stream) throws IOException
stream - is stream with raw data.IOException - if reading fails.public abstract FontProgram getFontProgram()
public abstract float getWidthFromProgram(int code)
code - is code of character in strings to display.public abstract boolean glyphIsPresent(int code)
code - is code for glyph in this font.public String toUnicode(int code)
code - is code for character.public ASAtom getProgramSubtype()
public Double getWidth(int code)
code - is code of glyph.public Double getDefaultWidth()
public boolean isSuccessfullyParsed()
public void setSuccessfullyParsed(boolean successfullyParsed)
protected boolean isSubset()
Copyright © 2015–2017 The veraPDF Consortium. All rights reserved.