There is no FreeType support. If you want to know if your php has FreeType support save following as phpinfo.php on your server, and open in the browser. Is there a line saying FreeType Support enabled or FreeType Version mentioned?
<?php echo phpinfo(); ?>
Following would be a workaround if FreeType support is not enabled.
Replace
imagettftext($image, $font_size, 0, 7,17, $text_color, $font , $code)
with
imagestring ($image, $font_size, 5, 5, $code, $text_color);
Note: you can set $font_size to 1, 2, 3, 4, 5 in the above string to change font size.
One more solution proposed by
recoding. We'll implement this in next version. Thanks for your help Dan!
1. Downloaded Windows program to convert Windows fonts to PHP fonts
http://www.wedwick.com/wftopf.exe2. Converted my
arial.ttf, to PHP
3. Updated the code, so that:
Code:
$font = 'arial';
Became
Code:
$font = imageloadfont("arial.gdf");
And lower in the code
Code:
imagestring ($image, $font_size, 5, 5, $code, $text_color);
became
Code:
imagestring ($image, $font, 5, 5, $code, $text_color);