Class FontDetails
java.lang.Object
org.openpdf.text.pdf.FontDetails
Each font in the document will have an instance of this class where the characters used will be represented.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) BaseFontThe font(package private) CJKFontThe font if it's an instance ofCJKFont(package private) IntHashtableIntHashtable with CIDs of CJK glyphs that are used in the text.Contain glyphs that used but missing in Cmap.(package private) PdfNameThe font name that appears in the document body stream(package private) intThe font type(package private) PdfIndirectReferenceThe indirect reference to this fontThe map used with double byte encodings.(package private) byte[]The array used with single byte encodingsprotected booleanIndicates if only a subset of the glyphs and widths for that particular encoding should be included in the document.(package private) booleantrueif the font is symbolic(package private) TrueTypeFontUnicodeThe font if it's an instance ofTrueTypeFontUnicode -
Constructor Summary
ConstructorsConstructorDescriptionFontDetails(PdfName fontName, PdfIndirectReference indirectReference, BaseFont baseFont) Each font used in a document has an instance of this class. -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddMissingCmapEntries(String text, GlyphVector glyphVector, BaseFont baseFont) (package private) byte[]convertToBytes(GlyphVector glyphVector, int beginIndex, int endIndex) (package private) byte[]convertToBytes(String text, TextRenderingOptions options) Converts the text into bytes to be placed in the document.(package private) byte[]convertToBytes(List<Integer> glyphCodes) Convert a glyph code to bytesprivate byte[](package private) BaseFontGets theBaseFontof this font.private static byte[]getBytesFromCodePoints(List<Integer> codePoints) private byte[]getCJKEncodingBytes(int[] glyph, int size) (package private) PdfNameGets the font name as it appears in the document body.(package private) PdfIndirectReferenceGets the indirect reference to this font.booleanisSubset()Indicates if all the glyphs and widths for that particular encoding should be included in the document.(package private) voidputFillerCmap(Integer key, int[] value) voidsetSubset(boolean subset) Indicates if all the glyphs and widths for that particular encoding should be included in the document.(package private) voidWrites the font definition to the document.
-
Field Details
-
subset
protected boolean subsetIndicates if only a subset of the glyphs and widths for that particular encoding should be included in the document. -
indirectReference
PdfIndirectReference indirectReferenceThe indirect reference to this font -
fontName
PdfName fontNameThe font name that appears in the document body stream -
baseFont
BaseFont baseFontThe font -
ttu
The font if it's an instance ofTrueTypeFontUnicode -
cjkFont
CJKFont cjkFontThe font if it's an instance ofCJKFont -
shortTag
byte[] shortTagThe array used with single byte encodings -
longTag
-
cjkTag
IntHashtable cjkTagIntHashtable with CIDs of CJK glyphs that are used in the text. -
fontType
int fontTypeThe font type -
symbolic
boolean symbolictrueif the font is symbolic -
fillerCmap
-
-
Constructor Details
-
FontDetails
FontDetails(PdfName fontName, PdfIndirectReference indirectReference, BaseFont baseFont) Each font used in a document has an instance of this class. This class stores the characters used in the document and other specifics unique to the current working document.- Parameters:
fontName- the font nameindirectReference- the indirect reference to the fontbaseFont- theBaseFont
-
-
Method Details
-
getFillerCmap
-
putFillerCmap
-
addMissingCmapEntries
-
getIndirectReference
PdfIndirectReference getIndirectReference()Gets the indirect reference to this font.- Returns:
- the indirect reference to this font
-
getFontName
-
getBaseFont
-
convertToBytes
Converts the text into bytes to be placed in the document. The conversion is done according to the font and the encoding and the characters used are stored.- Parameters:
text- the text to convert- Returns:
- the conversion
-
convertToBytesWithGlyphs
-
getCJKEncodingBytes
private byte[] getCJKEncodingBytes(int[] glyph, int size) -
convertToBytes
-
getBytesFromCodePoints
-
convertToBytes
-
writeFont
Writes the font definition to the document.- Parameters:
writer- thePdfWriterof this document
-
isSubset
public boolean isSubset()Indicates if all the glyphs and widths for that particular encoding should be included in the document.- Returns:
falseto include all the glyphs and widths.
-
setSubset
public void setSubset(boolean subset) Indicates if all the glyphs and widths for that particular encoding should be included in the document. Set tofalseto include all.- Parameters:
subset- new value of property subset
-