当前位置:网站首页>[lvgl (6)] display Chinese settings and make Chinese font
[lvgl (6)] display Chinese settings and make Chinese font
2022-07-24 06:46:00 【Like warm know cold】
Official document link
Fonts — LVGL documentation
https://docs.lvgl.io/master/overview/font.html?highlight=lv_font_declare#LVGL The official online font conversion tool , Font files can be converted to C file .
Online Font Converter Convert TTF and WOFF fonts to C array
https://lvgl.io/tools/fontconverter
LVGL The converted font can also be given to other GUI System use .
First, download the font file
Baiwen provides some open source, free and commercially available fonts .
According to Chinese — Baiwen LVGL Chinese course documents file (100ask.net)q
We can use open source fonts or make our own font files , After preparing the font file, use the font converter to convert it into a font that can be converted in lvgl Font format used on .
Character set encoding range
Unicode It's a universal character code . It assigns a unique code to each character of all kinds of characters in the world , Realize cross language 、 Cross platform applications .
Chinese users are most often exposed to Chinese characters Unicode code . The number of Chinese characters is huge , There are thousands of Chinese characters in daily use , Add rare words , The number reaches tens of thousands . The following table lists the Chinese character set Unicode The coding range is listed :
| Character set | Number of words | Unicode code |
|---|---|---|
| Basic Chinese characters | 20902 word | 4E00-9FA5 |
| Basic Chinese characters supplement | 90 word | 9FA6-9FFF |
| Expand A | 6592 word | 3400-4DBF |
| Expand B | 42720 word | 20000-2A6DF |
| Expand C | 4153 word | 2A700-2B738 |
| Expand D | 222 word | 2B740-2B81D |
| Expand E | 5762 word | 2B820-2CEA1 |
| Expand F | 7473 word | 2CEB0-2EBE0 |
| Expand G | 4939 word | 30000-3134A |
| Kangxi radicals | 214 word | 2F00-2FD5 |
| Radical expansion | 115 word | 2E80-2EF3 |
| Compatible with Chinese characters | 477 word | F900-FAD9 |
| Compatible extensions | 542 word | 2F800-2FA1D |
| PUA(GBK) parts | 81 word | E815-E86F |
| Part extension | 452 word | E400-E5E8 |
| PUA Supplement | 207 word | E600-E6CF |
| Chinese strokes | 36 word | 31C0-31E3 |
| The structure of Chinese characters | 12 word | 2FF0-2FFB |
| Chinese Phonetics | 43 word | 3105-312F |
| Bopomofo extension | 22 word | 31A0-31BA |
| 〇 | 1 word | 3007 |
Latin alphabet Unicode Coding range
The Basic Latin alphabets share 95 Characters , among 52 One belongs to the Latin alphabet , The rest 43 Characters belong to basic characters .
Yes 33 Characters are defined as “ASCII Punctuation and symbols ”, Sometimes called “ASCII Special characters ”.
Simple summary :
| Character set | Number of words | Unicode code |
|---|---|---|
| Numbers 0-9 | 10 word | 30-39 |
| Small letters | 26 word | 61-7a |
| Capital letters | 26 word | 41-5a |
| Punctuation and symbols | 32 word | 20-2F 3A-40 5B-60 7B-7E |
Numbers 0-9: 0123456789
Small letters : abcdefghijklmnopqrstuvwxyz
Capital letters : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Punctuation and symbols : !"#$%&'()*+,-./:;<=>[email protected][\]^_`{|}~The following table will show the Basic Latin alphabet character set Unicode The coding range is listed :
| Code | Show | Decimal system | describe |
|---|---|---|---|
| U+0020 |   | Space | |
| U+0021 | ! | ! | exclamation mark |
| U+0022 | " | " | Double quotes |
| U+0023 | # | # | Well No |
| U+0024 | $ | $ | Price / Currency symbols |
| U+0025 | % | % | Percentage sign |
| U+0026 | & | & | & |
| U+0027 | ' | ' | quotes |
| U+0028 | ( | ( | open parenthesis |
| U+0029 | ) | ) | close parenthesis |
| U+002A | * | * | asterisk |
| U+002B | + | + | plus |
| U+002C | , | , | comma |
| U+002D | - | - | hyphen / minus sign |
| U+002E | . | . | Full stop |
| U+002F | / | / | Forward slash |
| U+0030 | 0 | 0 | Numbers 0 |
| U+0031 | 1 | 1 | Numbers 1 |
| U+0032 | 2 | 2 | Numbers 2 |
| U+0033 | 3 | 3 | Numbers 3 |
| U+0034 | 4 | 4 | Numbers 4 |
| U+0035 | 5 | 5 | Numbers 5 |
| U+0036 | 6 | 6 | Numbers 6 |
| U+0037 | 7 | 7 | Numbers 7 |
| U+0038 | 8 | 8 | Numbers 8 |
| U+0039 | 9 | 9 | Numbers 9 |
| U+003A | : | : | The colon |
| U+003B | ; | ; | A semicolon |
| U+003C | < | < | Less than sign |
| U+003D | = | = | be equal to |
| U+003E | > | > | Greater than sign |
| U+003F | ? | ? | question mark |
| U+0040 | @ | @ | english “at” Abbreviation for |
| U+0041 | A | A | Latin alphabet A |
| U+0042 | B | B | Latin alphabet B |
| U+0043 | C | C | Latin alphabet C |
| U+0044 | D | D | Latin alphabet D |
| U+0045 | E | E | Latin alphabet E |
| U+0046 | F | F | Latin alphabet F |
| U+0047 | G | G | Latin alphabet G |
| U+0048 | H | H | Latin alphabet H |
| U+0049 | I | I | Latin alphabet I |
| U+004A | J | J | Latin alphabet J |
| U+004B | K | K | Latin alphabet K |
| U+004C | L | L | Latin alphabet L |
| U+004D | M | M | Latin alphabet M |
| U+004E | N | N | Latin alphabet N |
| U+004F | O | O | Latin alphabet O |
| U+0050 | P | P | Latin alphabet P |
| U+0051 | Q | Q | Latin alphabet Q |
| U+0052 | R | R | Latin alphabet R |
| U+0053 | S | S | Latin alphabet S |
| U+0054 | T | T | Latin alphabet T |
| U+0055 | U | U | Latin alphabet U |
| U+0056 | V | V | Latin alphabet V |
| U+0057 | W | W | Latin alphabet W |
| U+0058 | X | X | Latin alphabet X |
| U+0059 | Y | Y | Latin alphabet Y |
| U+005A | Z | Z | Latin alphabet Z |
| U+005B | [ | [ | Left bracket |
| U+005C | \ | \ | The backslash |
| U+005D | ] | ] | Right bracket |
| U+005E | ^ | ^ | Cadence ( Stress ) Symbol |
| U+005F | _ | _ | Underline |
| U+0060 | ` | ` | Accent |
| U+0061 | a | a | Latin alphabet a |
| U+0062 | b | b | Latin alphabet b |
| U+0063 | c | c | Latin alphabet c |
| U+0064 | d | d | Latin alphabet d |
| U+0065 | e | e | Latin alphabet e |
| U+0066 | f | f | Latin alphabet f |
| U+0067 | g | g | Latin alphabet g |
| U+0068 | h | h | Latin alphabet h |
| U+0069 | i | i | Latin alphabet i |
| U+006A | j | j | Latin alphabet j |
| U+006B | k | k | Latin alphabet k |
| U+006C | l | l | Latin alphabet l |
| U+006D | m | m | Latin alphabet m |
| U+006E | n | n | Latin alphabet n |
| U+006F | o | o | Latin alphabet o |
| U+0070 | p | p | Latin alphabet p |
| U+0071 | q | q | Latin alphabet q |
| U+0072 | r | r | Latin alphabet r |
| U+0073 | s | s | Latin alphabet s |
| U+0074 | t | t | Latin alphabet t |
| U+0075 | u | u | Latin alphabet u |
| U+0076 | v | v | Latin alphabet v |
| U+0077 | w | w | Latin alphabet w |
| U+0078 | x | x | Latin alphabet x |
| U+0079 | y | y | Latin alphabet y |
| U+007A | z | z | Latin alphabet z |
| U+007B | { | { | Left curly bracket |
| U+007C | | | | | A vertical bar |
| U+007D | } | } | Right curly bracket |
| U+007E | ~ | ~ | Wavy pattern |
ASCII surface
ASCII Code use specified 7 Bit or 8 Bit binary arrays are used to represent 128 or 256 Possible characters . standard ASCII Code is also called basis ASCII code , Use 7 Bit binary number ( The rest 1 Bit binary is 0) To represent all uppercase and lowercase letters , Numbers 0 To 9、 Punctuation , And special control characters used in American English :
| Bin( Binary system ) | Oct( octal ) | Dec( Decimal system ) | Hex( Hexadecimal ) | abbreviation / character | explain |
|---|---|---|---|---|---|
| 0000 0000 | 00 | 0 | 0x00 | NUL(null) | Null character |
| 0000 0001 | 01 | 1 | 0x01 | SOH(start of headline) | Title start |
| 0000 0010 | 02 | 2 | 0x02 | STX (start of text) | Text begins |
| 0000 0011 | 03 | 3 | 0x03 | ETX (end of text) | End of text |
| 0000 0100 | 04 | 4 | 0x04 | EOT (end of transmission) | End of transmission |
| 0000 0101 | 05 | 5 | 0x05 | ENQ (enquiry) | request |
| 0000 0110 | 06 | 6 | 0x06 | ACK (acknowledge) | Receive notice |
| 0000 0111 | 07 | 7 | 0x07 | BEL (bell) | Ring the bell |
| 0000 1000 | 010 | 8 | 0x08 | BS (backspace) | Backspace |
| 0000 1001 | 011 | 9 | 0x09 | HT (horizontal tab) | Horizontal tabs |
| 0000 1010 | 012 | 10 | 0x0A | LF (NL line feed, new line) | Line feed key |
| 0000 1011 | 013 | 11 | 0x0B | VT (vertical tab) | Vertical tabs |
| 0000 1100 | 014 | 12 | 0x0C | FF (NP form feed, new page) | Page feed key |
| 0000 1101 | 015 | 13 | 0x0D | CR (carriage return) | Enter key |
| 0000 1110 | 016 | 14 | 0x0E | SO (shift out) | No switching |
| 0000 1111 | 017 | 15 | 0x0F | SI (shift in) | Enable Toggle |
| 0001 0000 | 020 | 16 | 0x10 | DLE (data link escape) | Data link escape |
| 0001 0001 | 021 | 17 | 0x11 | DC1 (device control 1) | Equipment control 1 |
| 0001 0010 | 022 | 18 | 0x12 | DC2 (device control 2) | Equipment control 2 |
| 0001 0011 | 023 | 19 | 0x13 | DC3 (device control 3) | Equipment control 3 |
| 0001 0100 | 024 | 20 | 0x14 | DC4 (device control 4) | Equipment control 4 |
| 0001 0101 | 025 | 21 | 0x15 | NAK (negative acknowledge) | Refuse to accept |
| 0001 0110 | 026 | 22 | 0x16 | SYN (synchronous idle) | Sync idle |
| 0001 0111 | 027 | 23 | 0x17 | ETB (end of trans. block) | End transfer block |
| 0001 1000 | 030 | 24 | 0x18 | CAN (cancel) | Cancel |
| 0001 1001 | 031 | 25 | 0x19 | EM (end of medium) | Media end |
| 0001 1010 | 032 | 26 | 0x1A | SUB (substitute) | Instead of |
| 0001 1011 | 033 | 27 | 0x1B | ESC (escape) | Change the code ( overflow ) |
| 0001 1100 | 034 | 28 | 0x1C | FS (file separator) | File separator |
| 0001 1101 | 035 | 29 | 0x1D | GS (group separator) | Grouping |
| 0001 1110 | 036 | 30 | 0x1E | RS (record separator) | Record separator |
| 0001 1111 | 037 | 31 | 0x1F | US (unit separator) | Cell separator |
| 0010 0000 | 040 | 32 | 0x20 | (space) | Space |
| 0010 0001 | 041 | 33 | 0x21 | ! | exclamation mark |
| 0010 0010 | 042 | 34 | 0x22 | " | Double quotes |
| 0010 0011 | 043 | 35 | 0x23 | # | Well No |
| 0010 0100 | 044 | 36 | 0x24 | $ | Dollar symbol |
| 0010 0101 | 045 | 37 | 0x25 | % | Percent sign |
| 0010 0110 | 046 | 38 | 0x26 | & | And no. |
| 0010 0111 | 047 | 39 | 0x27 | ' | Closed single quotation mark |
| 0010 1000 | 050 | 40 | 0x28 | ( | Open bracket |
| 0010 1001 | 051 | 41 | 0x29 | ) | close-quote |
| 0010 1010 | 052 | 42 | 0x2A | * | asterisk |
| 0010 1011 | 053 | 43 | 0x2B | + | plus |
| 0010 1100 | 054 | 44 | 0x2C | , | comma |
| 0010 1101 | 055 | 45 | 0x2D | - | minus sign / Dashes |
| 0010 1110 | 056 | 46 | 0x2E | . | Full stop |
| 0010 1111 | 057 | 47 | 0x2F | / | Slash |
| 0011 0000 | 060 | 48 | 0x30 | 0 | character 0 |
| 0011 0001 | 061 | 49 | 0x31 | 1 | character 1 |
| 0011 0010 | 062 | 50 | 0x32 | 2 | character 2 |
| 0011 0011 | 063 | 51 | 0x33 | 3 | character 3 |
| 0011 0100 | 064 | 52 | 0x34 | 4 | character 4 |
| 0011 0101 | 065 | 53 | 0x35 | 5 | character 5 |
| 0011 0110 | 066 | 54 | 0x36 | 6 | character 6 |
| 0011 0111 | 067 | 55 | 0x37 | 7 | character 7 |
| 0011 1000 | 070 | 56 | 0x38 | 8 | character 8 |
| 0011 1001 | 071 | 57 | 0x39 | 9 | character 9 |
| 0011 1010 | 072 | 58 | 0x3A | : | The colon |
| 0011 1011 | 073 | 59 | 0x3B | ; | A semicolon |
| 0011 1100 | 074 | 60 | 0x3C | < | Less than |
| 0011 1101 | 075 | 61 | 0x3D | = | Equal sign |
| 0011 1110 | 076 | 62 | 0x3E | > | Greater than |
| 0011 1111 | 077 | 63 | 0x3F | ? | question mark |
| 0100 0000 | 0100 | 64 | 0x40 | @ | Email symbol |
| 0100 0001 | 0101 | 65 | 0x41 | A | Capital A |
| 0100 0010 | 0102 | 66 | 0x42 | B | Capital B |
| 0100 0011 | 0103 | 67 | 0x43 | C | Capital C |
| 0100 0100 | 0104 | 68 | 0x44 | D | Capital D |
| 0100 0101 | 0105 | 69 | 0x45 | E | Capital E |
| 0100 0110 | 0106 | 70 | 0x46 | F | Capital F |
| 0100 0111 | 0107 | 71 | 0x47 | G | Capital G |
| 0100 1000 | 0110 | 72 | 0x48 | H | Capital H |
| 0100 1001 | 0111 | 73 | 0x49 | I | Capital I |
| 01001010 | 0112 | 74 | 0x4A | J | Capital J |
| 0100 1011 | 0113 | 75 | 0x4B | K | Capital K |
| 0100 1100 | 0114 | 76 | 0x4C | L | Capital L |
| 0100 1101 | 0115 | 77 | 0x4D | M | Capital M |
| 0100 1110 | 0116 | 78 | 0x4E | N | Capital N |
| 0100 1111 | 0117 | 79 | 0x4F | O | Capital O |
| 0101 0000 | 0120 | 80 | 0x50 | P | Capital P |
| 0101 0001 | 0121 | 81 | 0x51 | Q | Capital Q |
| 0101 0010 | 0122 | 82 | 0x52 | R | Capital R |
| 0101 0011 | 0123 | 83 | 0x53 | S | Capital S |
| 0101 0100 | 0124 | 84 | 0x54 | T | Capital T |
| 0101 0101 | 0125 | 85 | 0x55 | U | Capital U |
| 0101 0110 | 0126 | 86 | 0x56 | V | Capital V |
| 0101 0111 | 0127 | 87 | 0x57 | W | Capital W |
| 0101 1000 | 0130 | 88 | 0x58 | X | Capital X |
| 0101 1001 | 0131 | 89 | 0x59 | Y | Capital Y |
| 0101 1010 | 0132 | 90 | 0x5A | Z | Capital Z |
| 0101 1011 | 0133 | 91 | 0x5B | [ | Square bracket |
| 0101 1100 | 0134 | 92 | 0x5C | \ | The backslash |
| 0101 1101 | 0135 | 93 | 0x5D | ] | Closed square bracket |
| 0101 1110 | 0136 | 94 | 0x5E | ^ | De character |
| 0101 1111 | 0137 | 95 | 0x5F | _ | Underline |
| 0110 0000 | 0140 | 96 | 0x60 | ` | Open quotation mark |
| 0110 0001 | 0141 | 97 | 0x61 | a | Lowercase letters a |
| 0110 0010 | 0142 | 98 | 0x62 | b | Lowercase letters b |
| 0110 0011 | 0143 | 99 | 0x63 | c | Lowercase letters c |
| 0110 0100 | 0144 | 100 | 0x64 | d | Lowercase letters d |
| 0110 0101 | 0145 | 101 | 0x65 | e | Lowercase letters e |
| 0110 0110 | 0146 | 102 | 0x66 | f | Lowercase letters f |
| 0110 0111 | 0147 | 103 | 0x67 | g | Lowercase letters g |
| 0110 1000 | 0150 | 104 | 0x68 | h | Lowercase letters h |
| 0110 1001 | 0151 | 105 | 0x69 | i | Lowercase letters i |
| 0110 1010 | 0152 | 106 | 0x6A | j | Lowercase letters j |
| 0110 1011 | 0153 | 107 | 0x6B | k | Lowercase letters k |
| 0110 1100 | 0154 | 108 | 0x6C | l | Lowercase letters l |
| 0110 1101 | 0155 | 109 | 0x6D | m | Lowercase letters m |
| 0110 1110 | 0156 | 110 | 0x6E | n | Lowercase letters n |
| 0110 1111 | 0157 | 111 | 0x6F | o | Lowercase letters o |
| 0111 0000 | 0160 | 112 | 0x70 | p | Lowercase letters p |
| 0111 0001 | 0161 | 113 | 0x71 | q | Lowercase letters q |
| 0111 0010 | 0162 | 114 | 0x72 | r | Lowercase letters r |
| 0111 0011 | 0163 | 115 | 0x73 | s | Lowercase letters s |
| 0111 0100 | 0164 | 116 | 0x74 | t | Lowercase letters t |
| 0111 0101 | 0165 | 117 | 0x75 | u | Lowercase letters u |
| 0111 0110 | 0166 | 118 | 0x76 | v | Lowercase letters v |
| 0111 0111 | 0167 | 119 | 0x77 | w | Lowercase letters w |
| 0111 1000 | 0170 | 120 | 0x78 | x | Lowercase letters x |
| 0111 1001 | 0171 | 121 | 0x79 | y | Lowercase letters y |
| 0111 1010 | 0172 | 122 | 0x7A | z | Lowercase letters z |
| 0111 1011 | 0173 | 123 | 0x7B | { | Flowering bracket |
| 0111 1100 | 0174 | 124 | 0x7C | | | vertical |
| 0111 1101 | 0175 | 125 | 0x7D | } | Closed curly bracket |
| 0111 1110 | 0176 | 126 | 0x7E | ~ | The waves, |
| 0111 1111 | 0177 | 127 | 0x7F | DEL (delete) | Delete |
The character conversion tool uses
Chinese translation reference :


LVGL Add a new font
You need to change the font C The file is contained in LVGL In the project !
Declare the font in the file
LV_FONT_DECLARE(my_font_name); // Official documents give this
extern lv_font_t my_font_name;To make fonts globally available ( Such as built-in Font ), Please add them to lv_conf.h Of LV_FONT_CUSTOM_DECLARE
Set the font in the style
lv_style_set_text_font(&style_obj, &my_font_name); // Ordinary ( share ) style
lv_obj_set_style_text_font(label, &my_font_name, 0); // private ( Local ) style
And a little bit more :utf-8 Is based on unicode A byte saving encoding of encoding .
We also need to refuel today !
边栏推荐
- 【LVGL(6)】显示中文设置,制作中文字库
- These 10 kinds of timed tasks have been learned, and you can float directly
- Introduction, architecture and principle of kubernetes
- [small object velocimeter] only principle, no code
- SSH Remote Access and control
- Take you to understand the inventory deduction principle of MySQL database
- 深入了解MySQL 两把锁啥时候用(表锁,行锁)
- JMeter distributed pressure measurement
- Detailed analysis of the process (life cycle) of class loading
- Kubernetes rapid installation
猜你喜欢

FTP服务与实验

DNS域名解析服务

oss授权单个bucket权限

【LVGL(5)】标签的(label)用法

Mac解决 Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)问题

sql server 同步数据库 跨网段无公网ip几个常见小问题问题

Learn more about when to use MySQL two locks (table lock and row lock)

System safety and Application

我有 7种 实现web实时消息推送的方案,7种!
![[small object velocimeter] only principle, no code](/img/df/b8a94d93d4088ebe8d306945fd9511.png)
[small object velocimeter] only principle, no code
随机推荐
These 10 kinds of timed tasks have been learned, and you can float directly
JS - calculate the side length and angle of a right triangle
Special effects - click the mouse and the randomly set text will appear
CentOS operating system security reinforcement
Install agent and proxy using custom ZABBIX package (version 4.0.5)
【LVGL(重要)】样式属性API函数及其参数
Several common problems of SQL server synchronization database without public IP across network segments
NFS共享服务及实验
【小型物体测速仪】只有原理,无代码
DNS domain name resolution service
Combination of grep and regular
HashSet转数组
【ESP8266点焊机】基于 ESP8266 for Arduino
Solution: exit status 1 and exit status 145 appear when the console uses NVM to control the node version
DNS域名解析服务
Backup MySQL database with bat script under Windows
今天聊赖数据库MySQL底层架构设计,你了解多少?
xxl执行节点错误日志刷屏
Special effects - return to the top (kitten effects)
我有 7种 实现web实时消息推送的方案,7种!