2012-08-12 3 views
0

다음 코드를 사용하여 텍스트 기반 이미지를 생성하고 있습니다. 문자 "a"와 "A"가 각각 å과 Å으로 나타나는 것을 제외하고는 모든 것이 잘 작동합니다. 왜?imagettftext(), GD, TrueType 글꼴 및 문자 'a'/ 'A'(이상한)

모든 것이 잘 나타납니다하지만/A를

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, 0, 0, 0); 
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); 

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

감사합니다! =)

편집 : enter image description here

가 EDIT2 : 이 아무것도 결론을합니까 IMG의 스냅 샷? http://en.wikipedia.org/wiki/%C3%85#On_computers

+0

이상하게 들립니다. 그런 이미지의 스크린 샷을 보여줄 수 있습니까? –

+0

정말 이상하게 들립니다. 그리고 당신이 앉아서 문제를 디버깅하는 시스템을 사용할 수 없다면 말하기는 어렵다고 말할 수 있습니다. 또한 당신이 가지고있는 죽은 코드는 내 눈에 자신이 문제의 일부이며 해결책이 아닌 냄새가 있습니다. – hakre

+0

이미지가 있습니다. 그리고 죽은 코드는 거기에 있지 않아야했습니다. 어쨌든 문제는 계속됩니다. –

답변

0

문제가 해결 :

글꼴 helonia.ttf 이상한 뭔가가있다. Idk 그러나 그것은했다.

arial.ttd를 시도했지만 문제가 해결되었습니다.

도와 주신 모든 분들께 감사드립니다.