• 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 IR Thermal Imaging Camera Jetson Nano PWM Fan Raspberry Pi 8.8 inch DSI MIPI LCD TouchScreen Display 8.8inch 480x1920 For Luckfox Lyra RK3506/ESP32-P4/Luckfox Omni3576 7.5 inch Passive NFC e-Paper V2 BW Display 7.5inch E-ink Screen No Need Battery Wireless Powered Data Transfer For Mobile APP Raspberry Pi 5 Jetson Orin 4G/3G/2G expansion board GNSS GPS SIM7600G-H-M.2 Writing-Image User Guide Raspberry Pi 5 SSD Raspberry Pi 5 CR2032 Jetson OLED-LCD-HAT-A Arduino Thermal imaging camera Image extraction User Guide Industrial Modbus RTU RS485 4-ch Relay With isolation protection and guide rail Raspberry Pi Pico 2 RP2350B 2.41 inch AMOLED Development Board QSPI Display TouchScreen 450x600 RM690BO FT6336 QMI8658 ESP-NOW Control RS232 to RS422 Gyroscope Sipeed NanoCluster Mini Cluster Board mini data center For Raspberry Pi CM45 / Computer /LM3H /M4N Industrial USB TO RS232/485 (C) UART FT232RNL 2m For 3.3V / 5V For Switchable RS232/RS485