Bug #81617 [NEW]: text with 90 degree angle not rendered correctly
| From: | dwhile at while dot org dot uk | Date: | Fri, 12 Nov 2021 11:52:38 +0000 |
| Subject: | Bug #81617 [NEW]: text with 90 degree angle not rendered correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-237721@lists.php.net to get a copy of this message | ||
From: dwhile at while dot org dot uk
Operating system: Linux
PHP version: 8.0.12
Package: *Graphics related
Bug Type: Bug
Bug description:text with 90 degree angle not rendered correctly
Description:
------------
Using the imagettftext function call with an angle of 90 degrees causes
the output to be rendered with each letter of the text on top of one
another.
Using the example from the documentation page and changing the angle to
90 causes the problem indeed anything above around 45 degrees shows the
same problem.
Test script:
---------------
<?php
header('Content-Type: image/png');
$im = imagecreatetruecolor(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
$text = 'Testing...';
$font = '/usr/share/fonts/msttcorefonts/arial.ttf';
imagettftext($im, 20, 90, 11, 21, $grey, $font, $text);
imagettftext($im, 20, 90, 10, 20, $black, $font, $text);
imagepng($im);
imagedestroy($im);
?>
Expected result:
----------------
The text should be rendered vertically reading from bottom to top.
Actual result:
--------------
The rendered text has each character rendered on top of each other.
--
Edit bug report at https://bugs.php.net/bug.php?id=81617&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81617&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81617&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81617&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81617&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81617&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81617&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81617&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81617&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81617&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81617&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81617&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81617&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81617&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81617&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81617&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81617&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81617&r=mysqlcfg