|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51263 imagettftext and rotated text uses wrong baseline (regression)
Submitted: 2010-03-10 15:56 UTC Modified: 2010-03-25 11:14 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: cschneid at cschneid dot com Assigned: tabe (profile)
Status: Closed Package: GD related
PHP Version: 5.3.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cschneid at cschneid dot com
New email:
PHP Version: OS:


 [2010-03-10 15:56 UTC] cschneid at cschneid dot com
imagettftext and rotated text by e.g. 90 degrees aligns text on top of characters instead of baseline.

The regression was introduced with commit
r293268  | tabe       | 2010-01-08 13:18:52 | Bug #49600 (imageTTFText text shifted right) - fix difference of horizontal position between imagettftext() and imagettfbbox()

Test script:
$img = imagecreatetruecolor(23, 100);
$col = imagecolorallocate($img, 255, 255, 255);
imagettftext($img, 8, 90,  10, 90, $col, "verdana.ttf", "foo bar qux");
imagepng($img, "img.png");

Expected result:
Normal text rotated by 90 degrees

Actual result:
Text rotated but aligned at top of characters instead of bottom


rotatedimagettf.patch (last revision 2010-03-10 14:57 UTC by cschneid at cschneid dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-24 05:12 UTC]
Automatic comment from SVN on behalf of tabe
Log: Fixed bug #51263 (imagettftext and rotated text uses wrong baseline)
 [2010-03-25 11:14 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: tabe
 [2010-03-25 11:14 UTC]
Hi cschneid,

Thanks for your patch. Applied.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jun 06 09:03:41 2023 UTC