gpt4 book ai didi

python - Kivy文本输入: Chinese characters

转载 作者:太空宇宙 更新时间:2023-11-03 20:33:20 29 4
gpt4 key购买 nike

当我选择输入语言为中文(拼音)并尝试输入时,仅显示英文字母,并且不显示有关将其转换为汉字的建议。

有什么办法可以解决这个问题吗?

最佳答案

试试这个:首先下载一个字体,这里我使用DroidSansFallback.ttf,并指定给Textinput的font_name属性,并使用buildozer打包成apk文件。

测试.kv:

AddLocationForm:
<AddLocationForm@BoxLayout>:
orientation: 'vertical'
BoxLayout:
height: "40dp"
size_hint_y: None
TextInput:
font_name: "DroidSansFallback.ttf"
size_hint_x: 50
Button:
text: "Search"
size_hint_x: 25
Button:
text: "Current Location"
size_hint_x: 25

main.py:

from kivy.app import App


class TestAPP(App):
pass

if __name__ == '__main__':
TestAPP().run()

image here

关于python - Kivy文本输入: Chinese characters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57339367/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com