• 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 Milk-V Duo S eMMC version firmware burning ESP32 IR Thermal Imaging Camera DDSM315 Direct Drive Servo Motor All-In-One Design Hub RS485 Motor Raspberry Pi Pico RP2040 C Environment Window 0.85inch LCD ESP32 1.9inch LCD PC U Raspberry Pi 5 inch LCD 720x1280 Capacitive TouchScreen Display HDMI For Jetson Nano/mini Computer PC X1012 Raspberry Pi 5 POE And PCIe to M.2 NVMe SSD Board Pi5 2280 Power over Ethernet RS232 to RS485 Raspberry Pi Pico 2 RP2350 ETH CH9120 TCP/UDP Ethernet Network For Arduino 15.6 inch Dual LCD Computer PC Monitor Display Double Secondary Screen Type C Mini HDMI 1080P For Windows/MacOS X1300 X1300-A2 Raspberry Pi 5 HDMI to CSI-2 Shield 1080P@60fps & Audio & Video Also Sipeed NanoKVM Cube KVM HDMI Remote OS Control Manager Install /Power Control /Remote Desktop Server UART SpotPear spotpear Gripper Serial Robotic Arm Gripper Mechanical claw Serial Bus Servo ST3215/CF35-12 Luckfox Pico ESP32-C6 LCD Development Board 1.3 inch Display 1.3inch Screen ST7789 240x240 Mini TV SD-Port QST LVGL For Arduino