KivyMD中的几个字段不支持波斯/阿拉伯字符

问题描述

我对KivyMD中的波斯/阿拉伯字符有疑问,在某些地方似乎arabic_reshaperbidi.algorithm无效。这是我的代码

from kivymd.app import MDApp
from kivymd.uix.screen import Screen
from kivy.lang import Builder
import arabic_reshaper
import bidi.algorithm

screen_helper_up = """
Screen:
    NavigationLayout:
        ScreenManager:
            Screen:
                BoxLayout:
                    orientation: 'vertical'

                    MDToolbar:
                        #1
                        title: app.res3 + 'A'
                        font_name:'arial'
                        left_action_items: [["menu",lambda x: nav_drawer.toggle_nav_drawer()]]

                        elevation:10

                    MDTextField: 
                        #2
                        text: app.res3 + 'B'
                        #3
                        helper_text: app.res3 + 'C'
                        #4
                        hint_text: app.res3 + 'D'
                        font_name: 'arial'
                        helper_text_mode: "persistent"
                        font_size: 30
                        line_color_focus: self.theme_cls.opposite_bg_normal
                        pos_hint: {'center_x': 0.5,'center_y': 0.3}
                        size_hint: (0.5,0.4)
                        icon_right: "android"


                    Widget:
                    Label:
                        #5
                        text: app.res3 + 'E'
                        font_name:'arial'
                        markup: True
                        font_size: 100
                        color: 0,1

        MDNavigationDrawer:
            id: nav_drawer

"""


class DemoApp(MDApp):
    text3 = ("امیر")
    reshaped_texts3 = arabic_reshaper.reshape(text3)
    res3 = bidi.algorithm.get_display(reshaped_texts3)

    def build(self):
        screen = Screen()
        screen = Builder.load_string(screen_helper_up)
        return screen


DemoApp().run()

在#2和#5之后的行中,完美显示了文本:“امیر”,但在#1,#3和#4之后的行中显示为小矩形,如下所示: enter image description here

换句话说,MDTextField -> textLabel中的单词“امیر”可以完美显示,而MDToolbar -> titlehelper_texthint_text中的单词“امیر”用未知字符写

搜索了SOF,这里还有另一个主题,但似乎与主题无关:TOPIC

我还在KivyMD不和谐小组和github页面上对该主题进行了修改,但是正如我上面所说,在某些特定位置,该问题仍然存在。

任何建议都会得到应用。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)