A resource-constrained embedded LCD font display method

CN122904842APending Publication Date: 2026-10-13SHENZHEN CY TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611117175.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0002]在嵌入式显示控制领域,微控制器驱动显示屏幕输出图形文本界面属于基本的数据处理范畴,为提升字符边缘的视觉平滑度,在字体数据编码与像素渲染过程中引入多级灰度抗锯齿结构,属于本领域普遍采用的技术路径;在闪存存储器与随机存取存储器容量受限的硬件架构下,现有字体数据处理范式面临数据存储体积、地址存取效率以及实时渲染吞吐量之间的原理性制约,全彩抗锯齿字库将每个像素的色彩分量直接固化于存储空间,占用大量闪存字节,且字符数据与背景色彩参数深度绑定,无法在运行时切换显示色彩样式;矢量图形解析引擎需在运行时实时提取并计算字符轮廓坐标,产生巨大的处理器指令开销,依赖较多的动态缓冲区,降低微控制器的实时响应性能

Benefits of technology

1、通过在字符映射数据结构中同步融合行字节数、实际像素宽度以及带符号偏移量,建立行对齐的数据寻址机制,数据读取阶段,寻址逻辑依据当前行号与行字节数的乘积直接定位目标行指针地址,省去逐位解析位流的时钟周期开销,渲染模块按照实际像素宽度对字节解码数据施加边界截断,并结合带符号偏移量在单次内存访问中完成图像空间坐标修正,此种结构配置使得紧凑存储的字库数据能够直接参与点阵定位与输出,有效降低数据寻址复杂度并提升多字符对齐准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122904842A_ABST
    Figure CN122904842A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of embedded system display and discloses a resource-restricted embedded LCD font display method, which comprises the following steps: constructing a font library structure containing a character mapping table and 4-bit grayscale data, establishing an integral byte row alignment boundary by filling a tail byte when the pixel width is an odd number; searching the character mapping table and calculating display physical starting coordinates; positioning a row offset addressing address according to a row data length and a row number to extract a grayscale value; restoring the bit width of a color component through integral type displacement and bitwise OR operation, generating target RGB565 color data through grayscale value and completing a non-division linear interpolation operation to write into a double buffer; and the application reduces the shift addressing delay and memory occupation through row byte alignment addressing and register bit level transformation rules, eliminates the dependence on a hardware divider, and ensures the efficient real-time stable rendering of an anti-aliasing smooth font.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded system display technology, and in particular to a method for displaying fonts on resource-constrained embedded LCDs. Background Technology

[0002] In the field of embedded display control, microcontrollers driving display screens to output graphical and textual interfaces fall under the basic category of data processing. To improve the visual smoothness of character edges, a multi-level grayscale anti-aliasing structure is introduced during font data encoding and pixel rendering, which is a commonly used technical approach in this field. Under the hardware architecture with limited flash memory and random access memory capacity, existing font data processing paradigms face fundamental constraints on data storage volume, address access efficiency, and real-time rendering throughput. Full-color anti-aliased fonts directly fix the color components of each pixel in the storage space, occupying a large number of flash memory bytes, and the character data is deeply bound to the background color parameters, making it impossible to switch display color styles at runtime. Vector graphics parsing engines need to extract and calculate character outline coordinates in real time at runtime, generating huge processor instruction overhead, relying on a lot of dynamic buffers, and reducing the real-time response performance of the microcontroller.

[0003] Expanding physical memory capacity or increasing the microcontroller's clock speed directly increases system hardware costs and power consumption, violating the original design intent of micro-embedded systems. If single-bit binary dot matrix data is used, although storage space can be reduced, the ability to achieve edge grayscale gradation and character coordinate fine-tuning is completely lost, resulting in obvious jagged edges of font strokes and positional alignment deviations when typifying multiple characters. This leads to an inherent contradiction between compact and compressed font storage, dynamic color conversion at runtime, and display rendering with low memory usage within resource-constrained hardware.

