• 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 1.3inch LCD Raspberry Pi 5 inch DSI MIPI Display LCD (D) Capacitive TouchScreen 720x1280 Raspberry Pi Camera Case Luckfox Pico Camera User Guide ESP32 C6 Development board 1.9 inch LCD display 1.9inch Screen 172×320 With SD slot RGB LED QMI8658 6-Axis-Sensor ST7789 CST816 ESP32 1.54 inch E-Paper Smart Watch display Screen 200x200 Ultra-low power For Arduino/Micropython/RTOS For Watchy Sipeed FPGA Tang Primer 20K Dock/Lite 128M DDR3 Development Board GW2A-LV18PG256C8/I7 Raspberry Pi Pico 2 RP2350/RP2040 W5100S-EVB-Pico W6300-EVB-Pico2 Ethernet Development Board ETH RJ45 Third-party library configuration Raspberry Pi Pico 2 RP2350-One Mini Board Type-A RP2350A ESP32 S3 AI 1.75 inch Development Board with 1.75inch AMOLED Touchscreen Round Screen Deepseek Digital Input LuckFox Pico TVOC Sensor gas Sensor Expansion board UART High Sensitivity For Arduino /Raspberry Pi /Pico /ESP32 Sipeed NanoCluster Mini Cluster Board mini data center For Raspberry Pi CM45 / Computer /LM3H /M4N NanoKVM-USB Quick Start Raspberry Pi Pico HDMI ESP32 Development Board C3 1.28 inch Round Rotary LCD Smart Screen 1.28inch Knob Display 240x240 LVGL for Arduino Raspberry Pi 5 POE PCIe To M.2 E KEY NGFF WIFI7 WIFI6 For BE200/AX210/AX200/RTL8822CE Raspberry Pi 1.54inch LCD Bookworm-Desktop Display and Touch