
WE_Frontend::TextImages - create text images

use WE_Frontend::TextImages qw(text2gif);
text2gif(qw(-o /tmp/test.gif
-c 000000
-b FFFFFF
-f font.ttf
-s 10
-l 0
-bl 0 -bt 0 -br 0 -bb 0
-text test_string));

This module contains function for creating images with text.
text2gif is a function to create a text image file. The following options are supported:
If specified, the put the generated GIF file into the filename. Otherwise the image is available in the return value (see below).
Text color as rrggbb. Example: 'FF0000' for full red. Default: '000000' (black).
Background color as rrggbb. Default: 'FFFFFF' (white).
Font file (e.g. timesbd.ttf). There is no default.
Font size in pixels. Default: '16'.
Leading (distance from left border) in pixels.
Size of left border. Default: 0.
Size of top border. Default: 0.
Size of right border. Default: 0.
Size of bottom border. Default:0.
Width of the generated picture. This is optional, normally the width is calculated by the text width and used borders.
Height of the generated picture. This is optional, normally the height is calculated by the text height and used borders.
The generated text.
The function returns a hash with the following keys:
(Only if -o is not specified). The GIF image as a string.
An array of the bounding coordinates. See the getBounds method in GD for the exact format.

The GD module with GIF support. Alternatively GD with PNG support and GD::Convert can also work.

Please note that the PATH variable in CGI scripts is normally crippled to something like /bin:/usr/bin. You have to add the path containing ppmtogif or convert (maybe /usr/local/bin) to make the gif conversion in GD::Convert work:
BEGIN { $ENV{PATH} .= ":/usr/local/bin" }
use WE_Frontend::TextImages qw(text2gif);

Slaven Rezic - slaven@rezic.de
