php.net |  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
Votes:1
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
 [2010-03-10 15:56 UTC] cschneid at cschneid dot com
Description:
------------
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:
---------------
<?php
$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

Patches

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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-24 05:12 UTC] tabe@php.net
Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=296693
Log: Fixed bug #51263 (imagettftext and rotated text uses wrong baseline)
 [2010-03-25 11:14 UTC] tabe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: tabe
 [2010-03-25 11:14 UTC] tabe@php.net
Hi cschneid,

Thanks for your patch. Applied.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC