tnx my problem is fixed now
# -*- coding: utf-8 -*-
import kivy
from kivy.uix.widget import Widget
from kivy.uix.label import Label
import arabic_reshaper
from bidi.algorithm import get_display
class GUI(Widget):
def __init__(self, **kwargs):
super(GUI, self).__init__(**kwargs)
label = Label(text=u"سلام", center=(100,100))
label.font_name="BNAZANIN.TTF"
label.font_size=40
reshaped_text = arabic_reshaper.reshape(u'سلام')
bidi_text = get_display(reshaped_text)
label.text = reshaped_text = arabic_reshaper.reshape(bidi_text)
self.add_widget(label)
class MyApp(App):
def build(self):
return GUI()
if __name__ == '__main__' :
MyApp().run()
mr.mobini there is a way to apply this on textinput class too:
class PersianTextInput(TextInput):
def _create_line_label(self, text, hint=False):
reshaped_text = arabic_reshaper.reshape(text)
text = get_display(reshaped_text)
super(PersianTextInput, self)._create_line_label(text, hint)