#22613 [NEW]: imagettfbox() does not add the kerning distance to the running position
| From: | ljpersson at hotmail dot com | Date: | Sun, 09 Mar 2003 11:54:40 +0000 |
| Subject: | #22613 [NEW]: imagettfbox() does not add the kerning distance to the running position | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-35136@lists.php.net to get a copy of this message | ||
From: ljpersson at hotmail dot com
Operating system: SuSE 8.0
PHP version: 4.3.0
PHP Bug Type: GD related
Bug description: imagettfbox() does not add the kerning distance to the running position
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;
--
Edit bug report at http://bugs.php.net/?id=22613&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22613&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22613&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22613&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22613&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22613&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22613&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22613&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22613&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22613&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22613&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22613&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22613&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22613&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22613&r=gnused