• 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: ADXL356BEZ 1.83inch LCD TouchScreen Display 240×280 NV3030B Arduino Raspberry Pi ESP32S3 Pico STM32 ESP32 S3 Development Board 4 inch LCD Capacitive Touch Screen 4inch Display 480×480 N16R8 Product Tutorial Catalog How to use host device Changeable Photo Frames ESP32 C6 Development Board 1.43 inch AMOLED QSPI Display 1.43inch TouchScreen Dual MIC AudioI Deepseek N16R8 HDMI to TTL Mini TOF Time-of-Flight Laser Ranging Radar Sensor Compatible RS485 with Arduino Raspberry Pi ESP32 and Pico D-Robotics RDK X3 Module Core MD Module Horizon Sunrise Pi ARM Cortex-A53 5Tops Size Compatible With Raspberry Pi CM4 Size ESP32-S3 SIM7670G 4G Development Board With Camera LTE Cat-1/4G/GNSS/GPS Global Band Portable WIFI Raspberry Pi 1.44inch LCD display HAT UGV Rover PT AI OpenCV Robot Car MediaPipe For Raspberry Pi Pan-Tilt Kit ESP32 S3 Development Board 1.9 inch LCD Capacitive Touch Screen 1.9inch Display 170×320 N16R8 Raspberry Pi Pico 2 RP2350B 1.46 inch Round LCD Touch Display 412x412 HMI LVGL QMI8658 6-axis 65K Colors Arduino 0.85inch LCD Raspberry Pi LCD Display Screen 1.3inch LCD with Game Button AND Audio Buzzer For Zero 2W / 3B / 4B / PI5 / RP2040-PiZero X1004 Raspberry Pi Pico DVI Jetson