[Python] Kivy Text Input for Arabic Text

Discussão em 'Python' iniciado por Stack, Maio 6, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to use Kivy's text input for Arabic text. I have an Arabic font set up with my text input but when I type into the input (in Arabic) I just get Arabic letters appearing from left to right (and they're not connected as Arabic letters should be when they're adjacent to each other).

    Is there a way to get Kivy/text input to support RTL languages input that I'm missing (esp Arabic).

    Here's my code,

    from kivy.app import App
    from kivy.uix.floatlayout import FloatLayout

    Config.set('graphics', 'width', '300')
    Config.set('graphics', 'height', '500')


    logger = logging.getLogger('')

    from kivy.uix.textinput import TextInput


    class EditorApp(App):
    def build(self):
    f = FloatLayout()
    textinput = TextInput(text='Hello world', font_name='DroidKufi-Regular.ttf')
    # import pdb; pdb.set_trace()

    f.add_widget(textinput)

    return f


    if __name__ == '__main__':
    EditorApp().run()


    The result of this code:

    [​IMG]

    Continue reading...

Compartilhe esta Página