com.lowagie.text.rtf.parser.destinations

Class RtfDestinationFontTable

public final class RtfDestinationFontTable extends RtfDestination

RtfDestinationFontTable handles data destined for the font table destination

Since: 2.0.8

Author: Howard Shank (hgshank@yahoo.com)

Field Summary
Stringcharset
The \charset value
Stringcpg
The \cpg value
static StringCHARSET_DEFAULT
Stringfalt
The \falt alternate font if primary font is not available.
intfbias
The \fbias value
Stringfontemb
The \falt alternate font if primary font is not available.
StringfontFamily
The family of the font being parsed.
StringfontFile
The \falt alternate font if primary font is not available.
StringfontFileCpg
The \falt alternate font if primary font is not available.
HashMapfontMap
Convert font mapping to FontFactory font objects.
StringfontName
The name of the font being parsed.
StringfontNr
The number of the font being parsed.
StringfontType
The \falt alternate font if primary font is not available.
intfprq
The \fprq
RtfImportMgrimportHeader
The RtfImportHeader to add font mappings to.
Stringnontaggedname
The \*\fname
Stringpanose
The \*\panose font matching value if primary font is not available.
intstate
state flag to handle different parsing of a font element
static intSETTING_ALTERNATE
\falt
static intSETTING_FONTNAME
\fname
static intSETTING_FONT_EMBED
\fontemb
static intSETTING_FONT_FILE
\ffile
static intSETTING_NORMAL
Normal
static intSETTING_PANOSE
\panose
StringthemeFont
The theme (Office 2007)
StringtrueType
The \fnil, \fttruetype value
Constructor Summary
RtfDestinationFontTable()
Constructor
RtfDestinationFontTable(RtfParser parser)
Constructs a new RtfFontTableParser.
Method Summary
booleancloseDestination()
Fontcreatefont(String fontName)
Create a font via the FontFactory
PropertiesgetEnvironmentVariables()
Utility method to load the environment variables.
FontgetFont(String key)
Get a Font object from the font map object
booleanhandleCharacter(int ch)
booleanhandleCloseGroup()
booleanhandleControlWord(RtfCtrlWordData ctrlWordData)
booleanhandleOpenGroup()
booleanhandleOpeningSubGroup()
voidimportSystemFonts()
Load system fonts into the static FontFactory object
voidinit(boolean importFonts)
Initialize the object.
voidprocessFont()
Process the font information that was parsed from the input.
voidsetBias(String value)
Set the font bias
voidsetCharset(String charset)
Set the character-set to the parsed value.
voidsetCodePage(String value)
Set the code page
voidsetFontAlternate(String fontAlternate)
Set the alternate font name.
voidsetFontFamily(String fontFamily)
Set the font family to the parsed value.
voidsetFontName(String fontName)
Set the font name to the parsed value.
voidsetFontNumber(String fontNr)
Set the font number to the parsed value.
voidsetParser(RtfParser parser)
voidsetPitch(String value)
Set the font pitch
voidsetThemeFont(String themeFont)
Set the font theme
voidsetToDefaults()
voidsetTrueType(String value)
Set the TrueTtype type

Field Detail

charset

private String charset
The \charset value

cpg

private String cpg
The \cpg value

CHARSET_DEFAULT

private static final String CHARSET_DEFAULT

falt

private String falt
The \falt alternate font if primary font is not available.

fbias

private int fbias
The \fbias value

fontemb

private String fontemb
The \falt alternate font if primary font is not available.

fontFamily

private String fontFamily
The family of the font being parsed.

fontFile

private String fontFile
The \falt alternate font if primary font is not available.

fontFileCpg

private String fontFileCpg
The \falt alternate font if primary font is not available.

fontMap

private HashMap fontMap
Convert font mapping to FontFactory font objects.

fontName

private String fontName
The name of the font being parsed.

fontNr

private String fontNr
The number of the font being parsed.

fontType

private String fontType
The \falt alternate font if primary font is not available.

