Bug #71602 [Opn->Dup]: bounding box not accurate

From: Date: Tue, 23 Feb 2016 12:43:55 +0000
Subject: Bug #71602 [Opn->Dup]: bounding box not accurate
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199418@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71602&edit=1 ID: 71602 Updated by: cmb@php.net Reported by: treboralmasy1 at gmail dot com Summary: bounding box not accurate -Status: Open +Status: Duplicate Type: Bug Package: GD related PHP Version: 5.6.18 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Duplicate of bug #53504. Previous Comments: ------------------------------------------------------------------------ [2016-02-15 22:22:03] treboralmasy1 at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=71602&edit=1

« previous php.bugs (#199418) next »