Package org.verapdf.pd.font
Class PDType0Font
- java.lang.Object
-
- org.verapdf.pd.PDObject
-
- org.verapdf.pd.PDResource
-
- org.verapdf.pd.font.PDFont
-
- org.verapdf.pd.font.PDCIDFont
-
- org.verapdf.pd.font.PDType0Font
-
public class PDType0Font extends PDCIDFont
Represents Type0 font on pd level. Note that on the cos level object of this class is a COSDictionary of descendant font.- Author:
- Sergey Shemyakov
-
-
Field Summary
-
Fields inherited from class org.verapdf.pd.font.PDFont
boundingBox, dictionary, encoding, fontDescriptor, fontProgram, isFontParsed, toUnicodeCMap
-
-
Constructor Summary
Constructors Constructor Description PDType0Font(COSDictionary dictionary)
Constructs PD Type 0 font from font dictionary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDCMap
getCMap()
COSDictionary
getDescendantFont()
COSObject
getDescendantFontObject()
COSObject
getObject()
ASAtom
getSubtype()
COSDictionary
getType0FontDict()
void
setFontProgramFromDescendant(PDCIDFont descendant)
Updates font program information from descendant CID font.int
toCID(int code)
Gets CID value for given character code from this font.String
toUnicode(int code)
This method maps character code to a Unicode value.-
Methods inherited from class org.verapdf.pd.font.PDCIDFont
getCIDSet, getCIDSystemInfo, getCIDToGIDMap, getDefaultWidth, getFontProgram, getWidth, getWidthFromProgram, glyphIsPresent, readCode
-
Methods inherited from class org.verapdf.pd.font.PDFont
cMapToUnicode, getAscent, getBoundingBox, getDescent, getDictionary, getDifferences, getDifferencesFromCosEncoding, getEncoding, getEncodingMapping, getFirstChar, getFontDescriptor, getFontWeight, getLastChar, getName, getNameWithoutSubset, getProgramSubtype, getType, getWidths, isSubset, isSuccessfullyParsed, isSymbolic, setSuccessfullyParsed
-
Methods inherited from class org.verapdf.pd.PDResource
isInherited, setInherited
-
Methods inherited from class org.verapdf.pd.PDObject
clear, empty, getBooleanKey, getIntegerKey, getKey, getNameKey, getRealKey, getStringKey, knownKey, removeKey, setBooleanKey, setIntegerKey, setKey, setNameKey, setObject, setObject, setStringKey, updateFromObject, updateToObject
-
-
-
-
Constructor Detail
-
PDType0Font
public PDType0Font(COSDictionary dictionary)
Constructs PD Type 0 font from font dictionary.- Parameters:
dictionary
-
-
-
Method Detail
-
getCMap
public PDCMap getCMap()
- Returns:
- PD CMap associated with this Type 0 font as specified by Encoding key in font dictionary.
-
getDescendantFontObject
public COSObject getDescendantFontObject()
- Returns:
- COSObject that is font dictionary for descendant font.
-
getDescendantFont
public COSDictionary getDescendantFont()
- Returns:
- COSDictionary that is font dictionary for descendant font.
-
toUnicode
public String toUnicode(int code)
This method maps character code to a Unicode value. Firstly it checks toUnicode CMap, then it behaves like described in PDF32000_2008 9.10.2 "Mapping Character Codes to Unicode Values" for Type0 font.
-
setFontProgramFromDescendant
public void setFontProgramFromDescendant(PDCIDFont descendant)
Updates font program information from descendant CID font.- Parameters:
descendant
- is descendant CID font for this Type 0 font.
-
getType0FontDict
public COSDictionary getType0FontDict()
- Returns:
- COSDictionary that is font dictionary of this Type 0 font.
-
getSubtype
public ASAtom getSubtype()
- Overrides:
getSubtype
in classPDFont
- Returns:
- font subtype (Subtype entry).
-
toCID
public int toCID(int code)
Gets CID value for given character code from this font.- Parameters:
code
- is character code.- Returns:
- CID value for code.
-
-