imagettftext color problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux