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
-
public class PDType1Font extends PDSimpleFont
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
Constructors Constructor Description PDType1Font(COSDictionary dictionary)
Constructor from type 1 font dictionary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getBoundingBox()
Set<String>
getDescriptorCharSet()
FontProgram
getFontProgram()
Double
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.Boolean
isStandard()
String
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, getObject, getRealKey, getStringKey, knownKey, removeKey, setBooleanKey, setIntegerKey, setKey, setNameKey, setObject, setObject, setStringKey, updateFromObject, updateToObject
-
-
-
-
Constructor Detail
-
PDType1Font
public PDType1Font(COSDictionary dictionary)
Constructor from type 1 font dictionary.- Parameters:
dictionary
- is type 1 font dictionary.
-
-
Method Detail
-
getDescriptorCharSet
public Set<String> getDescriptorCharSet()
- Returns:
- set of character names defined in font as specified in CIDSet in font descriptor.
-
getFontProgram
public FontProgram getFontProgram()
- Specified by:
getFontProgram
in classPDFont
- Returns:
- embedded font program fo this PDFont.
-
isStandard
public Boolean isStandard()
- Returns:
- true if this font is one of standard 14 fonts.
-
getWidth
public Double getWidth(int code)
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
public String toUnicodePDFA1(int code)
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.
-
-