You are here: imagettftext color problem « PHP « IT news, forums, messages
imagettftext color problem

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация