• 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 HQ Camera Official Original High Quality For M12 Lenses 12.3MP IMX477 Sensor Round Rotary LCD touch screen 1.28inch 1.6inch 2.1inch Knob central control lighting LCD RP2040 Argon Neo 5 Computer Secondary Screen Raspberry Pi 5 Power Raspberry Pi 4B DeepSeek AI Voice Chat ESP32 S3 Development Board 2.06-inch AMOLED Display 410×502 2.06inch TouchScreen Programmable Watch Raspberry Pi IR Thermal Imagi Industrial 4-ch PWM RS485 pulse output module Modbus RTU rail Raspberry Pi IR Array Thermal Imaging Camera Far infrared 80×62 Pixels 45/90 Degree FOV Raspberry Pi 4/5 UPS Uninterruptible Power Supply HAT Lithium Battery Module D-Robotics RDK X3 Module Core MD Module Horizon Sunrise Pi ARM Cortex-A53 5Tops Size Compatible With Raspberry Pi CM4 Size Raspberry Pi PCM5122 I2S DAC HIFI Sound Card DAC Audio expansion Board Free-Driver For PI5/PI4/Zero 3.52 inch e-Paper HAT B E Ink Red/Black/White 360x240 Screen Display For Arduino /Raspberry Pi /Jetson Nano /STM32 Arduino MLX90641 LuckFox Raspberry Pi 5 Raspberry-Pi-1.54inch-LCD-Display-Touchscreen-configuration-Bookworm-Lite For Pi5 1.69inch LCD TouchScreen Display 240×280 ST7789 Arduino Raspberry Pi ESP32S3 Pico STM32