• 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: ESP32-S3 1.28inch Round LCD SC09 Serial UART Bus Servo Motor Switchable 2.3kg 300Angle Raspberry Pi 5 PD Induction Raspberry Pi 8 inch DSI LCD Display With 5MP Front Camera MIPI 800×480 Capacitive TouchScreen Pico-DALI2 Expansion Board For ESP32 C6 S3 DALI communication control multiple LED wide dynamic range ESP32 S3 LCD Development Board 1.3 inch Display 1.3inch Screen ST7789 240x240 Mini TV SD-Port QST QMI8658 Gyro Sensor LVGL For Arduino Raspberry Pi Pico 2 RP2350 Core A Development Board RP2350A ESP32-S3 1.28inch Computer Secondary Screen NV3030B ESP32-S3 Industrial 8-CH Relay IOT LAN WiFi /Bluetooth /RS485 /RJ45 Ethernet /POE Industrial Modbus RTU RS485 8-ch 30A High Current Relay Module (E) With Digital Input ESP32-S3 AI Camera Development Board Dual Microphone with Display Port Arducam CSI-to-HDMI Raspberry Pi 5 Serial Jetson Nano Expansion Board ESP32 S3 R8 MP3 Board 2.8inch LCD TouchScreen Display Speaker/SD-Card/Battery/QMI8658-6-Axis-Sensor Bevelopment Board Raspberry Pi