Take the 2-minute tour ×

I'm using the following code to generate a text-based image. Everything works fine except that letters "a" and "A" appear as å and Å respectively. Why?

Everything appears fine but a / A.


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

// Create some colors
imagefilledrectangle($im, 0, 0, 399, 29, $white);

// The text to draw
//$text = @$_GET['text'];
$text = "qwertyuiopASDFGHJKLasdfghjklzxcvbnm";

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

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

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


Thanks! =)

edit: Snapshot of img: enter image description here

edit2: Does this conclude anything? http://en.wikipedia.org/wiki/%C3%85#On_computers

share|improve this question
That sounds strange. Can you show a screen shot of such an image? –  Pekka 웃 Aug 12 '12 at 13:00
It really sounds strange. And I'd say it is hard to say unless one could use the system you sit in front of and debug the issue. Also the dead code you have in there is a smell in my eyes that yourself is part of the problem and not it's solution. –  hakre Aug 12 '12 at 13:01
There's the image. And, the dead code wasn't supposed to be there. Regardless, the problem persists. –  Carlos Infoster Aug 12 '12 at 13:04
Pass it a unicode string utf8_encode($text) –  Burhan Khalid Aug 12 '12 at 13:14
You're 1000000% sure your source material is an A? If yes, then this really is super weird. Can you use an alternative font and see whether the problem persists? –  Pekka 웃 Aug 12 '12 at 15:45

1 Answer 1


The font helonia.ttf has something weird. Idk what but it did.

I tried arial.ttd and issue was resolved!

Thanks to all who helped!

share|improve this answer

Your Answer


