ID: 17955
Updated by: iliaa@php.net
Reported By: dk@webcluster.at
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: RedHat 7.3
PHP Version: 4.2.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
GD extension had undergone a number of revisions since the time this
bug was opened. Is problem described still an issue?
Previous Comments:
------------------------------------------------------------------------
[2002-07-03 04:00:54] markonen@php.net
No, this is in fact ours (all the relevant code is in
gdttf.c).
------------------------------------------------------------------------
[2002-07-02 21:44:59] sniper@php.net
So it's obviously not any bug in PHP.
------------------------------------------------------------------------
[2002-06-25 05:44:46] dk@webcluster.at
Additional info:
I talked again to the freetype guys.
They asked me to try to use "" instead of the characters. This
worked fine:
<quote>
If  works but UTF-8 not then GD was compiled with the option
JISX0208 which IMHO prevents decoding of UTF-8 encoded character
codes.
Then try to find out why this option was set.
</quote>
------------------------------------------------------------------------
[2002-06-24 21:25:51] dk@webcluster.at
<?PHP
function hex2rgb($hex) {
$c = array('R', 'G', 'B'); $i = 0;
preg_replace('/([a-f0-9]{2})/ie', '$rgb[$c[$i++]] = hexdec("\1")',
$hex);
return $rgb;
}
$col = "FF0000";
$text = "Here comes the text!";
$rgb = hex2rgb($col);
$fontsize = 18;
$font="/some/dir/webdings.ttf";
$size=ImageTTFBBox($fontsize,0,$font,$text);
$width = abs($size[2]);
$height = abs($size[5]);
Header ("Content-type: image/jpeg");
$im = ImageCreate ($width+11, $height+8);
$bg = ImageColorAllocate ($im, 255, 255, 255);
ImageColorTransparent($im, $bg);
$main = ImageColorAllocate ($im, $rgb["R"], $rgb["G"], $rgb["B"]);
$shadow = ImageColorAllocate ($im, 219, 219, 219);
ImageTTFText($im,$fontsize,0,1,21,$shadow,$font,$text);
ImageTTFText($im,$fontsize,0,0,20,$main,$font,$text);
ImageGif ($im);
ImageDestroy ($im);
?>
------------------------------------------------------------------------
[2002-06-24 18:54:50] sniper@php.net
Being the lazy asses we are, could you add some
short example script which shows what doesn't work?
--Jani
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/17955
--
Edit this bug report at http://bugs.php.net/?id=17955&edit=1