• 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 18.5 inch Type C/HDMI/4K Display Screen 3840×2160 Computer PC Phone Xbox/PS4/Switch ESP32-S3 Development Board 4 inch LCD TouchScreen Display 480x480 RS485 /SHT20 /Relay For Arduino LVGL 86 TVbox Raspberry Pi 4 Camera Milk V Duo IO Board Tutorial Python HTTP Request Communication UART To Ethernet ESP32 S3 4.3inch LCD (B) 800x480 Captive TouchScreen Display Board LVGL with Sensor CAN I2C RS485 Milk-V Raspberry Pi 5 Sound Card ESP32-S3 Industrial-Grade WiFi Relay IOT RS485 Communicator Bluetooth LCD Screen Driver Board Servo PWM motor WP5320 WP5335 35/20KG.CM 180° PWM digital servo double ball bearings Raspberry Pi Pico 2 RP2350 1.28 inch Round LCD Development Board 240x240 Display Screen QMI8658 6-Axis Raspberry Pi Pico 2 RP2350 bit board Size & Port high Compatible With BBC Micro:bit Raspberry Pi 5 PCIe to 4-CH PCIe FFC HAT Board Pi5 4 Channels Raspberry Pi 5 PCIe to 4 Port 2.5G Gigabit Ethernet Adapter RJ45 Ports Milk-V Duo S WIFI Configuration Raspberry Pi Pico 2 RP2350-Zero Mini Board RP2350A Spotpear ESP32 IR Thermal Imaging Camera