com.lowagie.text.pdf

Class FontDetails

class FontDetails extends Object

Each font in the document will have an instance of this class where the characters used will be represented.

Author: Paulo Soares (psoares@consiste.pt)

Field Summary
BaseFontbaseFont
The font
CJKFontcjkFont
The font if it's an instance of CJKFont
IntHashtablecjkTag
IntHashtable with CIDs of CJK glyphs that are used in the text.
PdfNamefontName
The font name that appears in the document body stream
intfontType
The font type
PdfIndirectReferenceindirectReference
The indirect reference to this font
HashMaplongTag
The map used with double byte encodings.
byte[]shortTag
The array used with single byte encodings
protected booleansubset
Indicates if only a subset of the glyphs and widths for that particular encoding should be included in the document.
booleansymbolic
true if the font is symbolic
TrueTypeFontUnicodettu
The font if it's an instance of TrueTypeFontUnicode
Constructor Summary
FontDetails(PdfName fontName, PdfIndirectReference indirectReference, BaseFont baseFont)
Each font used in a document has an instance of this class.
Method Summary
byte[]convertToBytes(String text)
Converts the text into bytes to be placed in the document.
BaseFontgetBaseFont()
Gets the BaseFont of this font.
PdfNamegetFontName()
Gets the font name as it appears in the document body.
PdfIndirectReferencegetIndirectReference()
Gets the indirect reference to this font.
booleanisSubset()
Indicates if all the glyphs and widths for that particular encoding should be included in the document.
voidsetSubset(boolean subset)
Indicates if all the glyphs and widths for that particular encoding should be included in the document.
voidwriteFont(PdfWriter writer)
Writes the font definition to the document.

Field Detail

baseFont

BaseFont baseFont
The font

cjkFont

CJKFont cjkFont
The font if it's an instance of CJKFont

cjkTag

IntHashtable cjkTag
IntHashtable with CIDs of CJK glyphs that are used in the text.

fontName

PdfName fontName
The font name that appears in the document body stream

fontType

int fontType
The font type

indirectReference

PdfIndirectReference indirectReference
The indirect reference to this font

longTag

HashMap longTag
The map used with double byte encodings. The key is Integer(glyph) and the value is int[]{glyph, width, Unicode code}

shortTag

byte[] shortTag
The array used with single byte encodings

subset

protected boolean subset
Indicates if only a subset of the glyphs and widths for that particular encoding should be included in the document.

symbolic

boolean symbolic
true if the font is symbolic

ttu

TrueTypeFontUnicode ttu
The font if it's an instance of TrueTypeFontUnicode

Constructor Detail

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 name indirectReference the indirect reference to the font baseFont the BaseFont

Method Detail

convertToBytes

byte[] convertToBytes(String text)
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

getBaseFont

BaseFont getBaseFont()
Gets the BaseFont of this font.

Returns: the BaseFont of this font

getFontName

PdfName getFontName()
Gets the font name as it appears in the document body.

Returns: the font name

getIndirectReference

PdfIndirectReference getIndirectReference()
Gets the indirect reference to this font.

Returns: the indirect reference to this font

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 to false to include all.

Parameters: subset new value of property subset

writeFont

void writeFont(PdfWriter writer)
Writes the font definition to the document.

Parameters: writer the PdfWriter of this document