1# ==================================================================== 2# Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. 3# This program is free software; you can redistribute it and/or modify 4# it under the same terms as Perl itself. 5# ==================================================================== 6 7# $Author$ 8# $Id$ 9 10package SWF::Text; 11use SWF (); 12 13$SWF::Text::VERSION = $SWF::VERSION; 14 151; 16 17__END__ 18 19=head1 NAME 20 21SWF::Text - SWF Text class 22 23=head1 SYNOPSIS 24 25 use SWF::Text; 26 $text = new SWF::Text(); 27 28=head1 DESCRIPTION 29 30Draw simple static texts. 31 32=head1 NOTES: 33 34 None. 35 36=head1 METHODS 37 38=over 39 40=item new SWF::Text() 41 42Creates a Text object. 43 44=item $text->addString($string) 45 46=item $text->addUTF8String($UTF8string) 47 48=item $text->addWideString($widestring,$widestring_len) 49 50Writes the given $string into this Text object at the current pen position, 51using the current font, height, spacing, and color: 52 53 $t->addString("Thai"); 54 $t->addUTF8String("\x{0E44}\x{0E17}\x{0E22}"); 55 $t->addWideString("\x{44}\x{0E}\x{17}\x{0E}\x{22}\x{0E}",3); 56 57=item $text->setColor(red, green, blue [, alpha]) 58 59Set the color of the text. An 8 bit value for each parameter. You can use 60he hex or decimal notation. Even mixed. 61 62 $text->setColor(0xcc,0,0x33); 63 $text->setColor(204,0,51,255); 64 65=item $text->setFont($font) 66 67Sets an SWF::Font object -$font- to be used in the Text. 68 69=item $text->setHeight($height) 70 71Sets this Text object's current height to given height. 72 73=item $text->moveTo($x, $y) 74 75Move the Text's location to ($x, $y). 76 77=item $text->setSpacing($spacing) 78 79Sets this Text object's current letterspacing to given spacing. 80 81=item $text->getWidth($string) 82 83=item $text->getStringWidth($string) 84 85=item $text->getUTF8StringWidth($UTF8string) 86 87=item $text->getWideStringWidth($widestring) 88 89Returns width of given string in pixels. 90 91=item $text->getAscent() 92 93Returns the ascent of the current font at its current size, or 0 if not available. 94 95=item $text->getDescent() 96 97Returns the descent of the current font at its current size, or 0 if not available. 98 99=item $text->getLeading() 100 101Returns the leading of the current font at its current size, or 0 if not available. 102 103=back 104 105=head1 AUTHOR 106 107developers of ming 108ming.sourceforge.net 109 110=head1 SEE ALSO 111 112SWF, SWF::Font, SWF::TextField, ISO 10646 (Unicode) 113 114=cut 115 116