Class RtfFontManager


  • public final class RtfFontManager
    extends java.lang.Object

    RTF font table.

    This work was authored by Andreas Putz (a.putz@skynamics.com).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Hashtable fontIndex
      Index table for the fonts
      private java.util.Vector fontTable
      Used fonts to this vector
      private static RtfFontManager instance
      Singelton instance
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RtfFontManager()
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addFont​(java.lang.String family)
      Adds a font to the table.
      private java.lang.String getFontKey​(java.lang.String family)  
      int getFontNumber​(java.lang.String family)
      Gets the number of font in the font table
      static RtfFontManager getInstance()
      Singelton.
      private void init()
      Initialize the font table.
      void writeFonts​(RtfHeader header)
      Writes the font table in the header.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fontIndex

        private java.util.Hashtable fontIndex
        Index table for the fonts
      • fontTable

        private java.util.Vector fontTable
        Used fonts to this vector
    • Constructor Detail

      • RtfFontManager

        private RtfFontManager()
        Constructor.
    • Method Detail

      • getInstance

        public static RtfFontManager getInstance()
        Singelton.
        Returns:
        The instance of RtfFontManager
      • init

        private void init()
        Initialize the font table.
      • getFontNumber

        public int getFontNumber​(java.lang.String family)
        Gets the number of font in the font table
        Parameters:
        family - Font family name ('Helvetica')
        Returns:
        The number of the font in the table
      • writeFonts

        public void writeFonts​(RtfHeader header)
                        throws java.io.IOException
        Writes the font table in the header.
        Parameters:
        header - The header container to write in
        Throws:
        java.io.IOException - On error
      • getFontKey

        private java.lang.String getFontKey​(java.lang.String family)
      • addFont

        private void addFont​(java.lang.String family)
        Adds a font to the table.
        Parameters:
        family - Identifier of font