imagettftext color problem
| From: | Anni Hienola | Date: | Thu, 10 Feb 2005 10:03:56 +0000 |
| Subject: | imagettftext color problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-208422@lists.php.net to get a copy of this message | ||
Hello,
I want to display TTF text in a png image. I use the following type of
code:
$font="luxisr";
$font_size=16;
$img=imagecreate($width, $height);
$bg=imagecolorallocate($img, 255, 255, 255);
$font_color=imageallocatecolor($img, 0, 0, 0);
imagettftext($img, $font_size, 0, $x, $y, $font_color, $font, $image_name);
imagepng($img, $file);
imagedestroy($img);
The font itself looks okay but the color stays awful yellow no matter what
I do. I saw someone suggesting the usage of imagecolorresolve(), but it
didn't help in this case. When browsing the web, I saw a comment about
this bug being already in the version 4.3.5, but only when
imagecreatetruecolor() was used. Now I'm using imagecreate() with the same
results. Any hints?
My box is Fedora Core 3, PHP 4.3.10, apache 2, browser Firefox.
Anni H.