Hi,
I'm trying to learn how to use the imagettftext()
and i have tried to use a couple of the code examples but i cant seem to get any image.
Currently my code works like this..
<?php
// pic.php
$font = 'Arial Bold';
$value = '10000000';
$im = imagecreatefrompng("3_a.png") or die("Cannot Initialize new GD image stream");
$text_color = imagecolorallocate($im, 0, 0, 0); // text color R,G,B
imagettftext($im, 1, 0, 100, 100, $text_color, $font, $value);
imagepng($im);
imagedestroy($im);
?>
I'm using getting this image from <img src= etc..>
and when i take out the imagefttext(),
everything works out fine...
can someone teach me how to use this method properly and where i should place my font.ttf file? i currently have it in the same place as the above script..
the full path would be something like
http://etc../images/Arial Bold.ttf
and
http://etc../images/pic.php
misc info that might affect implementation -->
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled
taken from phpinfo.php on a linux box