ID: 33599
Updated by: [EMAIL PROTECTED]
Reported By: kni at exactal dot com
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: FreeBSD
PHP Version: 4.3.11
-Assigned To:
+Assigned To: pajoye
New Comment:
Please use the bundled library ("configure --with-gd"). Take care to do
not have the developement package of the system GD installed or
available while configuring and installing.
Which Freetype version do you have?
--Pierre
Previous Comments:
------------------------------------------------------------------------
[2005-07-07 05:18:33] kni at exactal dot com
Looks like someone else is experiencing a similar problem --
Comment from: http://www.php.net/imagettftext
gerritvg at gmail dot com
20-May-2005 05:24
The ImageTTFText() function alway work correct. Until the've installed
GD version 2.0.23 on the server.
The quality of the generated buttons is much lower.
------------------------------------------------------------------------
[2005-07-07 05:10:47] kni at exactal dot com
Description:
------------
On my local Linux environment (running PHP 4.3.4 / GD bundled (2.0.15
compatible)) -- all is well. My script produces the following image:
http://www.exactal.com/tmp/phpbugs/wrap-local.png
In my live FreeBSD environment (running PHP 4.3.11 / GD bundled (2.0.28
compatible)) -- output from the same script is of lower quality:
http://www.exactal.com/tmp/phpbugs/wrap-remote.png
Note in particular poor character widths and character spacing (note
also that imagettfbbox used to assess the type width returns a value
that results in the type being truncated).
This is reproducable with different font files, sizes, etc, and is more
noticeable with smaller font sizes.
Reproduce code:
---------------
<?php
$font_size = '11';
$font = "zapf.ttf";
$text = "environmentally sustainable";
$bbox=imagettfbbox($font_size,0,$font,$text);
$left=($bbox[0]>$bbox[6])?$bbox[6]:$bbox[0]; // determine most far
points
$right=($bbox[2]>$bbox[4])?$bbox[2]:$bbox[4];
$width=$right-$left+$margin; // get total width
$newImg = ImageCreateTrueColor($width,30);
$background = imagecolorallocate($newImg, 255, 255, 255);
ImageFill($newImg, 1, 1, $background);
$foreground = imagecolorallocate($newImg, 0, 0, 0);
imagettftext($newImg, $font_size, 0, 0, 20, $foreground, $font,
$text);
header("Content-type: image/png");
ImagePNG($newImg);
ImageDestroy($newImg);
?>
Expected result:
----------------
http://www.exactal.com/tmp/phpbugs/wrap-local.png
Actual result:
--------------
http://www.exactal.com/tmp/phpbugs/wrap-remote.png
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33599&edit=1