public final class RtfDestinationFontTable extends RtfDestination
RtfDestinationFontTable handles data destined for the font table destination| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
charset
The \charset value
|
private static java.lang.String |
CHARSET_DEFAULT |
private java.lang.String |
cpg
The \cpg value
|
private java.lang.String |
falt
The \falt alternate font if primary font is not available.
|
private int |
fbias
The \fbias value
|
private java.lang.String |
fontemb
The \falt alternate font if primary font is not available.
|
private java.lang.String |
fontFamily
The family of the font being parsed.
|
private java.lang.String |
fontFile
The \falt alternate font if primary font is not available.
|
private java.lang.String |
fontFileCpg
The \falt alternate font if primary font is not available.
|
private java.util.HashMap |
fontMap
Convert font mapping to
FontFactory font objects. |
private java.lang.String |
fontName
The name of the font being parsed.
|
private java.lang.String |
fontNr
The number of the font being parsed.
|
private java.lang.String |
fontType
The \falt alternate font if primary font is not available.
|
private int |
fprq
The \fprq
|
private RtfImportMgr |
importHeader
The RtfImportHeader to add font mappings to.
|
private java.lang.String |
nontaggedname
The \*\fname
|
private java.lang.String |
panose
The \*\panose font matching value if primary font is not available.
|
private static int |
SETTING_ALTERNATE
\falt
|
private static int |
SETTING_FONT_EMBED
\fontemb
|
private static int |
SETTING_FONT_FILE
\ffile
|
private static int |
SETTING_FONTNAME
\fname
|
private static int |
SETTING_NORMAL
Normal
|
private static int |
SETTING_PANOSE
\panose
|
private int |
state
state flag to handle different parsing of a font element
|
private java.lang.String |
themeFont
The theme (Office 2007)
|
private java.lang.String |
trueType
The \fnil, \fttruetype value
|
lastCtrlWord, modified, rtfParser| Constructor and Description |
|---|
RtfDestinationFontTable()
Constructor
|
RtfDestinationFontTable(RtfParser parser)
Constructs a new RtfFontTableParser.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
closeDestination()
Clean up when destination is closed.
|
private Font |
createfont(java.lang.String fontName)
Create a font via the
FontFactory |
private java.util.Properties |
getEnvironmentVariables()
Utility method to load the environment variables.
|
Font |
getFont(java.lang.String key)
Get a
Font object from the font map object |
boolean |
handleCharacter(int ch)
Handle text for this destination
|
boolean |
handleCloseGroup()
Clean up when group is closed.
|
boolean |
handleControlWord(RtfCtrlWordData ctrlWordData)
Handle control word for this destination
|
boolean |
handleOpenGroup()
Setup when group is opened.
|
boolean |
handleOpeningSubGroup()
Handle a new subgroup contained within this group
|
private void |
importSystemFonts()
Load system fonts into the static
FontFactory object |
private void |
init(boolean importFonts)
Initialize the object.
|
private void |
processFont()
Process the font information that was parsed from the input.
|
void |
setBias(java.lang.String value)
Set the font bias
|
void |
setCharset(java.lang.String charset)
Set the character-set to the parsed value.
|
void |
setCodePage(java.lang.String value)
Set the code page
|
void |
setFontAlternate(java.lang.String fontAlternate)
Set the alternate font name.
|
void |
setFontFamily(java.lang.String fontFamily)
Set the font family to the parsed value.
|
void |
setFontName(java.lang.String fontName)
Set the font name to the parsed value.
|
void |
setFontNumber(java.lang.String fontNr)
Set the font number to the parsed value.
|
void |
setParser(RtfParser parser)
Set the parser to use with the RtfDestination object.
|
void |
setPitch(java.lang.String value)
Set the font pitch
|
void |
setThemeFont(java.lang.String themeFont)
Set the font theme
|
void |
setToDefaults()
Method to set this object to the default values.
|
void |
setTrueType(java.lang.String value)
Set the TrueTtype type
|
addListener, afterCharacter, afterCtrlWord, beforeCharacter, beforeCtrlWord, getNewTokeniserState, isModified, onCharacter, onCloseGroup, onCtrlWord, onOpenGroup, removeListenerprivate RtfImportMgr importHeader
private java.lang.String themeFont
private java.lang.String fontNr
private java.lang.String fontFamily
private java.lang.String charset
private static final java.lang.String CHARSET_DEFAULT
private int fprq
private java.lang.String panose
private java.lang.String nontaggedname
private java.lang.String fontName
private java.lang.String falt
private java.lang.String fontemb
private java.lang.String fontType
private java.lang.String fontFile
private java.lang.String fontFileCpg
private int fbias
private java.lang.String cpg
private java.lang.String trueType
private int state
private static final int SETTING_NORMAL
private static final int SETTING_ALTERNATE
private static final int SETTING_FONTNAME
private static final int SETTING_PANOSE
private static final int SETTING_FONT_EMBED
private static final int SETTING_FONT_FILE
private java.util.HashMap fontMap
FontFactory font objects.public RtfDestinationFontTable()
public RtfDestinationFontTable(RtfParser parser)
parser - an RtfParser.public void setParser(RtfParser parser)
RtfDestinationsetParser in class RtfDestinationparser - The RtfParser object.private void init(boolean importFonts)
importFonts - true to import the fonts into the FontFactory, false do not load fontspublic boolean handleOpeningSubGroup()
RtfDestinationhandleOpeningSubGroup in class RtfDestinationpublic boolean closeDestination()
RtfDestinationcloseDestination in class RtfDestinationpublic boolean handleCloseGroup()
RtfDestinationhandleCloseGroup in class RtfDestinationpublic boolean handleOpenGroup()
RtfDestinationhandleOpenGroup in class RtfDestinationpublic boolean handleCharacter(int ch)
RtfDestinationhandleCharacter in class RtfDestinationpublic boolean handleControlWord(RtfCtrlWordData ctrlWordData)
RtfDestinationhandleControlWord in class RtfDestinationctrlWordData - The control word and parameter information objectpublic void setCodePage(java.lang.String value)
value - The code page valuepublic void setTrueType(java.lang.String value)
value - The typepublic void setPitch(java.lang.String value)
value - Pitch valuepublic void setBias(java.lang.String value)
value - Bias valuepublic void setThemeFont(java.lang.String themeFont)
themeFont - Theme valuepublic void setFontName(java.lang.String fontName)
fontName - The font name.public void setFontFamily(java.lang.String fontFamily)
fontFamily - The font family.public void setFontNumber(java.lang.String fontNr)
fontNr - The font number.public void setFontAlternate(java.lang.String fontAlternate)
fontAlternate - The falt font valuepublic void setCharset(java.lang.String charset)
charset - The charset valuepublic void setToDefaults()
RtfDestinationsetToDefaults in class RtfDestinationprivate void processFont()
private Font createfont(java.lang.String fontName)
FontFactoryfontName - The font name to createFont objectpublic Font getFont(java.lang.String key)
Font object from the font map objectkey - The font number to getFont object.private void importSystemFonts()
FontFactory objectprivate java.util.Properties getEnvironmentVariables()
throws java.lang.Throwable
java.lang.Throwable