[0004] Existing technologies suffer from the following main shortcomings: 1. The font data size and dynamic color switching function are disconnected, resulting in a large storage space consumption and fixed display colors; 2. Vector graphics parsing logic consumes too many processor cycles, causing significant memory buffer overhead and response latency; 3. Traditional dot matrix data lacks a character-level coordinate offset adjustment mechanism, making it difficult to achieve precise position calibration when multiple characters are mixed in typesetting. Therefore, how to solve the problems of huge font storage overhead, inability to dynamically switch colors, and difficulty in fine alignment of multiple characters in a resource-constrained microcontroller hardware environment has become the technical problem to be solved by this invention. Summary of the Invention

[0005] This invention provides a method for displaying fonts on resource-constrained embedded LCDs, comprising the following steps: Step S1: Construct a character mapping table and the corresponding 4-bit grayscale character library data to form a character library structure. The character mapping table includes character encoding, data pointer, row data length, pixel width, pixel height, and signed position offset. When the pixel width is odd, the low-order space of the last byte of a single row stores a preset padding value to achieve whole-byte boundary alignment. Step S2: Receive the display request and extract the target character encoding and current display coordinates; locate the corresponding character library structure by searching the character mapping table based on the target character encoding; calculate the logical starting coordinates of the target display area by combining the current display coordinates and the signed position offset; Step S3: Obtain the target row number of the current pixel row. Based on the row data length, locate the row offset address by multiplying the target row number and the row data length. Read the pixel sequence corresponding to the data pointer to extract the corresponding 4-bit grayscale value. Step S4: Separate the low-bit color width components of the foreground color and background color and convert them into 8-bit channel data; use the extracted 4-bit grayscale value as a weighting factor to calculate the weighted average of the 8-bit channel data, and assemble them into 16-bit color data. Step S5: Write 16-bit color data into a double buffer containing two sets of row color buffers. While transmitting the current row color buffer data using the direct memory access channel, simultaneously render the next row of grayscale transformation color data in the other row color buffer.

[0006] Preferably, the row data length corresponds to the total number of complete bytes occupied by a single vertical row; the 4-bit grayscale font data is physically divided into half-byte segments, and the high four-bit storage space and the low four-bit storage space within a single byte independently map the grayscale information of two adjacent pixels; the grayscale information includes 16 levels of color represented by data 0x0 to data 0xF, where data 0x0 is used as the basic background color, data 0xF is used as the basic foreground color, and the remaining intermediate continuous color level values ​​are used as anti-aliasing gradient smooth transitions of the font outline edges.

[0007] Preferably, step S4 includes the following sub-steps: Step S41, from the foreground color and background color, separate the foreground 5-bit red component, background 5-bit red component, foreground 6-bit green component, background 6-bit green component, foreground 5-bit blue component, and background 5-bit blue component respectively by right shift and bitwise AND operation; Step S42, shift the foreground 5-bit red component, background 5-bit red component, foreground 5-bit blue component, and background 5-bit blue component to the left by 3 bits respectively, and perform a bitwise OR operation with their corresponding components shifted to the right by 2 bits respectively, to generate foreground 8-bit red channel data, background 8-bit red channel data, foreground 8-bit blue channel data, and background 8-bit blue channel data respectively; Step S43, shift the foreground 6-bit green component and background 6-bit green component to the left by 2 bits respectively, and perform a bitwise OR operation with their corresponding components shifted to the right by 4 bits respectively, to generate foreground 8-bit green channel data and background 8-bit green channel data respectively.

[0008] Preferably, the method adds the following sub-steps within step S4: Step S44, extracting the 4-bit grayscale value from the 4-bit grayscale font data as lossless linear interpolation coefficients; Step S45, under the condition of zero floating-point number and zero divider call, performing weighted multiplication calculations of the foreground 8-bit red channel data, foreground 8-bit green channel data, and foreground 8-bit blue channel data with the lossless linear interpolation coefficients respectively, and simultaneously performing multiplication calculations of the background 8-bit red channel data, background 8-bit green channel data, and background 8-bit blue channel data with the inverse remainder of the lossless linear interpolation coefficients, thereby obtaining the intermediate values ​​of red channel blending transition, green channel blending transition, and blue channel blending transition.

