#50194 [NEW]: With some fonts, letters are overlapped with imagettftext
| From: | stanislav at ww9 dot ru | Date: | Mon, 16 Nov 2009 20:55:56 +0000 |
| Subject: | #50194 [NEW]: With some fonts, letters are overlapped with imagettftext | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-144686@lists.php.net to get a copy of this message | ||
From: stanislav at ww9 dot ru
Operating system: Windows
PHP version: 5.2.11
PHP Bug Type: GD related
Bug description: With some fonts, letters are overlapped with imagettftext
Description:
------------
Just wanted to write a text on an image with tranperent image and got
strange result. Writing text on an image using some true type fonts like
this one http://ww9.ru/zeferinotwo.ttf causes letters to
overlap each other
like here http://ww9.ru/test.php
Reproduce code:
---------------
// Set the content-type
header('Content-type: image/png');
// Create the image
//$im = imagecreatefromjpeg('./user/images/tpls/headbg.jpg');
$im = imagecreatetruecolor(400, 100);
// Create some colors
$background = imagecolorallocatealpha($im, 60, 60, 60, 127);
$black = imagecolorallocate($im, 0, 0, 0);
imagealphablending($im, false);
imagefilledrectangle($im, 0, 0, 399, 99, $background);
// The text to draw
$text = 'Tesing ... ';
// Replace path by your own font path
$font = './zeferinotwo.ttf';
// Add the text
imagettftext($im, 40, 0, 10, 40, $black, $font, $text);
imagesavealpha($im, true);
imagepng($im);
imagedestroy($im);
Expected result:
----------------
The text "Tesing ..." written on an image
Actual result:
--------------
http://ww9.ru/test.php
--
Edit bug report at http://bugs.php.net/?id=50194&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50194&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50194&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50194&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50194&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50194&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50194&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50194&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50194&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50194&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50194&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50194&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50194&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50194&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50194&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50194&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50194&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50194&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50194&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50194&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50194&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50194&r=mysqlcfg