• 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: AV to LVDS Raspberry Pi 4B/5 Industrial UART 2CH RS485 RS232 CAN FD HAT With Case For Installation of guide rails and hanging Raspberry Pi 5 LIR2032 Raspberry Pi OpenWrt Tutorial 2 Jetson Nano Case Core3566002032 Raspberry Pi Pico 2 RP2350 2 inch LCD Capacitive TouchScreen Development Board 240x320 Display QMI8658 6-Axis /OV5640 Camera /SD /Battery Port NanoKVM-Lite-Quick-Start Raspberry Pi 5 0.85inch LCD ESP32-P4 ESP32-C6 Development Board RISC-V WiFi6 MIPI CSI Camera 7/10.1 inch DSI Display /RJ45 Ethernet /Mic /Audio Size Compatible with Raspberry Pi RP2040 Sipeed NanoCluster Mini Cluster Board mini data center For Raspberry Pi CM45 / Computer /LM3H /M4N Computer GPUCPU Monitor Screen Jetson WiFi Wireless ESP32 DDSM Motor Driver HAT For Direct Drive Servo Hub Motors For Raspberry Pi Rasberry Pi 5 PCIe TO MiniPCIe 4G Gigabit Ethernet RJ45 USB HUB HAT+ SIM7600G-H/EG25-G 8.8inch LCD 1920x480 Computer PC Monitor Display Secondary Screen TypeC USB CPU RAM VGA to TTL ESP32-S3 1.28inch Round LCD Display Screen Module Development Board GC9A01A QMI8658A With Case