将双向文本打印到图像 [英] Printing Bidi text to an image

查看:225
本文介绍了将双向文本打印到图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Python中有一些代码使用PIL,它将打印UTF-8字符到图像。



我注意到,对于像阿拉伯语这样的Bidi脚本,同样的代码不能正确连接字符(只选择初始形式,内部和最终形式不是

解决方案



任何人都可以推荐一种方法或技术来解决这个问题。 div>

如果您想继续使用PIL,请使用 pyarabicshaping pybidi 或者您可以考虑切换到 pangocairo ,其中使用 HarfBuzz 用于文本整形。


I have some code in Python using PIL, that will print UTF-8 characters to an image.

I've noticed that for joining Bidi scripts like Arabic, the same code fails to connect characters correctly (the initial forms are only chosen, medial and final forms aren't utilized)

Can anyone recommend a method or technique for solving this particular issue?

解决方案

If you want to keep using PIL, use pyarabicshaping with pybidi or you might want to consider switching to pangocairo which uses HarfBuzz for text shaping.

这篇关于将双向文本打印到图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