php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22613 imagettfbox() does not add the kerning distance to the running position
Submitted: 2003-03-09 05:54 UTC Modified: 2003-03-10 13:09 UTC
From: ljpersson at hotmail dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4.3.0 OS: SuSE 8.0
Private report: No CVE-ID: None
 [2003-03-09 05:54 UTC] ljpersson at hotmail dot com
The calculation of TTF bounding box through ImageTTFBBox() is incorrect.

This shows up as the bounding box becomes a few pixels to wide when spaces or characters that extend below the baseline is used. If justa  few simple characters i.e. "abc" is used then it is corect but if you take the string (for example) " ab cgAj" then the bounding box is lightly to wide. All texts at zero angle.

I have made a simple example at

http://jpgraph.fan-atics.com/viewtopic.php?t=795

which clearly illustrates and describes the problem. 

In that thread there is also a suggestion for a fix (which I hadn't had time to verify myself). It seems that the kerning distance is not properly added to the running position.

Hence, the fix should be to in gdft.c replace 

pen.x += delta.x; 

with 

pen.x += delta.x; 
penf.x += delta.x; 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-09 18:05 UTC] sniper@php.net
As this is bug in GD itself, you should report it to 
the author of it too.

 [2003-03-10 13:09 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 03:01:28 2024 UTC