問題描述
當我嘗試輸入阿拉伯語文本時遇到的問題我的代碼是:
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()
當我執行textinput 文本是一些Square
when i execute Textinput text is a some of Square
推薦答案
你必須給標簽一個支持阿拉伯語
#option1 -- on each TextInput
TextInput:
font_name: "path/to/a/font/that/support/arabic.ttf"
#option2 override for all TextInputs
<TextInput>:
font_name: ...
來自 docs 說:
警告根據您的文本提供者,字體文件可能會被忽略.但是,您通常可以毫無問題地使用它.如果使用的字體缺少您正在使用的特定語言/符號的字形,您將看到[]"空白框字符而不是實際字形.解決方案是使用具有您需要顯示的字形的字體.例如,要顯示 unicodechar,請使用具有字形的 freesans.ttf 之類的字體.
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.
這篇關于蟒蛇|標簽文本上的阿拉伯文文本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!