From: Operating system: Linux & Windows XP PHP version: 5.2.13 Package: GD related Bug Type: Bug Bug description:horizontal misalignment of characters extending beyond their left margin
Description: ------------ The following bug is present in PHP 5.2.13 and was not present in PHP 5.2.11. (It was probably introduced while attempting to solve Bug #49600.) My test bed is Windows XP/Apache 2.0, production site runs on Linux/Apache 1.3, both are showing the same symptom. We are using the commercial font "Pirouette Text" by Linotype which I obviously cannot include in this report. What sets this font apart from most other fonts is the fact that some characters extend horizontally beyond their bounding boxes in terms of character placement. My little test script spells out the word "Information" in "Pirouette Text". In this font the letter "f" (among others) is made up of a large S-like curve extending well into its neighboring letters Test script: --------------- $text = "Information"; $font = "pirouette.otf"; $size = 41; $dim = imagettfbbox($size, 0, $font, $text); $off_y = -$dim[7]; $off_x = -$dim[0]; $img_h = $dim[1]+$off_y+1; $img_w = $dim[2]+$off_x+2; unset($dim); $img = imagecreatetruecolor($img_w, $img_h); imagefilledrectangle($img, 0, 0, $img_w-1, $img_h-1, 0xFFFFFF); imagettftext($img, $size, 0, $off_x, $off_y, 0x000000, $font, $text); header("Content-Type: image/gif"); imagetruecolortopalette($img, false, 32); imagegif($img); imagedestroy($img); Expected result: ---------------- This is what it should look like (rendered by PHP 5.2.11): http://mitglieder.hrc1880.de/penkert/php5_2_11.gif Actual result: -------------- And this is how PHP 5.2.13 messes it up: http://mitglieder.hrc1880.de/penkert/php5_2_13.gif -- Edit bug report at http://bugs.php.net/bug.php?id=51207&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51207&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51207&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51207&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51207&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51207&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51207&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51207&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51207&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51207&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51207&r=support Expected behavior: http://bugs.php.net/fix.php?id=51207&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51207&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51207&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51207&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51207&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51207&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51207&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51207&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51207&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51207&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51207&r=mysqlcfg