|new() - Create a New PostScript::TextBlock object||This method instantiates a new object of class PostScript::TextBlock.|
|addText( text=>$text, [ font=>$font ], [ size=>$size ], [ leading=>$leading ] )||
The addText() method will add a new text element to the TextBlock object. A
text element can be thought of as a section of text that has the same
characteristics, i.e. all the characters are the same font, size and leading.
this representation allows you to include text rendered in multiple fonts at
multiple sizes within the same text block by including them as separate
text The text attribute is required, though nothing bad will happen if you leave it out. This is simply the text to be rendered in the text block. Line breaks may be inserted by including a newline \n.
font The font attribute is a string indicating the name of the font to be used to render this element. The PS package uses an internal description of the Font Metrics of various fonts that is contained in the PostScript::Metrics module. As of this writing, the PostScript::Metrics module supports the following fonts (basically, the default GhostScript fonts that have AFM files):
NimbusSanL-ReguCond URWGothicL-Book CenturySchL-Bold CharterBT-Italic URWBookmanL-Ligh CharterBT-BoldItalic NimbusRomNo9L-ReguItal URWBookmanL-DemiBoldItal CharterBT-Roman NimbusMonL-ReguObli NimbusSanL-ReguCondItal CenturySchL-Ital CenturySchL-BoldItal URWPalladioL-Roma URWBookmanL-LighItal CharterBT-Bold NimbusSanL-BoldCond NimbusMonL-BoldObli NimbusSanL-BoldCondItal URWGothicL-DemiObli NimbusSanL-Regu URWPalladioL-Bold NimbusMonL-Regu NimbusSanL-ReguItal URWGothicL-BookObli URWPalladioL-Ital
You can get a list of the currently supported fonts with the following:
The write() method uses the module PostScript::Metrics to determine the width of each character; widths vary from font to font and character to character. If you were writing a stright PostScript program, you would let the PostScript interpreter do this for you, but in the case of this program, we need to know the width of each character in a font within the Perl script. The PostScript::Metrics module contains the font metrics (i.e., a list containing the width of each character in the font) for a bunch of fonts that are listed above under the description of the addText() method. This set started with the metrics for all of the default fonts with AFM files that came with GhostScript. It is slowly growing as more fonts are mapped. To add support for a new font, you must create the array with the metrics for that font and add it to the PostScript::Metrics module. For a font with an AFM file, the AFM file can be parsed with Gisle Aas Font::AFM module, available on CPAN.
Please send all PostScript::Metrics patches to the author at firstname.lastname@example.org.
* better compliance with Adobes Document Structuring Conventions * more font metrics descriptions * make font loading code smarter and more efficient for the interpreter * support a larger character set * it would be nice to add more functions, e.g. Clone() * how about settable defaults?
Copyright 1998, 1999 Shawn Wallace. All rights reserved.
Portions of code contributed by Dan Smeltz.
This is free software. You may use, modify, and redistribute this package under the same terms as Perl itself.
PostScript is a trademark of Adobe Systems.
Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 398: You cant have =items (as at line 416) unless the first thing after the =over is an =item Around line 509: You forgot a =back before =head1
You forgot a =back before =head1
You forgot a =back before =head1
|perl v5.20.3||TEXTBLOCK (3)||2016-03-17|