I’m trying to render images with verdana text using PHP imagettftext function. However, all east asian characters are not being rendered correctly. I tried using other fonts like tahoma and Lucida Grande, but neither works. Arial Unicode, however, works perfectly.
The problem is that I don’t want to use Arial as my font. Is there any way I could render using a font like Verdana?
(not a unicode and/or font expert; so explanation of the problem would be helpful)
None of Verdana, Tahoma or Lucida Grande contain Chinese/Japanese/Korean characters so they will never be able to render them “correctly”. No font contains glyphs for every Unicode code point, so whichever you pick you’re going to end up with missing glyphs at some point.
There is a font that is like Verdana and contains some CJK characters — specifically Japanese kanji. Maybe that’s enough to cover what you’re trying to do? It’s called Meiryo and comes with Windows Vista/7. You can also get it here. However it is a TrueType Collection (.ttc) file, which I’m not sure if PHP/GD can handle directly; many East Asian fonts come as .ttc files, because they typically contain both proportional and monospace fonts based on the same glyph shapes.
If PHP can’t cope with .ttc, you might need to convert the Meiryo-proportional font out of it into a separate .ttf file, using either a font editor, or the simple ‘breakttc.exe’ command-line tool from the TrueType SDK (ttsdk.zip, mysteriously vanished from microsoft.com, but easily locatable using Google).