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
ConstructorDescriptionPDType1Font
(COSDictionary dictionary) Constructor from type 1 font dictionary. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getWidth
(int code) Gets width for glyph with given code in this font.float
getWidthFromProgram
(int code) Gets width of given code from font program.boolean
glyphIsPresent
(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
toUnicode
Methods 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, getType, getWidths, isSubset, isSuccessfullyParsed, isSymbolic, readCode, 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, 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:
getFontProgram
in 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. -
getWidthFromProgram
public float getWidthFromProgram(int code) Description copied from class:PDFont
Gets width of given code from font program.- Specified by:
getWidthFromProgram
in 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:PDFont
Checks if glyph for given code is present in this font.- Specified by:
glyphIsPresent
in classPDFont
- Parameters:
code
- is code for glyph in this font.- Returns:
- true if glyph is present.
-
getBoundingBox
public double[] getBoundingBox()- Overrides:
getBoundingBox
in 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.
-