1.::SWF::Text(3) User Contributed Perl Documentation .::SWF::Text(3)
2
3
4
6 SWF::Text - SWF Text class
7
9 use SWF::Text;
10 $text = new SWF::Text();
11
13 Draw simple static texts.
14
16 None.
17
19 new SWF::Text()
20 Creates a Text object.
21
22 $text->addString($string)
23 $text->addUTF8String($UTF8string)
24 $text->addWideString($widestring,$widestring_len)
25 Writes the given $string into this Text object at the current pen
26 position, using the current font, height, spacing, and color:
27
28 $t->addString("Thai");
29 $t->addUTF8String("\x{0E44}\x{0E17}\x{0E22}");
30 $t->addWideString("\x{44}\x{0E}\x{17}\x{0E}\x{22}\x{0E}",3);
31
32 $text->setColor(red, green, blue [, alpha])
33 Set the color of the text. An 8 bit value for each parameter. You
34 can use he hex or decimal notation. Even mixed.
35
36 $text->setColor(0xcc,0,0x33);
37 $text->setColor(204,0,51,255);
38
39 $text->setFont($font)
40 Sets an SWF::Font object -$font- to be used in the Text.
41
42 $text->setHeight($height)
43 Sets this Text object's current height to given height.
44
45 $text->moveTo($x, $y)
46 Move the Text's location to ($x, $y).
47
48 $text->setSpacing($spacing)
49 Sets this Text object's current letterspacing to given spacing.
50
51 $text->getWidth($string)
52 $text->getStringWidth($string)
53 $text->getUTF8StringWidth($UTF8string)
54 $text->getWideStringWidth($widestring)
55 Returns width of given string in pixels.
56
57 $text->getAscent()
58 Returns the ascent of the current font at its current size, or 0 if
59 not available.
60
61 $text->getDescent()
62 Returns the descent of the current font at its current size, or 0
63 if not available.
64
65 $text->getLeading()
66 Returns the leading of the current font at its current size, or 0
67 if not available.
68
70 developers of ming ming.sourceforge.net
71
73 SWF, SWF::Font, SWF::TextField, ISO 10646 (Unicode)
74
75
76
77perl v5.32.0 2020-07-28 .::SWF::Text(3)