fprq

private int fprq
The \fprq

importHeader

private RtfImportMgr importHeader
The RtfImportHeader to add font mappings to.

nontaggedname

private String nontaggedname
The \*\fname

panose

private String panose
The \*\panose font matching value if primary font is not available.

state

private int state
state flag to handle different parsing of a font element

SETTING_ALTERNATE

private static final int SETTING_ALTERNATE
\falt

SETTING_FONTNAME

private static final int SETTING_FONTNAME
\fname

SETTING_FONT_EMBED

private static final int SETTING_FONT_EMBED
\fontemb

SETTING_FONT_FILE

private static final int SETTING_FONT_FILE
\ffile

SETTING_NORMAL

private static final int SETTING_NORMAL
Normal

SETTING_PANOSE

private static final int SETTING_PANOSE
\panose

themeFont

private String themeFont
The theme (Office 2007)

trueType

private String trueType
The \fnil, \fttruetype value

Constructor Detail

RtfDestinationFontTable

public RtfDestinationFontTable()
Constructor

RtfDestinationFontTable

public RtfDestinationFontTable(RtfParser parser)
Constructs a new RtfFontTableParser.

Parameters: parser an RtfParser.

Since: 2.0.8

Method Detail

closeDestination

public boolean closeDestination()

createfont

private Font createfont(String fontName)
Create a font via the FontFactory

Parameters: fontName The font name to create

Returns: The created Font object

Since: 2.0.8

getEnvironmentVariables

private Properties getEnvironmentVariables()
Utility method to load the environment variables.

Returns: Properties object with environment variable information

Throws: Throwable

Since: 2.0.8

getFont

public Font getFont(String key)
Get a Font object from the font map object

Parameters: key The font number to get

Returns: The mapped Font object.

Since: 2.0.8

handleCharacter

public boolean handleCharacter(int ch)

handleCloseGroup

public boolean handleCloseGroup()

handleControlWord

public boolean handleControlWord(RtfCtrlWordData ctrlWordData)

handleOpenGroup

public boolean handleOpenGroup()

handleOpeningSubGroup

public boolean handleOpeningSubGroup()

importSystemFonts

private void importSystemFonts()
Load system fonts into the static FontFactory object

Since: 2.0.8

init

private void init(boolean importFonts)
Initialize the object.

Parameters: importFonts true to import the fonts into the FontFactory, false do not load fonts

Since: 2.0.8

processFont

private void processFont()
Process the font information that was parsed from the input.

Since: 2.0.8

setBias

public void setBias(String value)
Set the font bias

Parameters: value Bias value

Since: 2.0.8

setCharset

public void setCharset(String charset)
Set the character-set to the parsed value.

Parameters: charset The charset value

Since: 2.0.8

setCodePage

public void setCodePage(String value)
Set the code page

Parameters: value The code page value

Since: 2.0.8

setFontAlternate

public void setFontAlternate(String fontAlternate)
Set the alternate font name.

Parameters: fontAlternate The falt font value

Since: 2.0.8

setFontFamily

public void setFontFamily(String fontFamily)
Set the font family to the parsed value.

Parameters: fontFamily The font family.

Since: 2.0.8

setFontName

public void setFontName(String fontName)
Set the font name to the parsed value.

Parameters: fontName The font name.

Since: 2.0.8

setFontNumber

public void setFontNumber(String fontNr)
Set the font number to the parsed value. This is used for mapping fonts to the new font numbers

Parameters: fontNr The font number.

Since: 2.0.8

setParser

public void setParser(RtfParser parser)

setPitch

public void setPitch(String value)
Set the font pitch

Parameters: value Pitch value

Since: 2.0.8

setThemeFont

public void setThemeFont(String themeFont)
Set the font theme

Parameters: themeFont Theme value

Since: 2.0.8

setToDefaults

public void setToDefaults()

setTrueType

public void setTrueType(String value)
Set the TrueTtype type

Parameters: value The type

Since: 2.0.8