[0009] Preferably, the method adds the following sub-steps to step S4: Step S46, shift the intermediate values ​​of the red channel blending transition, the green channel blending transition, and the blue channel blending transition to the right to discard low-bit data, and compress the blended red channel data, green channel data, and blue channel data to 5-bit color space, 6-bit color space, and 5-bit color space respectively, to obtain restored 5-bit red channel data, restored 6-bit green channel data, and restored 5-bit blue channel data; Step S47, shift the restored 5-bit red channel data to the left by 11 bits, shift the restored 6-bit green channel data to the left by 5 bits, and perform a joint bitwise OR operation with the restored 5-bit blue channel data to combine and assemble 16-bit color data.

[0010] Preferably, step S5 includes the following sub-steps: Step S51, two sets of independent row color buffers of completely equal size and corresponding to the maximum pixel width of a single row are opened to form a double buffer, and a double buffer alternation switching flag is set; Step S52, within the current control cycle, when the double buffer alternation switching flag indicates that the current row color buffer in the two sets of row color buffers is locked by the direct memory access channel and a non-blocking hardware transfer is completed to the display side, the microprocessor synchronously extracts the 4-bit grayscale value of the next row from the bottom layer and converts it into 16-bit color data, and directly writes it into the other row color buffer in the two sets of row color buffers.

[0011] Preferably, the method adds the following sub-steps to step S5: Step S53, when the direct memory access channel triggers a transmission end interrupt, the hardware transmission completion flag is set in the interrupt service routine; Step S54, before the next line is rendered and the direct memory access channel is called to start data transmission, the hardware transmission completion flag is checked. If the hardware transmission completion flag is not set, the current thread is suspended and waited for. If the hardware transmission completion flag is set, the hardware transmission completion flag is cleared and physical transmission is started immediately.

[0012] Preferably, step S2 includes the following sub-steps: step S21, obtaining the target encoding stream of the text to be displayed; step S22, sequentially extracting the target encoding of a single character and matching it with the numerical values ​​of each character encoding in the character mapping table; step S23, when the matching is successful, returning the corresponding font structure index address in the character mapping table to the upper-layer font driver interface to obtain the pixel width and height range of the target character and the customized offset calibration amount.

[0013] Preferably, the processing logic for transmitting data to the display side using the direct memory access channel in step S5 is completed through an abstract callback interface; the abstract callback interface isolates the font pixel transformation rendering layer from the underlying hardware communication bus layer by defining standard function pointers, and the system completes the registration of the underlying hardware bus interface driver sending function during the initialization phase.

[0014] The beneficial effects of this invention are: 1. By synchronously integrating the number of row bytes, actual pixel width, and signed offset in the character mapping data structure, a row-aligned data addressing mechanism is established. During the data reading phase, the addressing logic directly locates the target row pointer address based on the product of the current row number and the number of row bytes, eliminating the clock cycle overhead of parsing the bit stream bit by bit. The rendering module applies boundary truncation to the byte decoding data according to the actual pixel width and completes the image space coordinate correction in a single memory access by combining the signed offset. This structural configuration enables the compactly stored character library data to directly participate in dot matrix positioning and output, effectively reducing data addressing complexity and improving the accuracy of multi-character alignment.

[0015] 2. A linear interpolation operation based on integer shift and bitwise OR assembly is adopted to dynamically convert the grayscale values ​​after single-byte splitting into full-color bitmap colors. After the algorithm extracts the components of the base color, it restores the bit width by copying the low bits and filling the high bits with bit extension logic, and completes the grayscale interpolation calculation in the integer field. Then, it uses right shift truncation and bitwise OR combination to re-synthesize into color data. This process relies entirely on basic arithmetic and logic instructions, gets rid of the dependence on floating-point operation units and full lookup table memory space, and realizes complete decoupling of font geometric bitmap data and runtime foreground and background color attributes, so that a single font library can map any color combination in real time.

[0016] 3. Based on the alternating switching mechanism of line-by-line decoding and dual buffers, a display data pipeline is established. The system only allocates dual memory buffers corresponding to the width of a single row of pixels. While the decoding unit completes the color conversion of the current row of pixels and writes it into the buffer, the hardware transmission bus synchronously moves the data of the other buffer that has been rendered to the display terminal. A display driver decoupling layer is established through an abstract callback interface. With the blocking or mutual exclusion synchronization of the transmission flag, the data processing time of the microcontroller and the bus transmission time are highly overlapped. While reducing the random access memory usage to the single-row level, the continuous and stable output of the data stream is ensured. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart of the grayscale font parsing and double-buffered color rendering process of the present invention; Figure 2 This is a state transition diagram of the hardware and software co-rendering pipeline of the present invention. Detailed Implementation

[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0020] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0021] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.

[0022] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0023] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0024] A method for displaying fonts on a resource-constrained embedded LCD includes the following steps: Step S1: Construct a character mapping table and the corresponding 4-bit grayscale character library data to form a character library structure. The character mapping table includes character encoding, data pointer, row data length, pixel width, pixel height, and signed position offset. When the pixel width is odd, the low-order space of the last byte of a single row stores a preset padding value to achieve whole-byte boundary alignment. Step S2: Receive the display request and extract the target character encoding and current display coordinates; locate the corresponding character library structure by searching the character mapping table based on the target character encoding; calculate the logical starting coordinates of the target display area by combining the current display coordinates and the signed position offset; Step S3: Obtain the target row number of the current pixel row. Based on the row data length, locate the row offset address by multiplying the target row number and the row data length. Read the pixel sequence corresponding to the data pointer to extract the corresponding 4-bit grayscale value. Step S4: Separate the low-bit color width components of the foreground color and background color and convert them into 8-bit channel data; use the extracted 4-bit grayscale value as a weighting factor to calculate the weighted average of the 8-bit channel data, and assemble them into 16-bit color data. Step S5: Write 16-bit color data into a double buffer containing two sets of row color buffers. While transmitting the current row color buffer data using the direct memory access channel, simultaneously render the next row of grayscale transformation color data in the other row color buffer.

[0025] Preferably, the row data length corresponds to the total number of complete bytes occupied by a single vertical row; the 4-bit grayscale font data is physically divided into half-byte segments, and the high four-bit storage space and the low four-bit storage space within a single byte independently map the grayscale information of two adjacent pixels; the grayscale information includes 16 levels of color represented by data 0x0 to data 0xF, where data 0x0 is used as the basic background color, data 0xF is used as the basic foreground color, and the remaining intermediate continuous color level values ​​are used as anti-aliasing gradient smooth transitions of the font outline edges.

[0026] Preferably, step S4 includes the following sub-steps: Step S41, from the foreground color and background color, separate the foreground 5-bit red component, background 5-bit red component, foreground 6-bit green component, background 6-bit green component, foreground 5-bit blue component, and background 5-bit blue component respectively by right shift and bitwise AND operation; Step S42, shift the foreground 5-bit red component, background 5-bit red component, foreground 5-bit blue component, and background 5-bit blue component to the left by 3 bits respectively, and perform a bitwise OR operation with their corresponding components shifted to the right by 2 bits respectively, to generate foreground 8-bit red channel data, background 8-bit red channel data, foreground 8-bit blue channel data, and background 8-bit blue channel data respectively; Step S43, shift the foreground 6-bit green component and background 6-bit green component to the left by 2 bits respectively, and perform a bitwise OR operation with their corresponding components shifted to the right by 4 bits respectively, to generate foreground 8-bit green channel data and background 8-bit green channel data respectively.

[0027] Preferably, the method adds the following sub-steps within step S4: Step S44, extracting the 4-bit grayscale value from the 4-bit grayscale font data as lossless linear interpolation coefficients; Step S45, under the condition of zero floating-point number and zero divider call, performing weighted multiplication calculations of the foreground 8-bit red channel data, foreground 8-bit green channel data, and foreground 8-bit blue channel data with the lossless linear interpolation coefficients respectively, and simultaneously performing multiplication calculations of the background 8-bit red channel data, background 8-bit green channel data, and background 8-bit blue channel data with the inverse remainder of the lossless linear interpolation coefficients, thereby obtaining the intermediate values ​​of red channel blending transition, green channel blending transition, and blue channel blending transition.

