fonttable(3)
NAME
RTF::FontTable - Class for generating RTF document font
tables
DESCRIPTION
RTF::FontTable is an RTF::Group which generates font
tables for RTF documents.
SYNOPSIS
use RTF::FontTable;
my $gFonts = RTF::FontTable->new();
my $fTimes = $gFonts->add_font('Times New Roman (Western)', {
'FontFamily' => 'roman',
'FontAltName' => [ 'Times' ],
'NonTaggedFontName' => 'Times New Roman',
'Pitch' => 0,
'Panose' => [ 2, 2, 6, 3, 5, 4, 5, 2, 3, 4 ],
} );
METHODS
RTF::FontTable is a RTF::Group. The following methods have
been added:
- add_font
- $font = $obj->add_font( $font_name, attributes );
- Adds a font to the font table, or returns the font code of
that font if it is already in the font table. (If the font
is in the table, it will not update the font attributes.) - Font attributes are as follows:
- FontFamily
- Specifies the type of font. Acceptable values are:
- nil the default, if "FontFamily" is not specified or
unknown,
- swiss
sans-serif, such as "Arial" or "Helvetica",
- roman
serif, such as "Times" or "Garamond",
- modern
for fixed-pitch or modern screen fonts such as
"Courier" or "Verdana", - script
for script fonts, such as "Cursive"
- tech
for symbol fonts,
- decor
for decorative fonts, such as "Old English", and
- bidi
for bidirectional fonts such as Hebrew or Arabic.
- FontAltName
- Specifies a list of alternate fonts or font names.
For example, an alternate font for "Helvetica" on sys
tems which do not have it might be "Arial" or "Helv". - NonTaggedFontName
- The non-tagged font name. For example, "Arial" is a
non-tagged font name while "Arial (Turkish)" is a
tagged name. - Pitch
- Specifies the font pitch. 0 is the default, 1 is
fixed, and 2 is variable. - Panose
- An array with the ten-byte PANOSE number for the font.
- Default
- If true, makes this font the default font. If multiple
fonts are set as "Default", the most recently added
font is the default font. - find_font
if ($font = $obj->find_font( $font_name )) ...- Returns the font code if the font was added to the system.
Otherwise returns "undef". - get_default
$font = $obj->get_default;- Returns the default font in the table (which is either the
first font added or the last font added the "Default"
attribute set). - set_default
$obj->set_default( $font );- Sets the default font.
- is_valid
if ($obj->is_valid( $font )) ...- Returns true if the font code has been added to the font
table. - count
my $num_fonts = $obj->count();- Returns the number of fonts in the table.
SEE ALSO
Microsoft Technical Support and Application Note, "Rich
Text Format (RTF) Specification and Sample Reader Pro
gram", Version 1.5.
AUTHOR
Robert Rothenberg <rrwo@cpan.org>
LICENSE
- Copyright (c) 2001 Robert Rothenberg. All rights reserved.
This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.