|text||The text to operate on, see also set_text().|
|font, ptsize||The font to use and the point size. The point size is only used for TrueType fonts. Also see set_font().|
The attributes that can be retrieved are all the ones that can be set, and:
|width, height||The width (height) of the string in pixels|
|space||The width of a space in pixels|
|char_up, char_down||The number of pixels that a character can stick out above and below the baseline. Note that this is only useful for TrueType fonts. For builtins char_up is equal to height, and char_down is always 0.|
The use of this method is vaguely deprecated.
Returns true if the current object is based on a builtin GD font.
Returns true if the current object is based on a TrueType font.
CW$gd_text->can_do_ttf() or GD::Text->can_do_ttf()
Return true if this object can handle TTF fonts.
This depends on whether your version of GD is newer than 1.19 and
has TTF support compiled into it.
This sets the font path for the class (i.e. not just for the object).
The set_font method will search this path to find the font specified
if it is a TrueType font. It should contain a list of
paths. The current directory is always searched first, unless . is
present in FONT_PATH. Examples:
Any font name that is not an absolute path will first be looked for in the current directory, and then in /usr/ttfonts (c:\fonts).
Font files are only looked for in the current directory.
FONT_PATH is initialised at module load time from the environment variables FONT_PATH or, if thats not present, TTF_FONT_PATH, or TT_FONT_PATH.
Returns the value the font path is set to. If called without arguments font_path returns the current font path.
Note: This currently only works for unices, and (hopefully) for Microsoft based OSs. If anyone feels the urge to have a look at the code, and send me patches for their OS, Id be most grateful)
This module has only been tested with anglo-centric normal fonts and encodings. Fonts that have other characteristics may not work well. If that happens, please let me know how to make this work better.
The font height gets estimated by building a string with all printable characters (with an ordinal value between 0 and 255) that pass the POSIX::isprint() test (and not the isspace() test). If your system doesnt have POSIX, I make an approximation that may be false. Under Perl 5.8.0 the [[:print:]] character class is used, since the POSIX is*() functions dont seem to work correctly.
The whole font path thing works well on Unix, but probably not very well on other OSs. This is only a problem if you try to use a font path. If you dont use a font path, there should never be a problem. I will try to expand this in the future, but only if theres a demand for it. Suggestions welcome.
copyright 1999 Martien Verbruggen (firstname.lastname@example.org)
GD(3), GD::Text::Wrap(3), GD::Text::Align(3)
Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 197: =pod directives shouldnt be over one line long! Ignoring all 20 lines of content
|perl v5.20.3||TEXT (3)||2003-06-19|