|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-26 15:26 UTC] pajoye@php.net
[2005-08-26 16:28 UTC] mb at imp dot ch
[2005-08-26 16:34 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 05:00:02 2025 UTC |
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: ----------------