php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31133 ImageFTText does the unexpected
Submitted: 2004-12-16 19:40 UTC Modified: 2005-01-14 18:54 UTC
From: hessefort dot marco at knauf dot de Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.0.3 OS: Windows 2000
Private report: No CVE-ID: None
 [2004-12-16 19:40 UTC] hessefort dot marco at knauf dot de
Description:
------------
This code produces a large white banner with "Testtext" on it when running PHP4 or PHP5 up to 5.0.2 

Exactly the same code with exactly the same machine config produces a large white banner with nothing on it with 5.0.3.

lt_50196.tff is "Futura Condensed Bold". (copyrighted, unfortunately I cannot offer it for download)
However, the code is working with "Arial.ttf" as font.

I can reproduce this behaviour on two machines, both running Win2k SP4 with IIS5 and Windows binaries downloaded from php.net in CGI Mode with the bundled php_gd2.dll. Also running is FreeType 2.1.7

Don't know if it is a PHP "bug", but it's the only thing I changed.

Maybe related to Bug #17924.

Reproduce code:
---------------
<?php
dl('php_gd2.dll');
header ("Content-type: image/png");
$im = imagecreate(5000, 244);
$back = ImageColorAllocate($im, 255, 255, 255);
$fore = ImageColorAllocate($im, 0, 0, 0);

$retarr = ImageFTText ($im, 144, 0, 1, 189, $fore, $_SERVER["SystemRoot"]."\\Fonts\\lt_50196.ttf", "Testtext", array());

ImagePng($im);
imagedestroy($im);
?> 

Expected result:
----------------
Big fat "Testtext" with Font "Futura Condensed Bold" on a large white rectangle.

Actual result:
--------------
Big fat nothing on a large white rectangle when running PHP 5.0.3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-16 23:35 UTC] iliaa@php.net
Please supply any font with which this problem can be duplicated.
 [2004-12-17 11:54 UTC] hessefort dot marco at knauf dot de
I only can reproduce this behavior with Futura Condensed Bold, lt_50196.ttf. I tested all Windows 2000 default fonts and some other free fonts i downloaded, no problem here.
Unfortunately Futura is a commercial font, that i cannot supply. 
As this only happens with this specific font, I am not sure anymore if this is a bug with PHP.
 [2005-01-14 18:54 UTC] sniper@php.net
No bug here unless we can get that font somewhere to test with.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 14:00:02 2025 UTC