• 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: Spotpear Core3566004032 Mini TV NVIDIA Jetson Orin Nano 4/8GB AI 20/40Tops Lower Power Autonomous Machines Raspberry Pi Arduino Thermal imaging Industrial Isolated 4CH RS485 TO POE ETH (B) RJ45 Converter UART For Modbus Raspberry Pi USB Global Shutter Camera 1MP OV9281 120fps Black/White 120fps also For Jeston RDK DeepSeek XiaoZhi AI Voice Chat Robot BOX ESP32-S3 Development Board 3.5 inch LCD N16R8 Touchscreen Display 6-Axis /Camera /SD 2.13inch e Paper HAT+ Black-White 250x122 E-Ink For Raspberry Pi /Jetson Nano /Sunrise X3 Pi /Pwnago Raspberry Pi 5 PD Power RS485 TO ETH (B) Connect Alibaba Cloud And EMQX ESP32 S3 R8 MP3 Board 2.8inch LCD TouchScreen Display Speaker/SD-Card/Battery/QMI8658-6-Axis-Sensor Raspberry Pi 5 Official Original AI Kit Hailo8l 13Tops/26Tops PCIe M.2 HAT+ Board For Pi5 Raspberry Pi OpenWrt Tutorial 2 LuckFox SC3336 Raspberry Pi Sipeed SLogic 4IN1 USB Logic Analyzer 80M / DAPLink / CKLink Debugger Tool / UART Module SpotPear Raspberry Pi Pico