[0028] Preferably, the method adds the following sub-steps to step S4: Step S46, shift the intermediate values ​​of the red channel blending transition, the green channel blending transition, and the blue channel blending transition to the right to discard low-bit data, and compress the blended red channel data, green channel data, and blue channel data to 5-bit color space, 6-bit color space, and 5-bit color space respectively, to obtain restored 5-bit red channel data, restored 6-bit green channel data, and restored 5-bit blue channel data; Step S47, shift the restored 5-bit red channel data to the left by 11 bits, shift the restored 6-bit green channel data to the left by 5 bits, and perform a joint bitwise OR operation with the restored 5-bit blue channel data to combine and assemble 16-bit color data.

[0029] Preferably, step S5 includes the following sub-steps: Step S51, two sets of independent row color buffers of completely equal size and corresponding to the maximum pixel width of a single row are opened to form a double buffer, and a double buffer alternation switching flag is set; Step S52, within the current control cycle, when the double buffer alternation switching flag indicates that the current row color buffer in the two sets of row color buffers is locked by the direct memory access channel and a non-blocking hardware transfer is completed to the display side, the microprocessor synchronously extracts the 4-bit grayscale value of the next row from the bottom layer and converts it into 16-bit color data, and directly writes it into the other row color buffer in the two sets of row color buffers.

[0030] Preferably, the method adds the following sub-steps to step S5: Step S53, when the direct memory access channel triggers a transmission end interrupt, the hardware transmission completion flag is set in the interrupt service routine; Step S54, before the next line is rendered and the direct memory access channel is called to start data transmission, the hardware transmission completion flag is checked. If the hardware transmission completion flag is not set, the current thread is suspended and waited for. If the hardware transmission completion flag is set, the hardware transmission completion flag is cleared and physical transmission is started immediately.

[0031] Preferably, step S2 includes the following sub-steps: step S21, obtaining the target encoding stream of the text to be displayed; step S22, sequentially extracting the target encoding of a single character and matching it with the numerical values ​​of each character encoding in the character mapping table; step S23, when the matching is successful, returning the corresponding font structure index address in the character mapping table to the upper-layer font driver interface to obtain the pixel width and height range of the target character and the customized offset calibration amount.

[0032] Preferably, the processing logic for transmitting data to the display side using the direct memory access channel in step S5 is completed through an abstract callback interface; the abstract callback interface isolates the font pixel transformation rendering layer from the underlying hardware communication bus layer by defining standard function pointers, and the system completes the registration of the underlying hardware bus interface driver sending function during the initialization phase.

[0033] Example 1: This example combines Figures 1 to 2 This document describes a method for displaying fonts on a resource-constrained embedded LCD, such as... Figure 1 As shown, step S1 involves storing a preset padding value in the low-order space of the last byte of a single row for the character mapping table and 4-bit grayscale font data when the pixel width is odd, thus completing the font structure construction and achieving whole-byte boundary alignment. Step S2 involves locating the corresponding font structure by searching the character mapping table for the target character encoding and the current display coordinates, and calculating the logical starting coordinates of the target display area by combining the signed position offset. Step S3 involves locating the row offset address by using the product of the target row number and the row data length for the data pointer of the current pixel row, and reading the corresponding pixel sequence to extract the corresponding 4-bit grayscale value. Step S4 involves splitting the low-order color width components of the foreground color and background color into 8-bit channel data and performing a weighted average calculation using 4-bit grayscale value as a weighting factor, and finally assembling them into 16-bit color data. Step S5 involves writing the 16-bit color data into a double buffer composed of two sets of row color buffers and transmitting the current row using a direct memory access channel, while synchronously rendering the next row of grayscale transformation color data in the other row color buffer.

