Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# -*- coding: utf-8 -*-
import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from bidi.algorithm import get_display
import arabic_reshaper
Builder.load_string(
'''
<TI>
but: but
Button:
id: but
font_name: 'data/fonts/DejaVuSans.ttf'
font_size: '45dp'
''')
class TI(FloatLayout):
def __init__(self, **kwargs):
super(TI, self).__init__(**kwargs)
self.but.text = get_display(arabic_reshaper.reshape(u'العربية Hello World'))
class MyApp(App):
def build(self):
return TI()
if __name__ == '__main__':
MyApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.