#49815 [Fbk->Opn]: Problem with imagettfbbox
| From: | christian dot roy at orange dot fr | Date: | Thu, 08 Oct 2009 20:14:31 +0000 |
| Subject: | #49815 [Fbk->Opn]: Problem with imagettfbbox | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143396@lists.php.net to get a copy of this message | ||
ID: 49815
User updated by: christian dot roy at orange dot fr
Reported By: christian dot roy at orange dot fr
-Status: Feedback
+Status: Open
Bug Type: GD related
Operating System: Linux
PHP Version: 5.2.11
New Comment:
Sorry.
"Actual result" should have been :
with 5.2.11 :
bbox returned rectangle for a : -1 * 1 * 32 * 1 * 32 * -38 *
-1 * -38
bbox returned rectangle for k : -1 * -1 * 37 * -1 * 37 * -57
* -1 * -57
bbox returned rectangle for j : -1 * 17 * 21 * 17 * 21 * -57
* -1 * -57
Previous Comments:
------------------------------------------------------------------------
[2009-10-08 19:49:40] Sjoerd@php.net
Thank you for your bug report.
The expected and actual results in your bug report are the same. Please
describe what is wrong with the x-coordinate and what you expect.
------------------------------------------------------------------------
[2009-10-08 15:07:48] christian dot roy at orange dot fr
Description:
------------
delivered value problem : x coord are wrong.
Seems to be very similar with bug #48801 taht has been fixed in 5.2.11
for y coordinates
Reproduce code:
---------------
$fontPath = 'Labo/Includes/Times.ttf'; // std Times.ttf
$testChars = array( 'a', 'k', 'j' );
echo '<pre>';
foreach( $testChars as $char )
{
$dims = imagettfbbox( 60, 0, $fontPath, $char );
echo '<br>bbox returned rectangle for ' . $char . ' : ';
echo $dims[0]." * ";
echo $dims[1]." * ";
echo $dims[2]." * ";
echo $dims[3]." * ";
echo $dims[4]." * ";
echo $dims[5]." * ";
echo $dims[6]." * ";
echo $dims[7]."<br>";
}
echo '</pre>';
Expected result:
----------------
With PHP 4.4.9 :
bbox returned rectangle for a : 2 * 1 * 35 * 1 * 35 * -38 *
2 * -38
bbox returned rectangle for k : 0 * -1 * 38 * -1 * 38 * -57
* 0 * -57
bbox returned rectangle for j : -9 * 17 * 14 * 17 * 14 * -57
* -9 * -57
Actual result:
--------------
With PHP 5.2.11
bbox returned rectangle for a : 2 * 1 * 35 * 1 * 35 * -38 *
2 * -38
bbox returned rectangle for k : 0 * -1 * 38 * -1 * 38 * -57
* 0 * -57
bbox returned rectangle for j : -9 * 17 * 14 * 17 * 14 * -57
* -9 * -57
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49815&edit=1