• 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 Pico RP2040-LCD-0.96 User Guide Raspberry Pi 3.5 inch e-Paper link (G) RYBW 384x184 For Arduino / Jetson Nano / STM32 Raspberry Pi 8 inch DSI LCD Display With 5MP Front Camera MIPI 800×480 Capacitive TouchScreen wide dynamic range ESP32 C3 LCD Development Board 1.3 inch Display Screen ST7789 240x240 3D Transparent Refractive Prism Mini TV For Arduino Milk-V Duo RJ45 Tutorial Raspberry Pi Pico RP2040 C Environment Window Raspberry Pi 5 Argon-NEO-M.2-NVME-PCIE-Expansion-Board Only For Argon NEO 5 Case (Not include) Raspberry Pi 7 inch QLED Quantum Dot Display 1024x600 Capacitive Touchscreen For Computer PC/Jetson/Game ESP32-C3FN4 Industrial RS232 to RS485 Raspberry Pi Pico 2 RP2350 Pico2 ARM Cortex-M33 And RISC-V Hazard3 520KByte 4MByte QSPI Flash Raspberry Pi Camera V2 Raspberry-Pi-Game-1.54inch-LCD-touchscreen-display-ST7789 Raspberry Pi Pico 1.54inch LCD display 240×240 IPS 1.54 inch screen Arduino Board Managers Tutorial User Guide Multi Protection Raspberry Pi DSI Scr ESP32 Thermal imaging 800×480