ID: 50194 Updated by: f...@php.net Reported By: stanislav at ww9 dot ru Status: Open Bug Type: GD related Operating System: Windows PHP Version: 5.2.11 New Comment:
Reproduced with PHP5.3.1RC3 on Ubuntu LTS I tend to blame the font. Previous Comments: ------------------------------------------------------------------------ [2009-11-16 20:55:55] stanislav at ww9 dot ru 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 this bug report at http://bugs.php.net/?id=50194&edit=1