Accented characters not showing when using imagettftext with otf but showing with ttf

∥☆過路亽.° 提交于 2019-12-20 04:29:08

问题


I'm using imagettftext to generate images from OpenType files. Everything works until I try to use an accented character (e.g. å) or a character such as √. In their place I get the .notdef glyph.

The fonts I'm using definitely have these characters. To make things even more frustrating, when I use a TTF everything works as expected.

Any ideas?

Thanks


回答1:


Sorry to tell you, but PHP OTF supports only standard Ascii characters. It's a well known fact that special characters in OTF only very rarely work. I'm afraid you will have to stick with TTF until they correct that.




回答2:


Not true! (answer 1) imagettftext works with unicode. Some font files do not have accented characters but rely on the graphic library to use the unicode combining diacritical marks (0300–036F) to draw the character correctly. This seems to fail in php gd.



来源:https://stackoverflow.com/questions/2152033/accented-characters-not-showing-when-using-imagettftext-with-otf-but-showing-wit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!