php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30652 imagettftext different output os
Submitted: 2004-11-01 16:00 UTC Modified: 2007-11-08 15:50 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: info at paulinternet dot nl Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 4.3.9 OS: Windows & Linux
Private report: No CVE-ID: None
 [2004-11-01 16:00 UTC] info at paulinternet dot nl
Description:
------------
I can run this script on the localhost and on the server of my hosting provider.
The image on the localhost is a bit difference from the image on the server.
Is this a bug? If not, how can I get on my computer the same output as on the server?

My phpinfo: http://www.paulinternet.nl/php.net/Localhost.htm
Server phpinfo: http://www.paulinternet.nl/php.net/Server.htm
My output: http://www.paulinternet.nl/php.net/Localhost.png
Server output: http://www.paulinternet.nl/php.net/Server.png
Verdana font: http://www.paulinternet.nl/php.net/Verdana.ttf

Reproduce code:
---------------
header("Content-type: image/png");
$Image = imagecreate(200, 24);
imagecolorallocate($Image, 0, 0, 0);

$Kleur = imagecolorallocate($Image, 255, 255, 255);
imagettftext($Image, 16, 0, 2, 18, $Kleur, "Pagina's/Tekst/Verdana.ttf", "I have a problem");

imagepng($Image);
imagedestroy($Image);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-04 19:52 UTC] info at paulinternet dot nl
Description:
------------
Imagettftext produces different images on Windows and Linux.
I used the Verdana font, but this happends on more(maybe all) fonts.

GD version: bundled (2.0.28 compatible)
Windows output: http://www.paulinternet.nl/php.net/Windows.png
Linux output: http://www.paulinternet.nl/php.net/Linux.png
Verdana font: http://www.paulinternet.nl/php.net/Verdana.ttf

Reproduce code:
---------------
header("Content-type: image/png");
$Image = imagecreate(200, 24);
imagecolorallocate($Image, 0, 0, 0);

$Kleur = imagecolorallocate($Image, 255, 255, 255);
imagettftext($Image, 16, 0, 2, 18, $Kleur, "Pagina's/Tekst/Verdana.ttf", "I have a problem");

imagepng($Image);
imagedestroy($Image);
 [2004-11-19 11:31 UTC] pajoye@php.net
Please provide valid URL. These urls (the images) do not work .

--Pierre
 [2004-11-19 16:09 UTC] info at paulinternet dot nl
The urls in my second post do work.
You can ignore my first post, when I posted it I didn't know the outputs were different because the server has an other os than my computer.
 [2005-01-14 22:18 UTC] sniper@php.net
The urls do NOT work. Please post working URLS.

 [2005-01-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-11-08 11:18 UTC] news at unleashedmind dot com
I can confirm, this bug exists with PHP 4.* and PHP 5.*. It seems like fonts on linux miss some anti-aliasing pixels.

Example:
- http://www.unleashedmind.com/files/php.net-30652-imagettftext-windows.png
- http://www.unleashedmind.com/files/php.net-30652-imagettftext-linux.png

The given example is scaled down with a factor of 7 (a test to avoid this bug). Characters in the displayed output size without scaling would actually be even more "thin" on Linux.

Current phpinfo():
http://www.unleashedmind.com/php.net-30652-phpinfo.php

It does not matter, which font or font type is used. I can reproduce this bug with TrueType, OpenType and PostScript Type 1 fonts.
 [2007-11-08 15:50 UTC] pajoye@php.net
It depends on the freetype version and configuration (its default option, kerning, etc.). Windows php binaries certainly use a different version than the one available on your linux system.

Not a php or gd bug > bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC