• 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 Screen Rockchip ESP32 C3 Raspberry Pi Pico 2 RP2350B RP2350-PiZero Development Board PSRAM DVI For HDMI Raspberry Pi UPS 1.14inch LCD ESP32-S3 2.16inch AMOLED Display AI Development Board 480×480 2.16 inch TouchScreen Deepseek RM520N GL 5G/4G/3G M.2 Moudle IoT EMBB For LTE-A/NSA/SA And GNSS For DFOTA /VoLTE For Quectel ESP32-S3 Development Board 1.47 inch LCD 1.47B Display 1.47inch Screen SD 172×320 RGB LED Pi5 Pico-DALI2 Expansion Board For ESP32 C6 S3 DALI communication control multiple LED ESP32-S3 1.28inch Round LCD Magnetic Encoder Servo Motor 35KG.CM 24V 360° RS485 High Precision And Large Torque RSBL35-24-HS Milk V Duo UART DeepSeek XiaoZhi AI Voice Chat Robot BOX ESP32-S3 Development Board 3.5 inch LCD N16R8 Touchscreen Display 6-Axis /Camera /SD ESP32 C3 Round LCD Development Board Electronic EYE 0.71 inch Display Watch Screen GC9A01 160x160 Arducam CSI-to-HDMI 树莓派Pico 2 RP2350B-Plus-W开发板WIFI官方Radio Module 2 Raspberry Pi Pico 2 RP2350 ETH CH9120 TCP/UDP Ethernet Network For Arduino USB Camera 2MP GC2093 ‌WDR Backlight Compensation‌ Onboard microphone