Class PDFFontEncoding
java.lang.Object
org.openpdf.renderer.font.PDFFontEncoding
The PDFFont encoding encapsulates the mapping from character codes
in the PDF document to glyphs of the font.
Encodings take two basic forms. For Type1, TrueType, and Type3 fonts,
the encoding maps from character codes to Strings, which represent the
glyphs of the font. For Type0 fonts, the mapping is a CMap which maps
character codes to characters in one of many descendant fonts.
Note that the data in the PDF might be ASCII characters (bytes) or it might
be a multi-byte format such as unicode. For now we will assume all
glyph ids fit into at most the two bytes of a character.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]the base encoding (an array of integers which can be mapped to names using the methods on FontSupportprivate PDFCMapa CMap for fonts encoded by CMapany differences from the base encodingprivate PDFObjectprivate intthe type of this encoding (encoding or CMap)private static final intprivate static final intEncoding types -
Constructor Summary
ConstructorsConstructorDescriptionPDFFontEncoding(String fontType, PDFObject encoding) Creates a new instance of PDFFontEncodingPDFFontEncoding(PDFCMap cmap) -
Method Summary
Modifier and TypeMethodDescriptionprivate int[]getBaseEncoding(String encodingName) Get the base encoding for a given nameprivate PDFGlyphgetGlyphFromCMap(PDFFont font, char src) Get a glyph from a CMap, given a Type0 font and a characterprivate PDFGlyphgetGlyphFromEncoding(PDFFont font, char src) Get a glyph from an encoding, given a font and characterGet the glyphs associated with a given StringbooleanvoidparseEncoding(PDFObject encoding) Parse a PDF encoding object for the actual encoding
-
Field Details
-
TYPE_ENCODING
private static final int TYPE_ENCODINGEncoding types- See Also:
-
TYPE_CMAP
private static final int TYPE_CMAP- See Also:
-
baseEncoding
private int[] baseEncodingthe base encoding (an array of integers which can be mapped to names using the methods on FontSupport -
differences
-
cmap
a CMap for fonts encoded by CMap -
type
private int typethe type of this encoding (encoding or CMap) -
mapName
-
-
Constructor Details
-
PDFFontEncoding
-
PDFFontEncoding
Creates a new instance of PDFFontEncoding- Throws:
IOException
-
-
Method Details
-
getGlyphs
-
getGlyphFromEncoding
-
getGlyphFromCMap
-
parseEncoding
Parse a PDF encoding object for the actual encoding- Throws:
IOException
-
getBaseEncoding
Get the base encoding for a given name -
isOneByteIdentity
public boolean isOneByteIdentity()
-