When I was young, I was particularly curious about how LCDs display the content you want. I remember researching it for a while, but at that time, resources were limited. It wasn’t until college that I learned a bit about dot matrices, ASCII codes, etc.
LCD screens are common display devices in embedded systems. So how can we display Chinese characters and English on an LCD? What are the differences between vector fonts and dot matrix fonts? Why are there multiple encodings for the same character? What do GB2312 and GB18030 refer to? Are they related? How do embedded devices support multiple languages? Where do they obtain font libraries? Do they require payment?
We will address these questions one by one in the following content!
1. How to Display Characters on an LCD
How do we display characters on an LCD? Here we are discussing the logical issues, not the LCD controller driver.
First, we need to have a concept of LCD:An LCD is essentially a matrix made up of dots, just like a single LED.
A monochrome LED can display on and off.
Arranging many LEDs in a line can create a running light effect..
A matrix of multiple rows of LEDs is what? It is an LED dot matrix..
Multiple dot matrices can form a graphic display..
If it is a graphic display made of tricolor LEDs, it can display video animations..


Whether it is a <span>COG LCD</span>
, <span>OLED LCD</span>
, or <span>TFT LCD</span>
, they are all essentially matrices made up of dots, just like a graphic display made of LEDs.
Of course, the manufacturing processes are different, and the technologies for controlling the display content are also different. We will not discuss manufacturing technology here; control technology will be covered in a separate course later.
Clearly, to display characters on a graphic display, we only need to light up the corresponding LED dots. Which LEDs should be lit for different characters?
Let’s think in reverse: how do we save the position information of the Chinese characters displayed on the LED dot matrix in the code for future use?

This is a 16×16 LED dot matrix.
The state of each LED is simply on or off, so we can use 1 bit to represent its state: 1 for on, 0 for off.
1 byte, which is 8 bits, can represent the state of one row of LEDs.
The first row of the character “德” can be represented as follows: 0001 0000 0100 0000; which is 0x10, 0x40;
Using this method, we can obtain the complete display information for the character “德”:
-
0001 0000 0100 0000 0x10 0x40
-
0001 0000 0100 0000 0x10 0x40
-
0010 1111 1111 1110 0x2F 0xFE
-
0100 0000 0100 0000 0x40 0x40
-
1001 0111 1111 1100 0x97 0xFC
-
0001 0100 1010 0100 0x14 0xA4
-
0010 0100 1010 0100 0x24 0xA4
-
0110 0111 1111 1100 0x67 0xFC
-
1010 0000 0000 0000 0xA0 0x00
-
0010 1111 1111 1110 0x2F 0xFE
-
0010 0000 0100 0000 0x20 0x40
-
0010 0000 0010 0100 0x20 0x24
-
0010 0101 0010 0010 0x25 0x22
-
0010 0101 0000 1010 0x25 0x05
-
0010 1001 0000 1000 0x29 0x08
-
0010 0000 1111 1000 0x20 0xF8
We can save this information in an array as follows:
de_dot[32]={
0x10, 0x40, 0x10, 0x40,0x2f, 0xfe, 0x40, 0x40,
0x97, 0xfc, 0x14, 0xa4,0x24, 0xa4,0x67, 0xfc,
0xa0, 0x00,0x2f, 0xfe,0x20, 0x40,0x20, 0x24,
0x25, 0x22, 0x25, 0x05, 0x29, 0x08, 0x20, 0xf8};
With this array, we can restore the information to the LED dot matrix in the code using a modulus method to display the character “德”.
Friends who have played with 7-segment displays should be familiar with this. To display numbers on a 7-segment display, we define the display masks for numbers 0-9 in the code (the information for each segment being on or off). Displaying Chinese characters on a dot matrix is just a matter of having more LEDs.
Therefore, to display characters on an LCD, we first need to know how to depict the character information and then restore this information to the LCD using the modulus method to depict the character.
2. Dot Matrix Font Library
So what is a dot matrix font library?
The array of depiction information for the character “德” mentioned above is the dot matrix font library.
The effect depicted by this character “德” is known as dot matrix font. The form in which the depiction information is stored is called dot matrix font library.

Dot matrix font libraries come in various forms:
- 1. Directly saving the information in an array in the code. (This is usually done when the displayed content is limited.)
- 2. Depicting the dot matrix information in a BMP image and retrieving information from the image based on an information file (FNT) when needed. (Many games use this type of texture font, also known as bmpfont.)
- 3. Packing a bunch of dot matrix information arrays into a bin file and using algorithms to locate character positions. (When there are many dot matrices, they are integrated according to encoding specifications.)
- 4. Fonts integrated according to computer font specifications. (For example, Windows TTF fonts, BDF fonts.)
3. Modulus Method
The modulus method refers to the way individual bit position information is combined into bytes.
Earlier, when we obtained the position information for the character “德”:we used horizontal modulus with the high bits first. There are many different modulus methods, and common methods are as follows:

