Package org.verapdf.pd.font.type1
Class PDType1Font
java.lang.Object
org.verapdf.pd.PDObject
org.verapdf.pd.PDResource
org.verapdf.pd.font.PDFont
org.verapdf.pd.font.PDSimpleFont
org.verapdf.pd.font.type1.PDType1Font
Class represents Type 1 font on PD level.
- Author:
- Sergey Shemyakov
-
Field Summary
Fields inherited from class org.verapdf.pd.font.PDFont
boundingBox, dictionary, encoding, fontDescriptor, fontProgram, isFontParsed, toUnicodeCMap -
Constructor Summary
ConstructorsConstructorDescriptionPDType1Font(COSDictionary dictionary) Constructor from type 1 font dictionary. -
Method Summary
Modifier and TypeMethodDescriptionprotected Encodingdouble[]getWidth(int code) Gets width for glyph with given code in this font.floatgetWidthFromProgram(int code) Gets width of given code from font program.booleanglyphIsPresent(int code) Checks if glyph for given code is present in this font.toUnicodePDFA1(int code) Get's Unicode value of character as it is described in PDF/A-1 specification.Methods inherited from class org.verapdf.pd.font.PDSimpleFont
toUnicodeMethods inherited from class org.verapdf.pd.font.PDFont
cMapToUnicode, getAscent, getDefaultWidth, getDescent, getDictionary, getDifferences, getDifferencesFromCosEncoding, getEncoding, getEncodingMapping, getFirstChar, getFontDescriptor, getFontWeight, getLastChar, getName, getNameWithoutSubset, getProgramSubtype, getSubtype, getSubtypeEntryValue, getType, getWidths, isSubset, isSuccessfullyParsed, isSymbolic, readCode, setSuccessfullyParsedMethods inherited from class org.verapdf.pd.PDResource
isInherited, setInheritedMethods inherited from class org.verapdf.pd.PDObject
clear, empty, getBooleanKey, getIntegerKey, getKey, getNameKey, getNameKeyStringValue, getObject, getRealKey, getStringKey, knownKey, removeKey, setBooleanKey, setIntegerKey, setKey, setNameKey, setObject, setObject, setStringKey, updateFromObject, updateToObject
-
Constructor Details
-
PDType1Font
Constructor from type 1 font dictionary.- Parameters:
dictionary- is type 1 font dictionary.
-
-
Method Details
-
getDescriptorCharSet
- Returns:
- set of character names defined in font as specified in CIDSet in font descriptor.
-
getFontProgram
- Specified by:
getFontProgramin classPDFont- Returns:
- embedded font program fo this PDFont.
-
isStandard
- Returns:
- true if this font is one of standard 14 fonts.
-
getWidth
Gets width for glyph with given code in this font. -
calculateEncodingMapping
- Overrides:
calculateEncodingMappingin classPDFont
-
getWidthFromProgram
public float getWidthFromProgram(int code) Description copied from class:PDFontGets width of given code from font program.- Specified by:
getWidthFromProgramin classPDFont- Parameters:
code- is code of character in strings to display.- Returns:
- width of glyph for this code.
-
glyphIsPresent
public boolean glyphIsPresent(int code) Description copied from class:PDFontChecks if glyph for given code is present in this font.- Specified by:
glyphIsPresentin classPDFont- Parameters:
code- is code for glyph in this font.- Returns:
- true if glyph is present.
-
getBoundingBox
public double[] getBoundingBox()- Overrides:
getBoundingBoxin classPDFont
-
toUnicodePDFA1
Get's Unicode value of character as it is described in PDF/A-1 specification. The difference from usual toUnicode method is in standard encoding and symbol set lookups for the glyph name.- Parameters:
code- is code of character.- Returns:
- Unicode value.
-