当前位置:网站首页>Kivy tutorial: support Chinese in Kivy to build cross platform applications (tutorial includes source code)
Kivy tutorial: support Chinese in Kivy to build cross platform applications (tutorial includes source code)
2022-07-06 17:51:00 【Knowledge fatness】
This tutorial discusses Kivy Chinese is supported in , In order to use Chinese 、 Japanese and Korean UI Display text on widget .
Introduce
Kivy Is a used in Python Library for building cross platform applications in . Use the same Python file , You can create Windows、Linux、Mac、Android and iOS Applications .
By default ,Kivy Support this link https://github.com/kivy/kivy/tree/master/kivy/data/fonts Various fonts available in the project . The currently supported fonts are Roboto and DejaVu Sans. Many countries use Chinese in their official languages .
Display Chinese on the label widget
next Python The code creates a Kivy Applications , There is only one window Label The widget , Display Chinese text
import kivy.app
import kivy.uix.label
class TestApp(kivy.app.App):
def build(self):
return kivy.uix.label.Label(text=" I love tian 'anmen square in Beijing ")
testApp = TestApp()
testApp.run()
The result of running this application is shown in the following figure , The text is displayed incorrectly . It means Kivy Unable to understand these characters . Of course , The problem is that it is used in Label The font of the text displayed on the widget .
The good news is Kivy Allow to use our own fonts in UI Display text on widget . If the default Kivy Font does not support Chinese ,
边栏推荐
- 【MySQL入门】第一话 · 初入“数据库”大陆
- The problem of "syntax error" when uipath executes insert statement is solved
- Manifest of SAP ui5 framework json
- Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
- 视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
- Wordcloud colormap color set and custom colors
- Establishment of graphical monitoring grafana
- The NTFS format converter (convert.exe) is missing from the current system
- Automatic operation and maintenance sharp weapon ansible Playbook
- Flink parsing (IV): recovery mechanism
猜你喜欢
Distinguish between basic disk and dynamic disk RAID disk redundant array
The easycvr platform reports an error "ID cannot be empty" through the interface editing channel. What is the reason?
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
编译原理——预测表C语言实现
Pourquoi Li shufu a - t - il construit son téléphone portable?
TCP connection is more than communicating with TCP protocol
C语言通过指针交换两个数
Wordcloud colormap color set and custom colors
8位MCU跑RTOS有没有意义?
Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
随机推荐
78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
The art of Engineering
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
2022年大厂Android面试题汇总(二)(含答案)
Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
Xin'an Second Edition: Chapter 23 cloud computing security requirements analysis and security protection engineering learning notes
Flink parsing (V): state and state backend
Unity particle special effects series - treasure chest of shining stars
Single responsibility principle
Openharmony developer documentation open source project
JMeter interface test response data garbled
Video fusion cloud platform easycvr adds multi-level grouping, which can flexibly manage access devices
OpenCV中如何使用滚动条动态调整参数
PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
Concept and basic knowledge of network layering
C语言指针*p++、*(p++)、*++p、*(++p)、(*p)++、++(*p)对比实例
Run xv6 system
遠程代碼執行滲透測試——B模塊測試
node の SQLite
FlutterWeb瀏覽器刷新後無法回退的解决方案