当前位置:网站首页>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 ,
边栏推荐
- Sqoop I have everything you want
- Kernel link script parsing
- Uipath browser performs actions in the new tab
- Concept and basic knowledge of network layering
- EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?
- The problem of "syntax error" when uipath executes insert statement is solved
- pip install pyodbc : ERROR: Command errored out with exit status 1
- Wechat applet obtains mobile number
- FlutterWeb瀏覽器刷新後無法回退的解决方案
- C语言指针*p++、*(p++)、*++p、*(++p)、(*p)++、++(*p)对比实例
猜你喜欢
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
ASEMI整流桥DB207的导通时间与参数选择
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
Alibaba brand data bank: introduction to the most complete data bank
Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
Is it meaningful for 8-bit MCU to run RTOS?
【MySQL入门】第一话 · 初入“数据库”大陆
Pyspark operator processing spatial data full parsing (5): how to use spatial operation interface in pyspark
Getting started with pytest ----- test case pre post, firmware
PyTorch 提取中间层特征?
随机推荐
C# NanoFramework 点灯和按键 之 ESP32
Reppoints: advanced order of deformable convolution
C # nanoframework lighting and key esp32
scratch疫情隔离和核酸检测模拟 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
开源与安全的“冰与火之歌”
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
Remote code execution penetration test - B module test
VR panoramic wedding helps couples record romantic and beautiful scenes
Debug xv6
远程代码执行渗透测试——B模块测试
Pyspark operator processing spatial data full parsing (4): let's talk about spatial operations first
MySQL 8 sub database and table backup database shell script
Easy introduction to SQL (1): addition, deletion, modification and simple query
The NTFS format converter (convert.exe) is missing from the current system
OliveTin能在网页上安全运行shell命令(上)
Solid principle
BearPi-HM_ Nano development board "flower protector" case
C语言指针*p++、*(p++)、*++p、*(++p)、(*p)++、++(*p)对比实例