Package com.aowagie.text.pdf
Class FontDetails
java.lang.Object
com.aowagie.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 TypeFieldDescriptionprivate final BaseFont
The fontprivate CJKFont
The font if it's an instance ofCJKFont
private IntHashtable
IntHashtable with CIDs of CJK glyphs that are used in the text.private final PdfName
The font name that appears in the document body streamprivate final int
The font typeprivate final PdfIndirectReference
The indirect reference to this fontprivate HashMap
The map used with double byte encodings.private byte[]
The array used with single byte encodingsprivate boolean
Indicates if only a subset of the glyphs and widths for that particular encoding should be included in the document.private boolean
true
if the font is symbolicprivate TrueTypeFontUnicode
The 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) byte[]
convertToBytes
(String text) Converts the text into bytes to be placed in the document.(package private) BaseFont
Gets theBaseFont
of this font.(package private) PdfName
Gets the font name as it appears in the document body.(package private) PdfIndirectReference
Gets the indirect reference to this font.boolean
isSubset()
Indicates if all the glyphs and widths for that particular encoding should be included in the document.void
setSubset
(boolean subset) Indicates if all the glyphs and widths for that particular encoding should be included in the document.(package private) void
Writes the font definition to the document.
-
Field Details
-
indirectReference
The indirect reference to this font -
fontName
The font name that appears in the document body stream -
baseFont
The font -
ttu
The font if it's an instance ofTrueTypeFontUnicode
-
cjkFont
The font if it's an instance ofCJKFont
-
shortTag
private byte[] shortTagThe array used with single byte encodings -
longTag
The map used with double byte encodings. The key is Integer(glyph) and the value is int[]{glyph, width, Unicode code} -
cjkTag
IntHashtable with CIDs of CJK glyphs that are used in the text. -
fontType
private final int fontTypeThe font type -
symbolic
private boolean symbolictrue
if the font is symbolic -
subset
private boolean subsetIndicates if only a subset of the glyphs and widths for that particular encoding should be included in the document.
-
-
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
-
getIndirectReference
PdfIndirectReference getIndirectReference()Gets the indirect reference to this font.- Returns:
- the indirect reference to this font
-
getFontName
PdfName getFontName()Gets the font name as it appears in the document body.- Returns:
- the font name
-
getBaseFont
BaseFont getBaseFont()Gets theBaseFont
of this font.- Returns:
- the
BaseFont
of this font
-
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
-
writeFont
Writes the font definition to the document.- Parameters:
writer
- thePdfWriter
of this document
-
isSubset
public boolean isSubset()Indicates if all the glyphs and widths for that particular encoding should be included in the document.- Returns:
false
to 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 tofalse
to include all.- Parameters:
subset
- new value of property subset
-