[0034] like Figure 2As shown, upon power-on or reset, the system enters the initialization and registration state, executing tasks such as building the character library structure, allocating double buffers, setting alternating switching flags, and registering the sending function. Upon receiving a display request, it enters the retrieval and matching state, sequentially extracting individual characters, extracting the target character encoding, retrieving the character mapping table for alignment and matching, calculating the logical starting coordinates, and returning the index address and offset calibration amount when a match is successful. It then enters the bit-width transformation and interpolation processing state, locating the line offset and reading the corresponding grayscale value, splitting the color width components and converting them into eight-bit data, performing weighted average calculation and sixteen-bit assembly, writing the color data to the buffer, and alternating switching flags indicating transport. Finally, it enters the non-blocking transmission state. The system locks the current row buffer via the memory access channel, performs non-blocking hardware transfer to the display side, writes the double buffer to another row of color buffer, triggers an end interrupt and sets the hardware transfer completion flag, and the synchronous microprocessor extracts the corresponding grayscale value of the next row from the underlying layer, then flows back to the bit width transformation and interpolation processing state. If the hardware transfer completion flag is not set, it enters a state suspension waiting state. Before the next row is rendered and before the transfer is started, if the hardware transfer completion flag is not set, the current thread is suspended and waited. If the flag is set, the flag is cleared, the physical transfer is started immediately and the next row is extracted, then the system flows back to the bit width transformation and interpolation processing state.

[0035] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for displaying fonts on resource-constrained embedded LCDs, characterized in that, Includes the following steps: Step S1: Construct a character mapping table and the corresponding 4-bit grayscale character library data to form a character library structure. The character mapping table includes character encoding, data pointer, row data length, pixel width, pixel height, and signed position offset. When the pixel width is odd, the low-order space of the last byte of a single row stores a preset padding value to achieve whole-byte boundary alignment. Step S2: Receive the display request and extract the target character encoding and current display coordinates; locate the corresponding character library structure by searching the character mapping table based on the target character encoding; calculate the logical starting coordinates of the target display area by combining the current display coordinates and the signed position offset; Step S3: Obtain the target row number of the current pixel row. Based on the row data length, locate the row offset address by multiplying the target row number and the row data length. Read the pixel sequence corresponding to the data pointer to extract the corresponding 4-bit grayscale value. Step S4: Separate the low-bit color width components of the foreground color and background color and convert them into 8-bit channel data; use the extracted 4-bit grayscale value as a weighting factor to calculate the weighted average of the 8-bit channel data, and assemble them into 16-bit color data. Step S5: Write 16-bit color data into a double buffer containing two sets of row color buffers. While transmitting the current row color buffer data using the direct memory access channel, simultaneously render the next row of grayscale transformation color data in the other row color buffer.

2. The method for displaying fonts on a resource-constrained embedded LCD according to claim 1, characterized in that, The row data length corresponds to the total number of complete bytes occupied by a single vertical row; the 4-bit grayscale font data is physically divided into half-byte segments, and the high four-bit storage space and the low four-bit storage space within a single byte independently map the grayscale information of two adjacent pixels; the grayscale information contains 16 levels of color represented by data 0x0 to data 0xF, where data 0x0 is used as the basic background color, data 0xF is used as the basic foreground color, and the remaining intermediate continuous color level values ​​are used as anti-aliasing gradient smooth transitions of the font outline edges.

3. The method for displaying fonts on a resource-constrained embedded LCD according to claim 1, characterized in that, Step S4 includes the following sub-steps: Step S41, from the foreground color and background color, separate the foreground 5-bit red component, background 5-bit red component, foreground 6-bit green component, background 6-bit green component, foreground 5-bit blue component, and background 5-bit blue component respectively through right shift and bitwise AND operation; Step S42, shift the foreground 5-bit red component, background 5-bit red component, foreground 5-bit blue component, and background 5-bit blue component to the left by 3 bits respectively, and perform a bitwise OR operation with their corresponding components shifted to the right by 2 bits respectively, to generate foreground 8-bit red channel data, background 8-bit red channel data, foreground 8-bit blue channel data, and background 8-bit blue channel data respectively; Step S43, shift the foreground 6-bit green component and background 6-bit green component to the left by 2 bits respectively, and perform a bitwise OR operation with their corresponding components shifted to the right by 4 bits respectively, to generate foreground 8-bit green channel data and background 8-bit green channel data respectively.

