Forum Moderators: coopster
We have a script that create a "button" image with gd
This script use our ttf upload online, in script dir
All work great ok for 1 year, now the image created is bad.
Seems they have antialiasing but this is set 0
Script is really simple:
//================================================
$im = ImageCreateFromGif('base.gif');
$color = ImageColorAllocate($im,255,255,255);
imagettftext($im, 8.5, 0, 14, 13, -$color, "asimo.ttf", $_POST['name']);
$file_pulsante="$dirsharefile/".$pulsante.".gif";
Imagegif($im,$file_pulsante);
ImageDestroy($im);
//================================================
Thks
[edited by: coopster at 11:23 am (utc) on May 3, 2006]
[edit reason] no personal urls please [/edit]
ssuming that the font file hasn't changed, the handling of anti-aliasing has changed. The image is still generated, but the inside corners of text have an extra pixel filled in.
Try changing a few settings to see how that effects your output:
First, toggle the negative color value (which determines if GD uses antialiasing):
imagettftext($im, 8.5, 0, 14, 13, $color, "asimo.ttf", $_POST['name']);
Next, switch to a different font size. Specifically an integer rather than a float:
imagettftext($im, 8, 0, 14, 13, -$color, "asimo.ttf", $_POST['name']);
Finally, confirm your font file is the correct one. Upload a new file (get it from the source, not a backup) and call that one instead.
imagettftext($im, 8, 0, 14, 13, -$color, "asimo2.ttf", $_POST['name']);
I realize these are more troubleshooting tips than a solution, but at least it gets you going in the right direction. I've not experienced this particular problem, so I can't provide better info.