将双向文本打印到图像 [英] Printing Bidi text to an image
问题描述
我在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屋!