AddText — Add TTF text to an image
AddText is part of the Gallery package.
class AddText implements Transform { private array $color private string $font private int $hpos private float $size private string $text private int $vpos public AddText __construct ( string $text, int $vpos, int $hpos, string $font, float $size, array $color ); public resource apply ( resource $image, &$image ); }
AddText
Add TTF text to an image
private array $color
An array of three elements for the color in RGB
Default value: empty string
private string $font
Path to the TTF file. See the description on the fontile variable on http://www.php.net/manual/en/function.imagettftext.php
Default value: empty string
private int $hpos
The horizontal position of the text. Must be one of WG_LEFT, WG_CENTER or WG_RIGHT
Default value: empty string
private float $size
The size of the font in pt
Default value: empty string
private string $text
The text to render
Default value: empty string
private int $vpos
The vertical position of the text. Must be one of WG_TOP, WG_CENTER or WG_BOTTOM
Default value: empty string
public AddText __construct ( string $text, int $vpos, int $hpos, string $font, float $size, array $color );
Create and initialize the AddText transform
The vpos variable should be one of WG_TOP, WG_CENTER or WG_BOTTOM. The hpos variable should be one of WG_LEFT, WG_CENTER or WG_RIGHT. For the correct specification of the font attribute, see the PHP documentation on imagettftext on the fontfile variable at http://www.php.net/manual/en/function.imagettftext.php
public resource apply ( resource $image, &$image );
Add the text to the image