#34268 [Opn->Fbk]: imagettftext broken with Umlauts
| From: | pajoye@php.net | Date: | Fri, 26 Aug 2005 13:26:29 +0000 |
| Subject: | #34268 [Opn->Fbk]: imagettftext broken with Umlauts | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84029@lists.php.net to get a copy of this message | ||
ID: 34268
Updated by: pajoye@php.net
Reported By: mb at imp dot ch
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: FreeBSD 4.11
PHP Version: 4.4.0
-Assigned To:
+Assigned To: pajoye
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Use the bundled GD ("configure --with-gd", be sure that no gd
developement files are in the std path).
If the problem persists, please provide the fonts and small script to
reproduce the problem.
Previous Comments:
------------------------------------------------------------------------
[2005-08-26 15:22:06] mb at imp dot ch
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 this bug report at http://bugs.php.net/?id=34268&edit=1