Class RtfDestinationFontTable
java.lang.Object
com.lowagie.text.rtf.parser.destinations.RtfDestination
com.lowagie.text.rtf.parser.destinations.RtfDestinationFontTable
RtfDestinationFontTable handles data destined for the font table destination- Since:
- 2.0.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe \charset valueprivate static final Stringprivate StringThe \cpg valueprivate StringThe \falt alternate font if primary font is not available.private intThe \fbias valueprivate StringThe \falt alternate font if primary font is not available.private StringThe family of the font being parsed.private StringThe \falt alternate font if primary font is not available.private StringThe \falt alternate font if primary font is not available.Convert font mapping toFontFactoryfont objects.private StringThe name of the font being parsed.private StringThe number of the font being parsed.private StringThe \falt alternate font if primary font is not available.private intThe \fprqprivate RtfImportMgrThe RtfImportHeader to add font mappings to.private StringThe \*\fnameprivate StringThe \*\panose font matching value if primary font is not available.private static final int\faltprivate static final int\fontembprivate static final int\ffileprivate static final int\fnameprivate static final intNormalprivate static final int\panoseprivate intstate flag to handle different parsing of a font elementprivate StringThe theme (Office 2007)private StringThe \fnil, \fttruetype valueFields inherited from class com.lowagie.text.rtf.parser.destinations.RtfDestination
lastCtrlWord, modified, rtfParser -
Constructor Summary
ConstructorsConstructorDescriptionConstructorRtfDestinationFontTable(RtfParser parser) Constructs a new RtfFontTableParser. -
Method Summary
Modifier and TypeMethodDescriptionbooleanClean up when destination is closed.private com.lowagie.text.Fontcreatefont(String fontName) Create a font via theFontFactorycom.lowagie.text.FontGet aFontobject from the font map objectbooleanhandleCharacter(int ch) Handle text for this destinationbooleanClean up when group is closed.booleanhandleControlWord(RtfCtrlWordData ctrlWordData) Handle control word for this destinationbooleanSetup when group is opened.booleanHandle a new subgroup contained within this groupprivate voidLoad system fonts into the staticFontFactoryobjectprivate voidinit(boolean importFonts) Initialize the object.private voidProcess the font information that was parsed from the input.voidSet the font biasvoidsetCharset(String charset) Set the character-set to the parsed value.voidsetCodePage(String value) Set the code pagevoidsetFontAlternate(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.voidSet the parser to use with the RtfDestination object.voidSet the font pitchvoidsetThemeFont(String themeFont) Set the font themevoidMethod to set this object to the default values.voidsetTrueType(String value) Set the TrueTtype typeMethods inherited from class com.lowagie.text.rtf.parser.destinations.RtfDestination
addListener, afterCharacter, afterCtrlWord, beforeCharacter, beforeCtrlWord, getNewTokeniserState, isModified, onCharacter, onCloseGroup, onCtrlWord, onOpenGroup, removeListener
-
Field Details
-
importHeader
The RtfImportHeader to add font mappings to. -
themeFont
The theme (Office 2007) -
fontNr
The number of the font being parsed. -
fontFamily
The family of the font being parsed. -
charset
The \charset value -
CHARSET_DEFAULT
- See Also:
-
fprq
private int fprqThe \fprq -
panose
The \*\panose font matching value if primary font is not available. -
nontaggedname
The \*\fname -
fontName
The name of the font being parsed. -
falt
The \falt alternate font if primary font is not available. -
fontemb
The \falt alternate font if primary font is not available. -
fontType
The \falt alternate font if primary font is not available. -
fontFile
The \falt alternate font if primary font is not available. -
fontFileCpg
The \falt alternate font if primary font is not available. -
fbias
private int fbiasThe \fbias value -
cpg
The \cpg value -
trueType
The \fnil, \fttruetype value -
state
private int statestate flag to handle different parsing of a font element -
SETTING_NORMAL
private static final int SETTING_NORMALNormal- See Also:
-
SETTING_ALTERNATE
private static final int SETTING_ALTERNATE\falt- See Also:
-
SETTING_FONTNAME
private static final int SETTING_FONTNAME\fname- See Also:
-
SETTING_PANOSE
private static final int SETTING_PANOSE\panose- See Also:
-
SETTING_FONT_EMBED
private static final int SETTING_FONT_EMBED\fontemb- See Also:
-
SETTING_FONT_FILE
private static final int SETTING_FONT_FILE\ffile- See Also:
-
fontMap
Convert font mapping toFontFactoryfont objects.
-
-
Constructor Details
-
RtfDestinationFontTable
public RtfDestinationFontTable()Constructor -
RtfDestinationFontTable
Constructs a new RtfFontTableParser.- Parameters:
parser- an RtfParser.- Since:
- 2.0.8
-
-
Method Details
-
setParser
Description copied from class:RtfDestinationSet the parser to use with the RtfDestination object.- Overrides:
setParserin classRtfDestination- Parameters:
parser- The RtfParser object.
-
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
-
handleOpeningSubGroup
public boolean handleOpeningSubGroup()Description copied from class:RtfDestinationHandle a new subgroup contained within this group- Specified by:
handleOpeningSubGroupin classRtfDestination- Returns:
- true if handled, false if not handled
-
closeDestination
public boolean closeDestination()Description copied from class:RtfDestinationClean up when destination is closed.- Specified by:
closeDestinationin classRtfDestination- Returns:
- true if handled, false if not handled
-
handleCloseGroup
public boolean handleCloseGroup()Description copied from class:RtfDestinationClean up when group is closed.- Specified by:
handleCloseGroupin classRtfDestination- Returns:
- true if handled, false if not handled
-
handleOpenGroup
public boolean handleOpenGroup()Description copied from class:RtfDestinationSetup when group is opened.- Specified by:
handleOpenGroupin classRtfDestination- Returns:
- true if handled, false if not handled
-
handleCharacter
public boolean handleCharacter(int ch) Description copied from class:RtfDestinationHandle text for this destination- Specified by:
handleCharacterin classRtfDestination- Returns:
- true if handled, false if not handled
-
handleControlWord
Description copied from class:RtfDestinationHandle control word for this destination- Specified by:
handleControlWordin classRtfDestination- Parameters:
ctrlWordData- The control word and parameter information object- Returns:
- true if handled, false if not handled
-
setCodePage
Set the code page- Parameters:
value- The code page value- Since:
- 2.0.8
-
setTrueType
Set the TrueTtype type- Parameters:
value- The type- Since:
- 2.0.8
-
setPitch
Set the font pitch- Parameters:
value- Pitch value- Since:
- 2.0.8
-
setBias
Set the font bias- Parameters:
value- Bias value- Since:
- 2.0.8
-
setThemeFont
Set the font theme- Parameters:
themeFont- Theme value- Since:
- 2.0.8
-
setFontName
Set the font name to the parsed value.- Parameters:
fontName- The font name.- Since:
- 2.0.8
-
setFontFamily
Set the font family to the parsed value.- Parameters:
fontFamily- The font family.- Since:
- 2.0.8
-
setFontNumber
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
-
setFontAlternate
Set the alternate font name.- Parameters:
fontAlternate- The falt font value- Since:
- 2.0.8
-
setCharset
Set the character-set to the parsed value.- Parameters:
charset- The charset value- Since:
- 2.0.8
-
setToDefaults
public void setToDefaults()Description copied from class:RtfDestinationMethod to set this object to the default values. Must be implemented in child class.- Specified by:
setToDefaultsin classRtfDestination
-
processFont
private void processFont()Process the font information that was parsed from the input.- Since:
- 2.0.8
-
createfont
Create a font via theFontFactory- Parameters:
fontName- The font name to create- Returns:
- The created
Fontobject - Since:
- 2.0.8
-
getFont
Get aFontobject from the font map object- Parameters:
key- The font number to get- Returns:
- The mapped
Fontobject. - Since:
- 2.0.8
-
importSystemFonts
private void importSystemFonts()Load system fonts into the staticFontFactoryobject- Since:
- 2.0.8
-