当前位置:网站首页>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

边栏推荐
- VIM quickly select a method / function
- Market prospect analysis and Research Report of denitrification unit in 2022
- Vulkan-官方示例解读-RayTracingShadows&在这里边使用模型(1)
- Comparison of four delivery modes of Message Oriented Middleware
- 常用测试用例设计方法之场景法详解
- 手工测试转不了自动化测试,缺的是什么?
- Methods to detect whether PHP websites have been broken
- How to invest in programming knowledge and reduce the impact of knowledge failure
- 高考结束,可以干什么事情,专业应该如何选择?-- 来自一个在校大学生的肺腑之言
- 雷达辐射源调制信号仿真(代码)
猜你喜欢

如何提高回归测试效率

Writing shell scripts using vscode

Pictures that make people feel calm and warm

2022 年 5 月产品大事记

Docker builds a redis Cluster - three machines, three masters and three slaves

Rational use of thread pool and thread variables

Vulkan-官方示例解读-RayTracing

Kirin V10 installation of tongweb7.0

三层带防护内网红队靶场

2022-06-10:薯队长从北向南穿过一片红薯地(南北长M,东西宽N),红薯地被划分为1x1的方格, 他可以从北边的任何一个格子出发,到达南边的任何一个格子, 但每一步只能走到东南、正南、西南方向的
随机推荐
Student teacher examination management system based on SSM framework
Summary of C language implementation of BP neural network
Lexical analyzer for compiling principle notes
Chinese classics for children
[network] socket programming
如何提高回归测试效率
Kirin V10 installation of tongweb7.0
Optimize your code execution efficiency with completabilefuture
6. form label
Market prospect analysis and Research Report of Ethernet scanner in 2022
Docker swarm installs redis cluster (bitnami/redis cluster:latest)
Market prospect analysis and Research Report of single photon counting detector in 2022
Quartz: an old and robust open source task scheduling framework, which is smooth enough to use
Why does the hospital comprehensive security system synchronize the NTP clock of the network server?
Protection and bypass of repeated contracting
JMeter piezometric interface programming North
Pci/pcie related knowledge
【CustomView】Glide+BitmapTransformation 图片上下边框波浪处理(WaveTransformation)
PHP正则用例
【网络篇】套接字编程