• 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: Raspberry Pi 5 27W Jetson Orin Nano UGV Beast PT ROS2 AI OpenCV Robot Car MediaPipe Raspberry Pi 5inch Display ESP32-C3 1.47 inch LCD Display Development Board 1.47inch Screen SD 172×320 Jetson RTL8822CE 5GHz WiFi Wireless Bluetooth5 Card NGFF-M.2 RTL8822CE-CG Core Changeable Photo Frames RISC-V USB-CAN-B Raspberry Pi PICO LoRa-HF Pi5-Pcie-Fish-Boar MP2.5G Raspberry Pi 5 PCIe to 2.5G Ethernet HAT Pi5 RTL8125 Raspberry-Pi-GPIO-Audio-amplification-PWM-Sound-Card-Speaker-Buzzer Spotpear Arduino 0.85inch LCD Milk V Raspberry Pi Pico 2 RP2350 Core A Development Board RP2350A Raspberry Pi 13.3 inch FHD AMOLED 1080P Capacitive TouchScreen Display Type-C/HDMI For Computer PC 1.38MP Global Shutter Camera ISG1321 For Luckfox Pico Zero Raspberry Pi 5 PCIe to M.2 NVME SSD And Gigabit Ethernet RJ45 HAT RTL8111H M_KEY For 2230/2242/2260/2280 14 inch Dual LCD Computer PC Monitor Display Double Secondary Screen Type C Mini HDMI 1080P For Windows/MacOS