I've just installed PHP 4.0.7-dev on NT4 SP6a. I want PHP so that I can dynamically create nice-looking headings on my web pages.
Here's the code I'm trying to use. It's largely taken from Rasmus Lerdorf's article at http://www.phpbuilder.com/columns/rasmus19990124.php3.
<?php
Header("Content-type: image/png");
$s = 20;
$text = "Hello";
$size = imagettfbbox($s,0,"VERDANA.TTF",$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=9;
$ypad=9;
$im = imagecreate($dx+$xpad,$dy+$ypad);
$blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black);
ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white);
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "verdana.TTF", $text);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "verdana.TTF", $text);
Imagepng($im);
ImageDestroy($im);
?>
I see a broken link when I include this PHP in an HTML page; when I open up the PHP directly in IE I see this:
Warning: libgd was not built with FreeType font support
in E:\Inetpub\wwwroot\php\button.php on line 5
Warning: libgd was not built with FreeType font support
in E:\Inetpub\wwwroot\php\button.php on line 16
Warning: libgd was not built with FreeType font support
in E:\Inetpub\wwwroot\php\button.php on line 17
Looking round the web I've found the question being asked, but not an answer.
Any bright ideas?
TIA
Steve