Python kivy | Arabic text on Label text

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Python kivy | Arabic text on Label text



My problem when i try type arabic text
My code is :


import kivy
from kivy.app import App
from kivy.uix.textinput import TextInput
class TestApp(App):
def build(self):
return TextInput(text='مرحبا بكم ')
myapp=TestApp()
myapp.run()



when i execute
Textinput text is a some of Square




1 Answer
1



You'll have to give the label a font that support Arabic


#option1 -- on each TextInput
TextInput:
font_name: "path/to/a/font/that/support/arabic.ttf"

#option2 override for all TextInputs
<TextInput>:
font_name: ...



the warning from docs says:



Warning
Depending on your text provider, the font file may be ignored. However, you can mostly use this without problems.
If the font used lacks the glyphs for the particular language/symbols you are using, you will see ‘’ blank box characters instead of the actual glyphs. The solution is to use a font that has the glyphs you need to display. For example, to display unicodechar, use a font like freesans.ttf that has the glyph.





Any other way ?
– Eng. Amaar
Dec 28 '17 at 21:14





why do you need another way? what is the problem? I guess you can override kivy's default font -- I've edited my answer about that
– Yoav Glazner
Dec 29 '17 at 11:28





@Eng.Amaar Look at the docs for Config and Ctrl + F for "default_font". (GitHub repo file)
– KeyWeeUsr
Aug 12 at 21:02


Config


Ctrl + F






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard