A character rendering method based on hierarchical interpolation algorithm

The character rendering method using hierarchical interpolation algorithm solves the problems of high processor load and large storage space in airborne cockpit display systems, achieving high-efficiency rendering performance and quality, and is suitable for display devices with low processor performance.

CN116258120BActive Publication Date: 2025-12-19CHINESE AERONAUTICAL RADIO ELECTRONICS RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310120472.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2025-12-19
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

In existing airborne cockpit display systems, character rendering methods suffer from high processor load or large storage space requirements, especially in small-screen devices with low processor performance, resulting in poor display quality and insufficient flexibility.

Method used

A character rendering method based on hierarchical interpolation algorithm is adopted. By determining the character information data structure and hierarchical font size, the GPU's graphics API is used to perform texture linear interpolation to achieve character rendering of various font sizes, reducing processor load and storage space requirements.

Benefits of technology

While reducing processor load and storage space, it improves the flexibility of character rendering and display quality, supports rotation and scaling operations, and is suitable for display devices with low processor performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116258120B_ABST
    Figure CN116258120B_ABST
Patent Text Reader

Abstract

The application discloses a character rendering method based on a hierarchical interpolation algorithm, comprising the following steps: first, determining a character information data structure; second, determining hierarchical font sizes and linear relationships; third, analyzing a TrueType file to generate a corresponding character information data structure; fourth, firstly, selecting the nearest hierarchical font size according to the font size of the rendered character, secondly, calculating the character measurement information of the font size according to the linear relationship and the hierarchical font size determined in the second step, and thirdly, performing corresponding scaling on the glyph through the glyph of the hierarchical font size mi; finally, using the texture linear interpolation of a graphic API such as OpenGL / OpenGL ES / DirectX / Metal / Vulkan of a GPU to finally render the glyph of the font size. The application can guarantee high rendering performance and quality, and reduce the occupation of storage space.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of avionics, and relates to a character rendering method, in particular to a character rendering method based on a hierarchical interpolation algorithm. BACKGROUND

[0002] With the continuous complication of the cockpit display system of military and civilian aircraft, the continuous increase of functions, and the application of large-screen displays, the content displayed is becoming richer and richer, the types are becoming more and more, and the characters of display information and communication texts are growing explosively. At this time, the effect and performance of character rendering are becoming increasingly important.

[0003] The current character processing in the airborne cockpit display system mainly falls into two categories:

[0004] The first category is for high-performance large-screen display devices, and most of them use a vector font rendering method, that is, a TrueType format font file. The display device needs to calculate a large amount of Bezier curve information in real time to parse the glyph and layout information. This kind of rendering method has high quality and high precision, high flexibility, and can be applied to various geometric transformations, and accordingly has a very high requirement on the processor processing capacity of the display device.

[0005] The second category is for small-screen traditional display devices, and most of them use a dot matrix font rendering method. This kind of rendering method is quite demanding on the application scene: it needs to determine the font type, font size, character content, etc. to generate the corresponding dot matrix font library file in advance, does not support flexible changes, and has certain requirements on the storage space. Moreover, scaling will directly affect the display effect of the characters, and even serious jaggy phenomenon will occur. Of course, the requirement on the processor processing capacity of the display device is not so high. SUMMARY

[0006] The present application aims to provide a character rendering method based on a hierarchical interpolation algorithm, which utilizes the linear scaling characteristics of characters and realizes the rendering of characters of multiple font sizes through character information of hierarchical font sizes (including but not limited to glyph and layout information). This method can greatly reduce the storage space of character information and improve the flexibility of character rendering.

[0007] The present application achieves the above-mentioned purpose by the following technical solutions:

[0008] A character rendering method based on a hierarchical interpolation algorithm, comprising:

[0009] Firstly, a character information data structure is determined, which includes but is not limited to glyph data and layout information data, and the layout information data includes character width, character height, step distance, character left offset, and character top offset;

[0010] Second step, according to the actual use scene to determine the minimum font size and the maximum font size, parse the character metric information from the minimum font size to the maximum font size, and record the corresponding linear relationship as k; according to the display accuracy or quality of the required character, select the appropriate hierarchical font size interval, and determine the hierarchical font size as mi;

[0011] Third step, according to the hierarchical font size determined in the second step, parse the TrueType file to generate the character information data structure determined in the first step;

[0012] Fourth step, first, select the nearest hierarchical font size mi according to the font size m of the rendered character; second, calculate the character metric information of the font size m according to the linear relationship and the hierarchical font size determined in the second step, and the glyph is scaled through the glyph of the hierarchical font size mi; finally, use the texture linear interpolation of the graphic API of the GPU, such as OpenGL / OpenGL ES / DirectX / Metal / Vulkan, to finally render the glyph of the font size m.

[0013] The beneficial effects of the present application are:

[0014] Compared with the two character rendering methods of the airborne cockpit display system, first, compared with the vector character rendering method, the present application can greatly reduce the load of the display device processor, and has superior rendering performance under the same conditions. Second, compared with the traditional dot matrix character rendering method, the present application can greatly reduce the storage space of the font library file, and support rotation and scaling operation, and the display quality and effect are greatly improved than the dot matrix character.

