Edit report at http://bugs.php.net/bug.php?id=52756&edit=1
ID: 52756 Updated by: paj...@php.net Reported by: rasmus at mindplay dot dk Summary: bounding box coordinates are wrong Status: Feedback Type: Bug Package: GD related Operating System: Linux delphinus 2.6.32.8 PHP Version: 5.2.14 Block user comment: N New Comment: Please provide the font file you use. Previous Comments: ------------------------------------------------------------------------ [2010-09-01 14:18:14] rasmus at mindplay dot dk No luck with PHP 5.3.3 from the XAMPP distribution on Windows. ------------------------------------------------------------------------ [2010-09-01 11:12:08] paj...@php.net Please try with 5.3.3 ------------------------------------------------------------------------ [2010-09-01 04:12:49] rasmus at mindplay dot dk Description: ------------ The metrics returned by this function are inaccurate - I put together a comprehensive test script that demonstrates the problem: http://fontjazz.com/metrics/test.php This is also reproducible on my workstation with PHP 5.3.1 on Windows Vista SP1 (build 6001). This bug has been present in Windows builds of PHP 5 for at least a year, and was introduced in Linux builds more recently - my font embedding system (fontjazz.com) is currently generating broken fonts due to this bug. I've reported this bug before, and if I recall, others reported it before I did - relating this problem to notes/revisions from previous attempts to address this problem might be useful, but I can't seem to find the old bug in the database anymore. I don't recall if this bug was blamed on PHP, GD or FreeType - I think there were different theories at the time, but it looks like there was no resolution. Test script: --------------- The source code for the test script is displayed on this page: http://fontjazz.com/metrics/test.php You will need a font for testing - I recommend "georgiai.ttf", the OpenType version, which can be found on Windows Vista installations under WINDOWS\Fonts. If you don't have this font, try another OpenType font in italics - this problem seems to affect italic fonts the worst, probably because italic typefaces generally have more glyph overlap. With some non-italic fonts, unless rendered at really large sizes, the problem may not be obvious enough to spot with the eye, but there is always some degree of inaccuracy, with any font, when rendered at a sufficiently large size. Expected result: ---------------- The red outline should accurately surround the rendered text. Actual result: -------------- The red outline is somewhat offset. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52756&edit=1