4. The method for displaying fonts on a resource-constrained embedded LCD according to claim 3, characterized in that, The method adds the following sub-steps within step S4: Step S44, extracting the 4-bit grayscale value from the 4-bit grayscale font data as lossless linear interpolation coefficients; Step S45, under the condition of zero floating-point number and zero divider call, performing weighted multiplication calculations on the foreground 8-bit red channel data, foreground 8-bit green channel data, and foreground 8-bit blue channel data with the lossless linear interpolation coefficients respectively, and simultaneously performing multiplication calculations on the background 8-bit red channel data, background 8-bit green channel data, and background 8-bit blue channel data with the inverse remainder of the lossless linear interpolation coefficients, to obtain the intermediate values ​​of red channel blending transition, green channel blending transition, and blue channel blending transition.

5. A method for displaying fonts on a resource-constrained embedded LCD according to claim 4, characterized in that, The method adds the following sub-steps within step S4: Step S46, shift the intermediate values ​​of the red channel blending transition, the green channel blending transition, and the blue channel blending transition to the right to discard low-bit data, and compress the blended red channel data, green channel data, and blue channel data to 5-bit color space, 6-bit color space, and 5-bit color space respectively, to obtain restored 5-bit red channel data, restored 6-bit green channel data, and restored 5-bit blue channel data; Step S47, shift the restored 5-bit red channel data to the left by 11 bits, shift the restored 6-bit green channel data to the left by 5 bits, and perform a joint bitwise OR operation with the restored 5-bit blue channel data to combine and assemble 16-bit color data.

6. A method for displaying fonts on a resource-constrained embedded LCD according to claim 1, characterized in that, Step S5 includes the following sub-steps: Step S51, create two sets of independent row color buffers of completely equal size and corresponding to the maximum pixel width of a single row to form a double buffer, and set the double buffer alternation switching flag; Step S52, within the current control cycle, when the double buffer alternation switching flag indicates that the current row color buffer in the two sets of row color buffers is locked by the direct memory access channel and completed non-blocking hardware transfer to the display side, the microprocessor synchronously extracts the 4-bit grayscale value of the next row from the bottom layer and converts it into 16-bit color data, and directly writes it into the other row color buffer in the two sets of row color buffers.

7. A method for displaying fonts on a resource-constrained embedded LCD according to claim 6, characterized in that, The method adds the following sub-steps within step S5: Step S53, when the direct memory access channel triggers a transfer completion interrupt, the hardware transfer completion flag is set in the interrupt service routine; Step S54, before the next line is rendered and the direct memory access channel is called to start data transfer, the hardware transfer completion flag is checked. If the hardware transfer completion flag is not set, the current thread is suspended and waited for. If the hardware transfer completion flag is set, the hardware transfer completion flag is cleared and physical transfer is started immediately.

8. A method for displaying fonts on a resource-constrained embedded LCD according to claim 1, characterized in that, Step S2 includes the following sub-steps: Step S21, obtain the target encoding stream of the text to be displayed; Step S22, sequentially extract the target encoding of each character and complete the numerical alignment and matching with each character encoding in the character mapping table; Step S23, when the matching is successful, return the corresponding font structure index address in the character mapping table to the upper-level font driver interface to obtain the pixel width and height range of the target character and the customized offset calibration amount.

9. A method for displaying fonts on a resource-constrained embedded LCD according to claim 1, characterized in that, The processing logic for transmitting data to the display side using the direct memory access channel in step S5 is completed through an abstract callback interface; The abstract callback interface isolates the font pixel transformation rendering layer from the underlying hardware communication bus layer by defining standard function pointers. The system completes the registration of the underlying hardware bus interface driver sending function during the initialization phase.