From:             mb at imp dot ch
Operating system: FreeBSD 4.11
PHP version:      4.4.0
PHP Bug Type:     GD related
Bug description:  imagettftext broken with Umlauts

Description:
------------
After Upgrading PHP from 4.3.3 to 4.4.0, rendered text   
with imagettftext() doesn't show Umlauts in some cases.  
It doesn't matter if the string is utf8 encoded or not,  
the result is the same.  
 
If an Umlaut is followed by a space, it is correctly 
printed:  
 
// Works 
 
$text = 'Testing\xe4 ...'; 
 
But if it is followed by some other Umlaut or 
a different char, it doesn't work at all. 
 
 // Doesn't work 
$text = 'Testing\xe4a ...'; 
 
Any ideas ? 
 
Installed packages are: 
 
gd-2.0.33_1,1 
freetype2-2.1.4_1 

Reproduce code:
---------------
<?php

 // Set the content-type
 header("Content-type: image/png");

 // Create the image
 $im = imagecreatetruecolor(400, 30);

 // Create some colors
 $white = imagecolorallocate($im, 255, 255, 255);
 $grey = imagecolorallocate($im, 128, 128, 128);
 $black = imagecolorallocate($im, 128, 128, 0);

 // Doesn't work
 $text = ' 5 Testing\xe4a ...';

 // Works
 $text = ' 5 Testing\xe4 ...';

 // Replace path by your own font path
 $font = arialn.ttf';

 // Add some shadow to the text
 imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);

 // Add the text
 imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

 // Using imagepng() results in clearer text compared with imagejpeg()
 imagepng($im);
 imagedestroy($im);
 ?>

Expected result:
----------------
 


-- 
Edit bug report at http://bugs.php.net/?id=34268&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34268&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34268&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34268&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34268&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34268&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34268&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34268&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34268&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34268&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34268&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34268&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34268&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34268&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34268&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34268&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34268&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34268&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34268&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34268&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34268&r=mysqlcfg

Reply via email to