当前位置:网站首页>Esp32 development -lvgl uses internal and external fonts
Esp32 development -lvgl uses internal and external fonts
2022-06-11 04:07:00 【z_ Curtain】
code
LVGL Two types of encoding are supported , Namely ASCII Coding and UTF-8 code .
ASCII Encoding only supports the display of English characters .
UTF-8 code It can support the display of all characters in the world , Including displaying Chinese , Display icon font, etc .
typeface
LVGL Multiple fonts are supported by default , Including Chinese fonts . however LVGL Its own Chinese font library and Does not include all commonly used words .
Internal font library
LVGL The internal font library is in lvgl/src/lv_font In the folder . If you need to use a certain font , Only need to lv_conf.h Open the macro definition of the font in .
// Internal Chinese font library
define LV_FONT_SIMSUN_16_CJK 1 /*1000 most common CJK radicals*/
External font library
1、 Generating font files
To use an external font library, you must first use tools to generate font files . What we use here is LvglFontTool.
The tool will directly generate a .c file , Directly copy to the project for use .
2、 Use font library
Copy the generated file to the project , You can use fonts by adding styles .
extern lv_font_t myFont;
lv_style_set_text_font(&style, LV_STATE_DEFAULT, &myFont);
Be careful :
1、 except extern You can also use LVGL Macro declaration for custom font library .
for example :LV_FONT_DECLARE(myFont)
2、 The generated file needs to be modified after being copied to the project lvgl The header file path of .
effect

边栏推荐
- Summary of C language implementation of BP neural network
- Vulkan-官方示例解读-RayTracingShadows&在这里边使用模型(1)
- 【网络篇】套接字编程
- 大厂外包or自研公司?测试人找工作怎么选?
- From function test to advanced automation test, I stayed up 7 days to sort out this 3000 word super complete learning guide [with network disk resources]
- Code replicates CSRF attack and resolves it
- Composition and configuration of GPS Beidou clock synchronization (satellite time synchronization system) in power plant
- Implementation of one-dimensional convolutional neural network CNN based on FPGA (V) data quantization (with code)
- [network] socket programming
- 邪恶的CSRF
猜你喜欢
随机推荐
Writing shell scripts using vscode
Student teacher examination management system based on SSM framework
[interpretable] | axiomatic attribute for deep networks
关于重复发包的防护与绕过
三层带防护内网红队靶场
【网络篇】套接字编程
店铺门面转让出租小程序开发制作功能介绍
2022 love analysis · privacy computing vendor panoramic report | love Analysis Report
7. 列表标签
ETH 中继接口
What great open source projects does Google have?
Discussion on the development trend of remote power management unit (Intelligent PDU)
A.前缀极差(C语言)
Radar emitter modulation signal simulation (code)
如何检查域名解析是否生效?
直播助力杭州电商独角兽冲击上市,分账系统重构电商交易新格局
Unity prefab scene 冲突合并工具 UnityYAMLMerge
[pan micro E9 development] single sign on Kingdee eas
Samsung Galaxy S21 ultra and Apple iPhone 13 Pro Max: which one should you choose
Market prospect analysis and Research Report of surround packing machine in 2022









