Skip to content

Instantly share code, notes, and snippets.

@akshayaurora
Created February 13, 2013 01:03
Show Gist options
  • Save akshayaurora/4782064 to your computer and use it in GitHub Desktop.
Save akshayaurora/4782064 to your computer and use it in GitHub Desktop.
# -*- 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