• 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: Digital Photo ESP32-S3 Smart 86 Box Development Board with 4 inch 480x480 Display Touch Screen For AI and DeepSeek ESP32 C3 MINI TV Raspberry Pi 5 PCIe to 2.5G Ethernet Adapter Board Plug and Play NVIDIA Jetson Orin Nano Developer Kit Official Original 8GB AI 40Tops For Embedded and Edge Systems Sensor PC Monitor Screen USB Binocular Camera 2MP OS02G10 Distortion Free Binocular Synchronous Frame USB 2.0 Plug and Play Industrial Modbus RTU 8 ch Relay Module Raspberry Pi 5 Camera User Guide Power Manager Module Raspberry Pi 15.6 inch QLED Quantum Dot Display 1920x1080 Capacitive Touchscreen For Computer PC/Jetson/Game $167.99 ESP32-S3FH4R2 Raspberry Pi 5 Audio Raspberry Pi Mipi Industrial USB TO 8CH TTL Converter USB to UART Multi Protection Circuits Multi Systems RP2040-Keyboard-3 X1015 Raspberry Pi 5 PCIe to M.2 Key-M NVMe SSD Board Pi5 2280 FLASH File System Operation ESP32-S3 QMI8658A