Sizes
Chinese characters typically come in these sizes:<span>12x12, 16x16, 24x24</span>
. On a COG screen with 128*64 pixels, 12×12 dot matrices are generally used, allowing for 5 lines of display.
The dot matrix for ASCII codes usually matches the height of Chinese characters, with the width being half. For example, 12×12 Chinese characters are paired with 12×6 ASCII codes, and 16×16 Chinese characters are paired with 16×8 ASCII codes.
4. Vector Fonts
Vector Fonts: In vector fonts, each glyph is described using mathematical curves, containing key points on the glyph’s boundary, derivative information for the lines, etc. The font rendering engine reads these mathematical vectors and performs certain mathematical operations to render the font.
The advantage of this type of font is that the actual size of the font can be scaled arbitrarily without distortion or color change. Vector fonts mainly include Type1, TrueType, OpenType, and others.
FreeType: The FreeType library is a completely free (open-source), high-quality, and portable font engine that provides a unified interface to access various font format files, including TrueType, OpenType, Type1, CID, CFF, Windows FON/FNT, X11 PCF, etc.
- Vector fonts rendered using FreeType ultimately result in bitmaps, after all, an LCD is made up of individual dots.
- Theoretically, vector fonts can be scaled infinitely without distortion.
- However, rendering vector fonts at smaller sizes may lead to significant distortion for certain characters (especially those with many strokes).
5. Character Encoding
Character encoding refers to a mapping rule that allows a character to be mapped to other forms of data for storage and transmission in computers.

ASCII Code
ASCII (American Standard Code for Information Interchange) is a computer coding system based on Latin letters, primarily used to display modern English and other Western European languages.
It is the most universal information exchange standard and is equivalent to the international standard ISO/IEC 646. ASCII was first published as a normative standard in 1967, with the last update in 1986, defining a total of 128 characters.
Codepage
Many languages in Europe and America are not defined in ASCII, so various countries (or organizations) use the remaining 127 values of 1 byte to map the characters they need.
With many countries and definitions, how do we decide which mapping to use?
IBM, Microsoft, and other systems introduced the concept of CodePage: each mapping is assigned a number. The code page numbers of these systems are not completely the same. The code defined by IBM is called OEM, while the code defined by Microsoft is called ANSI.

6. Chinese Character Encoding
There are many Chinese characters, and simply using the high 127 values cannot represent them.
Therefore, national standard organizations have defined the “Character Set for Information Exchange Using Chinese Characters” with three versions:
GB2312 Encoding: The national standard for simplified Chinese character encoding released on May 1, 1981. GB2312 uses double-byte encoding for Chinese characters, including 7445 graphic characters, of which 6763 are Chinese characters.
GBK Encoding: The national standard for Chinese character encoding released in December 1995, which is an extension of GB2312 encoding, using double-byte encoding for Chinese characters. The GBK character set includes 21003 Chinese characters, covering all Chinese characters in the national standard GB13000-1, as well as all characters in the BIG5 encoding.
GB18030 Encoding: The national standard for Chinese character encoding released on March 17, 2000, which is an extension of GBK encoding, covering Chinese, Japanese, Korean, and Chinese minority languages, including 27484 Chinese characters. The GB18030 character set uses single-byte, double-byte, and four-byte encoding methods. It is compatible with the GBK and GB2312 character sets.
Chinese character encoding uses a partitioning concept, as shown in the partitioning below, where the double-byte area two conforms to the GB2312 standard.

7. How to Obtain Font Libraries
Before introducing how to obtain font libraries, let’s clarify the copyright issue.
- Copyright refers to the font, which is the effect of depicting a character. The formation of a font is usually either a vector font or a dot matrix font library.
- If a tool converts a vector font library of one font into a dot matrix font library, they are still the same font, and the copyright remains with the vector font owner.
Obtaining Vector Fonts
There are many fonts on your computer.<span>windows</span>
stores the fonts you have installed in <span>C:\Windows\Fonts</span>
, and these fonts are usually in TTF format.
These fonts are generally not open-source, meaning they cannot be used commercially for embedded devices without permission. Open-source fonts include: Source Han Sans, which can be used commercially for free.

8. Obtaining Dot Matrix Fonts
We are more concerned with how to obtain dot matrix fonts.
As mentioned earlier, dot matrix fonts exist in many forms, so we have many ways to obtain them.
-
Obtain dot matrix font libraries from old computer Chinese cards. This method is relatively hard to find; some foreign dot matrix font libraries can be found on GitHub, but I haven’t found any for Chinese characters.
-
Obtain Chinese dot matrix fonts from DOS systems. I have used dot matrices like HZ1616 and HZ1212. The copyright of these fonts is not very clear. However, since these font libraries are quite old, they generally conform to the GB2312 standard and do not include rare characters.
-
Find dot matrix fonts from computer fonts. Common computer fonts are in TTF format, which represents that they only have vector fonts. Many computer fonts may include both vector and dot matrix fonts. Dot matrix fonts are usually smaller fonts. Small fonts rendered with vector fonts may not look good, so certain fonts usually come with small dot matrix fonts.
-
Use modulus tools to extract dot matrix information. If the characters used are few, tools like “zimo3” can be used.
-
Use dot matrix generation tools for batch generation. For example, the “Font Library Production Software.rar” created by Yimu Yu Software Studio can batch convert vector font libraries into dot matrix font libraries.
-
Find foreign dot matrix fonts from open-source modules. For example, the tslib touch library contains English dot matrices.
-
Purchase. There is a company called Qualcomm that sells dot matrix font library chips. There is also a company called Beijing Zhongyi that has a very good dot matrix font library. This font library is well-known for its performance, and experienced engineers generally have encountered it; however, most companies may not have obtained authorization. Many other font companies also have dot matrix font libraries, such as Founder.
- Manually use editing tools to draw each character and then convert them into arrays using your brain.