[0015] The present application can be well applied to the airborne cockpit or automobile cockpit display system, especially suitable for display devices with low processor performance, which can not only ensure high rendering performance and quality, but also reduce the occupation of storage space. The present application has significant market prospect and economic benefit. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 It is a character layout information schematic diagram.

[0017] Figure 2 It is a character information statistical trend graph of different font sizes.

[0018] Figure 3 It is a character rendering process schematic diagram based on hierarchical interpolation algorithm. DETAILED DESCRIPTION

[0019] The present application will be further described in detail below in combination with the drawings and embodiments.

[0020] Reference Figure 3As shown, the character rendering method based on the hierarchical interpolation algorithm provided in the embodiment can be applied to any development field of graphic display which has the demand of character rendering. The 28, 42 and 60 font sizes are selected to realize the rendering of 18-72 font sizes. Taking the commonly used simhei.ttf font in the display device as an example, the character rendering method can include:

[0021] First, determine the character information data structure. The character information data structure includes but is not limited to glyph data and layout information data. The glyph data is mainly the bitmap information of the font; the layout information is mainly the unicode code corresponding to the character, the character width, the character height, the step distance, the character left offset, the character top offset, etc., such as Figure 1 As shown. The character information data structure is sufficient to meet the demand of character rendering and layout.

[0022] Second, determine the hierarchical font size of the hierarchical interpolation algorithm. According to the minimum font size (denoted as minFontSize below) and the maximum font size (denoted as maxFontSize below) determined according to the actual use scene, the character metric information such as character width and character height from minFontSize font size to maxFontSize font size is parsed. As can be seen from the character information statistical trend chart of Figure 2 With the change of font size, the character metric information is linearly changed, and the corresponding linear relationship is recorded as k. However, due to the fact that the scaling multiple of the character glyph (i.e. bitmap) is too large, the character will be blurred or jagged, so it is necessary to select a suitable hierarchical font size interval according to the display accuracy or quality of the required character. The smaller the interval, the higher the accuracy, but of course the storage space occupied will be larger. For example, according to the actual measurement, we generally select an interval of 1.5 times, so the hierarchical font sizes are determined as 28, 42 and 60 to realize the rendering of 18-72 continuous font sizes commonly used in the machine. The hierarchical font sizes determined in this step are denoted as m1, m2, …, mi, ….

[0023] Third, according to the hierarchical font size determined in the second step, the TrueType file is parsed to generate the character information data structure determined in the first step, and stored as a file or other format carrier. The TrueType file is generally parsed by using the open source FreeType engine software or custom software to parse the simhei.ttf file, obtain the ASCII code of the 28, 42 and 60 font, and store the character information of the first-level Chinese characters and the second-level Chinese characters as binary files simhei_28.dat, simhei_42.dat and simhei_60.dat.

[0024] Fourth, render the character. First, select the appropriate hierarchical font size according to the font size m of the rendered character, the hierarchical font sizes determined in the second step are m1, m2, …, mi, …, judge which hierarchical font size mi is closest to m, and select which hierarchical font size mi, such as 18-35 font size using 28 font to interpolate rendering, 36-51 font size using 42 font to interpolate rendering, 52-72 font size using 60 font to interpolate rendering; second, according to the linear relationship and hierarchical font size determined in the second step, calculate the character metric information (width, height, step distance, left offset and top offset) of the font size m, and the glyph is scaled through the glyph of the hierarchical font size mi; finally, the glyph information uses 28, 42 and 60 glyphs respectively, and uses the texture linear interpolation of the graphic API of the GPU such as OpenGL / OpenGL ES / DirectX / Metal / Vulkan to finally render the glyph of 18-72 font.

[0025] Fifth, the character rendering based on the hierarchical interpolation algorithm ends.

[0026] It can be understood that for those skilled in the art, equivalent replacements or changes can be made according to the technical solutions and inventive concepts of the present application, and all such changes or replacements shall belong to the protection scope of the claims appended to the present application.

Claims

1. A method for character rendering based on a hierarchical interpolation algorithm, characterized in that The method comprises the following steps: Firstly, a character information data structure is determined, which comprises glyph data and layout information data, the layout information data comprising Unicode encoding, character width, character height, step distance, character left offset and character top offset, and the glyph data being bitmap information of a font; Secondly, a minimum font size and a maximum font size are determined according to an actual use scenario, character metric information from the minimum font size to the maximum font size is parsed, and a corresponding linear relationship is recorded as k; a suitable interval of classified font sizes is selected according to display precision or quality of a required character, and the classified font sizes are determined as mi; the character metric information comprises character width, character height, step distance, character left offset and character top offset; Thirdly, the TrueType file is parsed to generate the character information data structure determined in the first step according to the classified font sizes determined in the second step; Fourthly, firstly, the nearest classified font size mi is selected according to a font size m of a rendered character; secondly, character metric information of the font size m is calculated according to the linear relationship and the classified font sizes determined in the second step, and glyph data is scaled through glyph data of the classified font size mi; finally, the glyph of the font size m is finally rendered by using texture linear interpolation of a graphics API of a GPU.

Citation Information

Patent Citations

  • Word stock vein data management method

    CN106776500A

  • Font rendering method and device and computer readable storage medium

    CN111221597A