Python kivy | Arabic text on Label text

后端 未结 1 1655
既然无缘
既然无缘 2021-01-25 12:39

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 bu         


        
相关标签:
1条回答
  • 2021-01-25 12:58

    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.

    0 讨论(0)
提交回复
热议问题