ru.novosoft.dc.rtf.dom
Class FontTable

java.lang.Object
  |
  +--ru.novosoft.dc.rtf.dom.FontTable

public class FontTable
extends java.lang.Object

RTF font table. Contains a table of fonts, index of default font, and the default encoding name.


Constructor Summary
FontTable(int initialCapacity)
          Construct a font table of specified initial capacity.
 
Method Summary
 void addFont(RTFFont font)
          Add an rtf font to the font table.
 void exportTo(org.w3c.dom.Element elem, boolean usedOnly)
          Export the contents of this object to the specified DOM element.
 RTFFont font(int index)
          Return a font of required index or null if the required font index does not exist.
 java.util.Enumeration fonts()
          Return the enumeration of all fonts in the table.
 java.lang.String getDefaultEncoding()
          Return the default encoding name.
 int getDefaultFontIndex()
          Return the index of the default font.
 void setDefaultEncoding(java.lang.String value)
          Set the default encoding name.
 void setDefaultFontIndex(int value)
          Set the index of the default font.
 java.lang.String toString()
          Return representation of the font table as ANSI string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FontTable

public FontTable(int initialCapacity)
Construct a font table of specified initial capacity.
Method Detail

addFont

public final void addFont(RTFFont font)
Add an rtf font to the font table. If a font with the same index is already specified in the font table, it will be replaced to the newer one.

font

public final RTFFont font(int index)
Return a font of required index or null if the required font index does not exist.

fonts

public final java.util.Enumeration fonts()
Return the enumeration of all fonts in the table.

setDefaultFontIndex

public final void setDefaultFontIndex(int value)
Set the index of the default font.

getDefaultFontIndex

public final int getDefaultFontIndex()
Return the index of the default font.

setDefaultEncoding

public final void setDefaultEncoding(java.lang.String value)
Set the default encoding name.

getDefaultEncoding

public final java.lang.String getDefaultEncoding()
Return the default encoding name.

toString

public java.lang.String toString()
Return representation of the font table as ANSI string.
Overrides:
toString in class java.lang.Object

exportTo

public void exportTo(org.w3c.dom.Element elem,
                     boolean usedOnly)
Export the contents of this object to the specified DOM element.