为什么 ttf 字体不能正确解码 imagettftext php 中的非英语语言?

发布于 2024-11-16 12:37:25 字数 404 浏览 5 评论 0原文

我想将卡纳达语/泰米尔语数据转换为图像。我使用 imagettftext/imagefttext 。我尝试使用字体文件 tunga.ttf、kedage.dfont 等。问题是卡纳达语数据被转换为图像,但并非所有字符都与输入数据相同。 例如:卡纳达语中的 'Ga' 符合预期,但 'Gai' 显示为 'Ga''I'< /代码>。 我希望懂南印度语言的人能理解这一点。这是生成图像的代码行:

imagettftext($main_img, $fontsize, 0, $line_margin, $line_y, $grey, $fontFile, $data);

任何人都可以建议为什么会发生这种情况吗?

I want to convert a Kannada/Tamil data to image. I use imagettftext/imagefttext . I tried using the font file tunga.ttf, kedage.dfont etc. The problem is that the kannada data gets converted to image but not all characters are the same as the input data.
Eg: 'Ga' in kannada is as expected, but 'Gai' is displayed as 'Ga' and 'I'.
I hope someone who knows South Indian languages understands this. Here is the line of code that generates the image:

imagettftext($main_img, $fontsize, 0, $line_margin, $line_y, $grey, $fontFile, $data);

Can anyone suggest why does this happen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文