Class RTF::FontTable
In: lib/rtf/font.rb
Parent: Object

This class represents the font table for an RTF document. An instance of the class is used internally by the Document class and should not need to be explicitly instantiated (although it can be obtained from a Document object if needed).

Methods

<<   []   add   each   index   new   size   to_rtf   to_s  

Public Class methods

This is the constructor for the RTFTable class.

Parameters

*fonts:Zero or more font objects that are to be added to the font table. Objects that are not Fonts will be ignored.

Public Instance methods

<<(font)

Alias for add

This method overloads the array dereference operator for the FontTable class.

Parameters

index:The index into the font table of the font to be retrieved. If the index is invalid then nil is returned.

This method adds a font to a FontTable instance. This method returns a reference to the FontTable object updated.

Parameters

font:A reference to the font to be added. If this is not a Font object or already exists in the table it will be ignored.

This method iterates over the contents of a FontTable object. This method expects a block that takes a single parameter (the next font from the table).

This method fetches the index of a font within a FontTable object. If the font does not exist in the table then nil is returned.

Parameters

font:A reference to the font to check for.

This method is used to retrieve a count of the number of fonts held within an instance of the FontTable class.

This method generates the RTF text for a FontTable object.

Parameters

indent:The number of spaces to prefix to the lines generated by the method. Defaults to zero.

This method generates a textual description for a FontTable object.

Parameters

indent:The number of spaces to prefix to the lines generated by the method. Defaults to zero.

[Validate]