Edit report at https://bugs.php.net/bug.php?id=50194&edit=1
ID: 50194
Updated by: cmb@php.net
Reported by: stanislav at ww9 dot ru
Summary: With some fonts, letters are overlapped with
imagettftext
Status: Assigned
Type: Bug
Package: GD related
Operating System: Windows
PHP Version: 5.2.11
-Assigned To: tabe
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Um, not sure what's the actual issue reported in this ticket.
Unfortunately, most of the links to results, fonts, etc. in this
report and in #50958 are unavailable in the meantime.
I can reproduce overlapping (respectively insufficient horizontal
letter distance) as reported by alvaro with PHP 5.3.2, but this
has been fixed as of PHP 5.4.0, if not earlier.
However, the original supplied test script gives indeed completely
broken results due to imagealphablending($im, false); even on
recent versions (PHP 5.6.11 and 7.0.0beta1) and apparently not
related to the font. See <http://imgur.com/UPowpes>.
I'll try to
investigate.
Previous Comments:
------------------------------------------------------------------------
[2010-09-21 21:10:29] brunofgaspar at live dot com dot pt
Sorry for double post, but i forgot to include examples
Linux:
http://img836.imageshack.us/i/linuxr.png/
Windows:
http://img829.imageshack.us/i/windowsy.png/
------------------------------------------------------------------------
[2010-09-21 21:06:52] brunofgaspar at live dot com dot pt
Hi,
This is happening on PHP 5.3.3 on Linux ( CentOS 5 )
Some letters are overlapped...
------------------------------------------------------------------------
[2010-04-29 12:46:48] rezny at pharmdata dot cz
There is already a solution for this problem in svn for both 5.2 and 5.3 branches
(submited by tabe more than 5 weeks ago) - look for the file gdft.c . I suppose
that this bug can be closed now.
------------------------------------------------------------------------
[2010-04-23 10:21:05] rezny at pharmdata dot cz
Seems that imagefttext is affected too, resulting image looks exactly the same. Does it use the same
library?
------------------------------------------------------------------------
[2010-04-22 11:12:29] alvaro at demogracia dot com
I've noticed a similar issue with the good old fonts bundled in Windows XP (Arial, Verdana and
specially Tahoma). Fonts look good in PHP/5.3.0 and overlap in PHP/5.3.2 (official VB6 thread-safe
binaries).
Test script:
<?
$text_ansi = 'áéÃóú ÃÃÃÃÃ';
$text_utf8 = utf8_encode('áéÃóú ÃÃÃÃÃ');
$font = 'C:/Windows/fonts/tahoma.ttf';
$im = imagecreatetruecolor(400, 60);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 59, $white);
imagettftext($im, 15, 0, 10, 25, $black, $font, $text_ansi);
imagettftext($im, 15, 0, 10, 55, $black, $font, $text_utf8);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
Rendering sample:
http://img408.imageshack.us/img408/5959/php530.png
http://img8.imageshack.us/img8/4013/php532.png
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=50194
--
Edit this bug report at https://bugs.php.net/bug.php?id=50194&edit=1