Created
February 13, 2013 01:03
-
-
Save akshayaurora/4782064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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