Accented characters not showing when using imagett

2019-03-03 02:57发布

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

2条回答
乱世女痞
2楼-- · 2019-03-03 03:19

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.

查看更多
何必那么认真
3楼-- · 2019-03-03 03:35

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.

查看更多
登录 后发表回答