imagettftext - font size randomly changes
| From: | Doug Dossett | Date: | Fri, 06 Jun 2003 15:43:55 +0000 |
| Subject: | imagettftext - font size randomly changes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150507@lists.php.net to get a copy of this message | ||
Hello all,
I'm using the following code to create images on the fly on a web site for page
headers. This works great for the most part, but a couple times now the text has
started resizing for no apparent reason. The first time it was just slightly wider than
normal. Most recently the text was giant. I'm running PHP 4.3.1 on Win2k Server.
Code:
header("Content-type: image/jpeg");
$im = imagecreate(200,14);
$white = imagecolorallocate($im, 255,255,255);
$green = imagecolorallocate($im, 51,102,0);
$shadow = imagecolorallocate($im, 204,204,153);
imagettftext($im, 12, 0, 1, 14, $shadow, "arialbd.ttf", $imgText);
imagettftext($im, 12, 0, 0, 13, $green, "arialbd.ttf", $imgText);
imagejpeg($im);
imagedestroy($im);
If I restart IIS, the problem goes away. Has anyone else seen this problem, know
why this might be happening and/or have a fix?
Thanks much,
Doug Dossett, LLC
www.dougdossett.com