#27693 [Fbk]: imagettftext() coupled with imagecreatetruecolor() displays yellow fonts.

From: Date: Sat, 03 Apr 2004 14:51:00 +0000
Subject: #27693 [Fbk]: imagettftext() coupled with imagecreatetruecolor() displays yellow fonts.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-57447@lists.php.net to get a copy of this message
 ID:               27693
 Updated by:       nlopess@php.net
 Reported By:      xavier dot blanchet at free dot fr
 Status:           Feedback
 Bug Type:         GD related
 Operating System: Linux
 PHP Version:      4.3.4
 New Comment:

I can't reproduce either with PHP 4.2.6RC2-dev.

I think the problem may be only with Unicode fonts, althought it works
for me.


Previous Comments:
------------------------------------------------------------------------

[2004-04-01 11:56:52] iliaa@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

I am still unable to replicate the problem using the Arial 
ttf font avaliable on my system. Please include your 
configure line in your reply. 

------------------------------------------------------------------------

[2004-04-01 07:47:13] xavier dot blanchet at free dot fr

I was hoping PHP 4.3.5 would resolve the bug, but as I tried the same
script on PHP Version 5.0.0b2 Beta ( http://240plan.ovh.net/test.beta )
and faced the same problem, i did not believe in a PHP version 4.3.5
working fine with ttf fonts... According to Sandeep, I was right :-(

------------------------------------------------------------------------

[2004-04-01 07:23:27] sandeep at highimpactsites dot com

i m facing the same problem.

Text are shown in yellow color even if we have assign the black color.
and text dosen't appear on image using ImageTTFText function.

It is working fine on PHP Version 4.3.2 & GD Version  bundled (2.0.12
compatible)  but facing above mention problem with  PHP Version 4.3.5 &
GD Version  2.0 or higher  Also with PHP Version 4.3.5 & GD Version 
bundled (2.0.17 compatible).

------------------------------------------------------------------------

[2004-03-26 15:01:57] iliaa@php.net

Works fine with latest CVS. 

------------------------------------------------------------------------

[2004-03-25 08:49:36] xavier dot blanchet at free dot fr

Description:
------------
When we use the imagecreatetruecolor() function, the imagettftext() and
a TrueTypeFont with such a phpinfo(): 

http://240plan.ovh.net/test.php

The fonts expected in black display yellow, the other specified colors
are invisible. 



Reproduce code:
---------------
<?php 
DEFINE("TTF_DIR","path/to/fonts/");
$im = imagecreatetruecolor (400, 100);
$black = imagecolorallocate ($im, 0, 0, 0); 
$white = imagecolorallocate ($im, 255, 255, 255);
imagefilledrectangle($im,0,0,399,99,$white);
imagettftext ($im, 30, 0, 10, 40, $black, TTF_DIR."arial.ttf", "Hello
World!");
header ("Content-type: image/png"); 
imagepng ($im);
?>

Expected result:
----------------
Hello World! should be written in black

Actual result:
--------------
Hello World! is written in yellow 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27693&edit=1


Thread (10 messages)

« previous php.bugs (#57447) next »