Is there a module to be activated or what has to be installed to have
ttf support in php?
My port on FreeBSD does not have an option for ttf support under make
config .
I'm trying to learn & understand the following:
In file1 : <img src="button.php?s=36&text=PHP+is+Cool" />
In file2 (button.php)- originally php3 :
  Header("Content-type: image/gif");
  if(!isset($s)) $s=11;
  $size = imagettfbbox($s,0,"times.ttf",$text);
  $dx = abs($size[2]-$size[0]);
  $dy = abs($size[5]-$size[3]);
  $im = imagecreate($dx+$xpad,$dy+$ypad);
  $blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
  $black = ImageColorAllocate($im, 0,0,0);
  $white = ImageColorAllocate($im, 255,255,255);
  ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black,
"times.ttf", $text);
  ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white,
"times.ttf", $text);
ONLY the above & nothing else. So far, all I get is a small blue square.
Replacing the $text with the text just gives a rectangle a bit wider.
gd is installed but ttf is not, so I figure that is the culprit.
But how is the text supposed to be assigned to $text from file1?

Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
Phil Jourdan ---

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to