Bug #71602 [NEW]: bounding box not accurate

From: Date: Mon, 15 Feb 2016 22:22:06 +0000
Subject: Bug #71602 [NEW]: bounding box not accurate
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199237@lists.php.net to get a copy of this message
From: treboralmasy1 at gmail dot com Operating system: PHP version: 5.6.18 Package: *General Issues Bug Type: Bug Bug description:bounding box not accurate Description: ------------ --- From manual page: http://www.php.net/function.imagettfbbox --- The bounding box dimensions are not accurate sometimes being off by as much as a full character. Test script: --------------- <?php $text = 'hello there'; $box = imagettfbbox(12,0,'arial.ttf',$text); $width = abs($box[0]-$box[2]); $text = str_replace(' ','&nbsp;',$text); echo '<svg width="500" height="200"> <g transform="scale(5)"> <text x="0" y="20" style="font-family:arial; font-size:12pt;">'.$text.'</text> <rect x="0" y="10" width="'.$width.'" height="20" style="fill-opacity:0.5; fill:yellow;" /> </g> </svg>'; exit; ?> -- Edit bug report at https://bugs.php.net/bug.php?id=71602&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71602&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71602&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71602&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71602&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71602&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71602&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71602&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71602&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71602&r=support Expected behavior: https://bugs.php.net/fix.php?id=71602&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71602&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71602&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71602&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71602&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71602&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71602&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71602&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71602&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71602&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71602&r=mysqlcfg

« previous php.bugs (#199237) next »