#49089 [Opn->Fbk]: problems with ImageTTFBBox and ImageTTFText
| From: | kalle@php.net | Date: | Thu, 30 Jul 2009 06:30:54 +0000 |
| Subject: | #49089 [Opn->Fbk]: problems with ImageTTFBBox and ImageTTFText | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140470@lists.php.net to get a copy of this message | ||
ID: 49089
Updated by: kalle@php.net
Reported By: fausto dot gastaldin at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: Linux CentOS
PHP Version: 5.2.10
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-07-28 15:57:58] fausto dot gastaldin at gmail dot com
Description:
------------
After updating php to 5.2.10 (we have freetype 2.2.1 and GD 2.0.34)w e
have this problem:
http://www.fmeshop.com/fm/test/lib/heading.php?text=Felpe12345678
The text is cut, we have a wrong align.
Reproduce code:
---------------
Code used to generate text and align inside png image.
$dip = get_dip($font_file,$font_size) ;
$box = @ImageTTFBBox($font_size,0,$font_file,$text) ;
$image = @ImageCreate(abs($box[2]-$box[0]),abs($box[5]-$dip)) ;
ImageTTFText($image,$font_size,0,-$box[0],abs($box[5]-$box[3])-$box[1],
$font_color,$font_file,$text) ;
header('Content-type: ' . $mime_type) ;
ImagePNG($image) ;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49089&edit=1