ID: 37730 Comment by: hopka at hopka dot net Reported By: marc dot lazzaro at st dot com Status: Feedback Bug Type: GD related Operating System: Win XP PHP Version: 5.1.4 Assigned To: pajoye New Comment:
The font is standard Arial, the ttf i use is here: http://hopka.net/Arial.ttf However, i did try other fonts and i could not find any font that produced different results. Previous Comments: ------------------------------------------------------------------------ [2007-03-01 11:45:44] [EMAIL PROTECTED] "so i don't see how i should rotate the offset to get the correct bounding box." Your script is wrong, you add 100 to each vertex, no matter where they are. The result rectangle is then drawn at the wrong place. About the offset pixel, what I asked here remains. Please provide the font as well. ------------------------------------------------------------------------ [2007-03-01 11:40:15] hopka at hopka dot net If i draw the box that imagettftext (sorry, did not try that before) returns without modifying the coordinates, it is almost (1 pixel off) the same as the box i get after adding 100 to each coordinate of imagettfbbox' return value. That would mean that either imagettftext is also wrong (because it produces the same results as my script) or that one would also have to modify the coordinates returned by imagettftext. Also, the rectangles returned by both functions are already rotated, so i don't see how i should rotate the offset to get the correct bounding box. ------------------------------------------------------------------------ [2007-03-01 00:14:13] [EMAIL PROTECTED] "I made a little demonstration script (includes source + phpinfo): http://hopka.net/imagettfbbox.php5" Your script is wrong, you forgot that each position is relative to the origin of the text. Adding 100 to each of them is not correct. You have to rotate the offset. ------------------------------------------------------------------------ [2007-02-27 15:10:59] hopka at hopka dot net I have the same problem with PHP 5.1.2 on Linux and 5.2.0 on Windows XP. I use imagepolygon to render the bounding box and with a rotation of 0 degrees (or 360, 720, etc) it fits around the text perfectly. As soon as I set a different angle, the bounding box is too large and at the wrong position. I made a little demonstration script (includes source + phpinfo): http://hopka.net/imagettfbbox.php5 ------------------------------------------------------------------------ [2007-01-23 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/37730 -- Edit this bug report at http://bugs.php.net/?id=37730&edit=1