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

This class represents a font for use with some RTF content.

Methods

==   new   to_rtf   to_s  

Constants

MODERN = :modern   A declaration for a font family. This family is used for monospaced fonts (e.g. Courier New).
ROMAN = :roman   A declaration for a font family. This family is used for proportionally spaced serif fonts (e.g. Arial, Times New Roman).
SWISS = :swiss   A declaration for a font family. This family is used for proportionally spaced sans serif fonts (e.g. Tahoma, Lucida Sans).
NIL = 'nil'.intern   A declaration for a font family. This family is used where none of the other families apply.

Attributes

family  [R]  Attribute accessor.
name  [R]  Attribute accessor.

Public Class methods

This is the constructor for the Font class.

Parameters

family:The font family for the new font. This should be one of Font::MODERN, Font::ROMAN, Font::SWISS or Font::NIL.
name:A string containing the font name.

Exceptions

RTFError:Generated whenever an invalid font family is specified.

Public Instance methods

This method overloads the equivalence test operator for the Font class to allow for Font comparisons.

Parameters

object:A reference to the object to be compared with.

This method generates the RTF representation for a Font object as it would appear within a document font table.

Parameters

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

This method fetches a textual description for a Font object.

Parameters

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

[Validate]