php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42735 TTF with umlaute's do not work with built-in GD
Submitted: 2007-09-22 16:42 UTC Modified: 2007-10-03 10:13 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: ses at aviaweb dot com Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 5.2.4 OS: Linux (centos 4)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ses at aviaweb dot com
New email:
PHP Version: OS:

 

 [2007-09-22 16:42 UTC] ses at aviaweb dot com
Description:
------------
This does not appear to work in 5.2.4.

The gd_info() functions reports it's compatible with gd 2.0.34 - according to the boutelle site this was fixed in 2.0.33
http://www.boutell.com/gd/manual2.0.33.html (search on umlaute).

This *does* work with the external GD library supplied with the OS distribution. The external was using php5.2.3 without built-in gd support (loosing 8 gd functions in the bargin - ouch).

I am testing the following to test:

<?php
   header("Content-type: image/png");
   $im = imagecreatetruecolor(400, 30);
   $white = imagecolorallocate($im, 255, 255, 255);
   $black = imagecolorallocate($im, 0, 0, 0);
   imagefilledrectangle($im, 0, 0, 399, 29, $white);
   $text = 'Umlaute: ??ö?O...';
   $font = './arial.ttf';
   imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
   imagepng($im);
   imagedestroy($im);
?>

I copied the arial.ttf from my PC. 


       Thanks,
            -Stephanie


Reproduce code:
---------------
<?php
   header("Content-type: image/png");
   $im = imagecreatetruecolor(400, 30);
   $white = imagecolorallocate($im, 255, 255, 255);
   $black = imagecolorallocate($im, 0, 0, 0);
   imagefilledrectangle($im, 0, 0, 399, 29, $white);
   $text = 'Umlaute: ??ö?O...';
   $font = './arial.ttf';
   imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
   imagepng($im);
   imagedestroy($im);
?>


Expected result:
----------------
I expect to see characters with atleast one that has an umlaute (double dot about the "o" character).

Actual result:
--------------
group of character "boxes" like usually seen when characters entered do not have characters defined in the font being used.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-02 11:29 UTC] pajoye@php.net
"http://www.boutell.com/gd/manual2.0.33.html "

By the way, the new/active site is libgd.org.



Do you have JIS enabled? If yes, disable it and try again please. It is not recommended to be used if you don't need Japanese charset (charset are not compatible and it can mess your results).

Given what you post here, it looks like you use UTF-8, be sure that your script is actually in UTF-8 (not sure if broken text in the script is due to the copy/paste or it is also like that in your original source code.
 [2007-10-03 10:13 UTC] pajoye@php.net
Mark as duplicate from #42218 > bogus.

Same issues (or causes, setup problems).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 18 22:00:03 2025 UTC