• sales

    +86-0755-88291180

English Character Display Principle

let's learn how ASCII codes are displayed. The following takes the STM32 program of the 2.13-inch e-Paper HAT as an example to explain. To display characters, you must need fonts first. The files of the Fonts directory in the sample program correspond to different fonts. Open the file and you can see a bunch of data.



Each font has a structure that stores information about the font respectively. The structure includes an array pointer, font width, and font height.



The above fonts are copied from the stm32 official sample program. It is an ASCII character. Now let's explain how we make the font. The picture below is the font modulo of the "A" of Font8, we can use the font modulo software to get the data of the A character.



The font data can be got from the font modulo software which extracts the modulo of the font horizontally and vertically and displays each pixel with an array. For instance, if you want to display the "A" character, you can find the data of the "A" character and then display the font modulo point by point.



One thing to note here is the red box, the font array is stored in ASCII order, the first character is a space " ", and the data size of each character is the same. So subtract the ASCII code of the space bar from the ASCII code of A to find the starting position of the data for the character "A".


String display is to display each character.

TAG: DDSM115 Direct Drive Servo Motor All-In-One Design Hub RS485 Motor ESP32-S3 AI Voice Images Chat Robot Electronic PhotoPainter Frame E-Paper Ink Screen 7.3-inch E6 Full-Color Deepseek Development Board Raspberry Pi USB Camera 12MP IMX378 30fps onboard dual microphones Also For Jeston / RDK Raspberry Pi 5 PCIe to 4-CH PCIe FFC HAT Board Pi5 4 Channels X1006 Raspberry Pi 5 PCIe To 2.5 SATA And M.2 KEY-B 2280 SSD/HDD Double-SATA (NOT BOOT From SATA/SSD MP2.5G Raspberry Pi 5 PCIe to 2.5G Ethernet HAT Pi5 RTL8125 MPUUART Raspberry Pi 5 PCIe to ISO 2-CH RS485 /2-CH RS232 / USB /UART / TTL Raspberry Pi 0.96inch OLED RP2040-PiZero ESP32-S3 1.69inch LCD Display With QST Attitude Gyro Sensor QMI8658C For Arduino Python SpotPear Raspberry Pi Pico 2 RP2350 Core2350B Core Board PSRAM Modbus RTU Relay 32CH Raspberry Pi Pico 2 RP2350-Tiny/Tiny-Kit Super Mini Board RP2350A Writing-Image User Guide ESP32 1.44inch LCD Raspberry Pi 9.7 inch e-Paper HAT+ (E) E-Ink E6 Full color 1120x784 Screen Display For Arduino /STM32 /ESP32/Jetson Nano ESP32-C6 LCD Development Board 0.85 inch Display 0.85inch Screen 128x128 Mini SD-Port QST LVGL For Arduino ESP32-C5 1.69inch LCD For Xiaozhi AI Development Board Display 240×280 1.69 inch TouchScreen Gyroscope