2011-10-04 57 views
1

我試圖使用PHP的imagettftext來處理utf字符(簡體中文),但它似乎不起作用 - 它顯示了怪異的字符。我使用Arial.tff作爲文本。使用UTF字符的imagettftext

imagettftext($img, $textSize, 0, $locX, $locY, $color, $font, $line); 

回答

0

你的字體必須有你想要打印的那些unicode字符。 Arial.ttf是否包含你想要的所有字符?您可以在Windows上使用「字符映射」工具進行檢查。

+0

在這裏幾乎有相同的問題,只需看看http://stackoverflow.com/questions/582855/east-asian-characters-rendered-as-squares-with-php-imagettftext – akloboucnik