|
Posted by Anni Hienola on 02/10/05 12:03
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.
Navigation:
[Reply to this message]
|