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()
当我执行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.
这篇关于蟒蛇|标签文本上的阿拉伯文文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:蟒蛇|标签文本上的阿拉伯文文本
基础教程推荐
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 包装空间模型 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
