Python kivy:显示一些波斯语/阿拉伯语字母时出现问题
我正在设计一个基于Python和kivy平台的桌面软件,我在软件中使用波斯语/阿拉伯语。使用两个库arabic_Reformer和bidi。但问题是其中两个字母“ی”和“ی”没有正确显示。我对字体的健康状况很有信心,因为首先,它在Photoshop和Word等环境中运行良好,其次,这是这种语言中最著名的字体。但我不知道问题出在哪里,它们在kivy中没有正确显示。我的方法是将字体名称更改为roboto,并替换kivy font folder字体 这是我的代码:Python kivy:显示一些波斯语/阿拉伯语字母时出现问题,python,kivy,arabic,kivymd,Python,Kivy,Arabic,Kivymd,我正在设计一个基于Python和kivy平台的桌面软件,我在软件中使用波斯语/阿拉伯语。使用两个库arabic_Reformer和bidi。但问题是其中两个字母“ی”和“ی”没有正确显示。我对字体的健康状况很有信心,因为首先,它在Photoshop和Word等环境中运行良好,其次,这是这种语言中最著名的字体。但我不知道问题出在哪里,它们在kivy中没有正确显示。我的方法是将字体名称更改为roboto,并替换kivy font folder字体 这是我的代码: from kivy.lang imp
from kivy.lang import Builder
import arabic_reshaper
from bidi.algorithm import get_display
from kivymd.app import MDApp
KV = '''
#:import arabic_reshaper arabic_reshaper
#:import get_display bidi.algorithm.get_display
Screen:
BoxLayout:
orientation: "vertical"
MDToolbar:
title: get_display(arabic_reshaper.reshape("ایران سنس"))
MDLabel:
halign: "center"
text_language: "ar"
base_direction: "rtl"
shorten_from: "left"
strip: True
text:get_display(arabic_reshaper.reshape("این یک متن نمونه برای تست می باشد"))
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run()
这就是结果:
有人知道问题出在哪里吗?可能是使用不同的文本提供程序会更好,但我不确定哪种文本提供程序会得到更好的支持。您能介绍另一种文本提供程序吗@inclementit可能是当前渲染的一个限制,首先我会尝试使用pillow,
pip install pillow
然后使用env KIVY_TEXT=pillow python main.py
运行,但如果这还不够,那么可能需要合并,如果有帮助,会链接linux控制盘,否则你可能需要windows版本。问题解决了我和字体设计师谈过,问题通过字体更新解决了