Package com.lowagie.text.pdf
Class CMapAwareDocumentFont
java.lang.Object
com.lowagie.text.pdf.BaseFont
com.lowagie.text.pdf.DocumentFont
com.lowagie.text.pdf.CMapAwareDocumentFont
Implementation of DocumentFont used while parsing PDF streams.
- Since:
- 2.1.4
-
Field Summary
Fields inherited from class com.lowagie.text.pdf.BaseFont
ASCENT, AWT_ASCENT, AWT_DESCENT, AWT_LEADING, AWT_MAXADVANCE, BBOXLLX, BBOXLLY, BBOXURX, BBOXURY, BuiltinFonts14, CACHED, CAPHEIGHT, CHAR_RANGE_ARABIC, CHAR_RANGE_CYRILLIC, CHAR_RANGE_HEBREW, CHAR_RANGE_LATIN, charBBoxes, CID_NEWLINE, compressionLevel, COURIER, COURIER_BOLD, COURIER_BOLDOBLIQUE, COURIER_OBLIQUE, CP1250, CP1252, CP1257, DESCENT, differences, directTextToByte, embedded, EMBEDDED, encoding, fastWinansi, FONT_TYPE_CJK, FONT_TYPE_DOCUMENT, FONT_TYPE_T1, FONT_TYPE_T3, FONT_TYPE_TT, FONT_TYPE_TTUNI, fontCache, fontSpecific, forceWidthsOutput, HELVETICA, HELVETICA_BOLD, HELVETICA_BOLDOBLIQUE, HELVETICA_OBLIQUE, IDENTITY_H, IDENTITY_V, ITALICANGLE, MACROMAN, NOT_CACHED, NOT_EMBEDDED, notdef, RESOURCE_PATH, specialMap, STRIKETHROUGH_POSITION, STRIKETHROUGH_THICKNESS, SUBSCRIPT_OFFSET, SUBSCRIPT_SIZE, subset, subsetRanges, SUPERSCRIPT_OFFSET, SUPERSCRIPT_SIZE, SYMBOL, TIMES_BOLD, TIMES_BOLDITALIC, TIMES_ITALIC, TIMES_ROMAN, UNDERLINE_POSITION, UNDERLINE_THICKNESS, unicodeDifferences, widths, WINANSI, ZAPFDINGBATS -
Constructor Summary
ConstructorsConstructorDescriptionCMapAwareDocumentFont(PRIndirectReference refFont) Creates an instance of a CMapAwareFont based on an indirect reference to a font. -
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] cidbytes, int offset, int len) Decodes a string of bytes (encoded in the font's encoding) into a unicode string This will use the ToUnicode map of the font, if available, otherwise it uses the font's encodingencode(byte[] bytes, int offset, int len) Deprecated.method name is not indicative of what it does.intgetWidth(int char1) Gets the width of acharin normalized 1000 units.Methods inherited from class com.lowagie.text.pdf.DocumentFont
charExists, getAllNameEntries, getCharBBox, getFamilyFontName, getFontDescriptor, getFullFontName, getFullFontStream, getKerning, getPostscriptFontName, getRawCharBBox, getWidth, hasKernPairs, setKerning, setPostscriptFontNameMethods inherited from class com.lowagie.text.pdf.BaseFont
addSubsetRange, correctArabicAdvance, createEncoding, createFont, createFont, createFont, createFont, createFont, createFont, createFont, createSubsetPrefix, enumerateTTCNames, enumerateTTCNames, getAllFontNames, getAllNameEntries, getAscent, getAscentPoint, getBaseName, getCidCode, getCodePagesSupported, getCompressionLevel, getDescent, getDescentPoint, getDifferences, getDocumentFonts, getDocumentFonts, getEncoding, getFontType, getFullFontName, getResourceStream, getResourceStream, getUnicodeDifferences, getUnicodeEquivalent, getWidthPoint, getWidthPoint, getWidthPointKerned, getWidths, isDirectTextToByte, isEmbedded, isFontSpecific, isForceWidthsOutput, isSubset, normalizeEncoding, setCharAdvance, setCompressionLevel, setDirectTextToByte, setForceWidthsOutput, setSubset
-
Constructor Details
-
CMapAwareDocumentFont
Creates an instance of a CMapAwareFont based on an indirect reference to a font.- Parameters:
refFont- the indirect reference to a font
-
-
Method Details
-
getWidth
public int getWidth(int char1) Description copied from class:DocumentFontGets the width of acharin normalized 1000 units.- Overrides:
getWidthin classDocumentFont- Parameters:
char1- the unicodecharto get the width of- Returns:
- the width in normalized 1000 units
- Since:
- 2.1.5 Override to allow special handling for fonts that don't specify width of space character
- See Also:
-
decode
Decodes a string of bytes (encoded in the font's encoding) into a unicode string This will use the ToUnicode map of the font, if available, otherwise it uses the font's encoding- Parameters:
cidbytes- the bytes that need to be decoded- Returns:
- the unicode String that results from decoding
- Since:
- 2.1.7
-
encode
Deprecated.method name is not indicative of what it does. Usedecodeinstead.Encodes bytes to a String.- Parameters:
bytes- the bytes from a streamoffset- an offsetlen- a length- Returns:
- a String encoded taking into account if the bytes are in unicode or not.
-