Class RtfDestinationFontTable

java.lang.Object
com.lowagie.text.rtf.parser.destinations.RtfDestination
com.lowagie.text.rtf.parser.destinations.RtfDestinationFontTable

public final class RtfDestinationFontTable extends RtfDestination
RtfDestinationFontTable handles data destined for the font table destination
Since:
2.0.8
  • Field Details

    • importHeader

      private RtfImportMgr importHeader
      The RtfImportHeader to add font mappings to.
    • themeFont

      private String themeFont
      The theme (Office 2007)
    • fontNr

      private String fontNr
      The number of the font being parsed.
    • fontFamily

      private String fontFamily
      The family of the font being parsed.
    • charset

      private String charset
      The \charset value
    • CHARSET_DEFAULT

      private static final String CHARSET_DEFAULT
      See Also:
    • fprq

      private int fprq
      The \fprq
    • panose

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

      private String nontaggedname
      The \*\fname
    • fontName

      private String fontName
      The name of the font being parsed.
    • falt

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

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

      private String fontType
      The \falt alternate font if primary font is not available.
    • 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.
    • fbias

      private int fbias
      The \fbias value
    • cpg

      private String cpg
      The \cpg value
    • trueType

      private String trueType
      The \fnil, \fttruetype value
    • state

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

      private static final int SETTING_NORMAL
      Normal
      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

      private Map<String,com.lowagie.text.Font> fontMap
      Convert font mapping to FontFactory font objects.
  • Constructor Details

    • RtfDestinationFontTable

      public RtfDestinationFontTable()
      Constructor
    • RtfDestinationFontTable

      public RtfDestinationFontTable(RtfParser parser)
      Constructs a new RtfFontTableParser.
      Parameters:
      parser - an RtfParser.
      Since:
      2.0.8
  • Method Details

    • setParser

      public void setParser(RtfParser parser)
      Description copied from class: RtfDestination
      Set the parser to use with the RtfDestination object.
      Overrides:
      setParser in class RtfDestination
      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: RtfDestination
      Handle a new subgroup contained within this group
      Specified by:
      handleOpeningSubGroup in class RtfDestination
      Returns:
      true if handled, false if not handled
    • closeDestination

      public boolean closeDestination()
      Description copied from class: RtfDestination
      Clean up when destination is closed.
      Specified by:
      closeDestination in class RtfDestination
      Returns:
      true if handled, false if not handled
    • handleCloseGroup

      public boolean handleCloseGroup()
      Description copied from class: RtfDestination
      Clean up when group is closed.
      Specified by:
      handleCloseGroup in class RtfDestination
      Returns:
      true if handled, false if not handled
    • handleOpenGroup

      public boolean handleOpenGroup()
      Description copied from class: RtfDestination
      Setup when group is opened.
      Specified by:
      handleOpenGroup in class RtfDestination
      Returns:
      true if handled, false if not handled
    • handleCharacter

      public boolean handleCharacter(int ch)
      Description copied from class: RtfDestination
      Handle text for this destination
      Specified by:
      handleCharacter in class RtfDestination
      Returns:
      true if handled, false if not handled
    • handleControlWord

      public boolean handleControlWord(RtfCtrlWordData ctrlWordData)
      Description copied from class: RtfDestination
      Handle control word for this destination
      Specified by:
      handleControlWord in class RtfDestination
      Parameters:
      ctrlWordData - The control word and parameter information object
      Returns:
      true if handled, false if not handled
    • setCodePage

      public void setCodePage(String value)
      Set the code page
      Parameters:
      value - The code page value
      Since:
      2.0.8
    • setTrueType

      public void setTrueType(String value)
      Set the TrueTtype type
      Parameters:
      value - The type
      Since:
      2.0.8
    • setPitch

      public void setPitch(String value)
      Set the font pitch
      Parameters:
      value - Pitch value
      Since:
      2.0.8
    • setBias

      public void setBias(String value)
      Set the font bias
      Parameters:
      value - Bias value
      Since:
      2.0.8
    • setThemeFont

      public void setThemeFont(String themeFont)
      Set the font theme
      Parameters:
      themeFont - Theme value
      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
    • setFontFamily

      public void setFontFamily(String fontFamily)
      Set the font family to the parsed value.
      Parameters:
      fontFamily - The font family.
      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
    • setFontAlternate

      public void setFontAlternate(String fontAlternate)
      Set the alternate font name.
      Parameters:
      fontAlternate - The falt font 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
    • setToDefaults

      public void setToDefaults()
      Description copied from class: RtfDestination
      Method to set this object to the default values. Must be implemented in child class.
      Specified by:
      setToDefaults in class RtfDestination
    • processFont

      private void processFont()
      Process the font information that was parsed from the input.
      Since:
      2.0.8
    • createfont

      private com.lowagie.text.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
    • getFont

      public com.lowagie.text.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
    • importSystemFonts

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