Text display method, compilation method and related equipment
Generating static text glyph index files through compilation methods solves the problem of resource limitations when lightweight devices deal with complex languages, and achieves efficient text display and syntax compliance.
Patent Information
- Application Number
- CN202010761001.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-31
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2040-07-31
AI Technical Summary
When lightweight devices deal with complex languages, due to resource limitations, the displayed text syntax does not conform to the syntax habits of complex languages, and the user cannot recognize the language.
Provides a compilation method, which uses text resource files to shape the string of static text, generates a static text glyph index file, which contains the correspondence between the number of static text and the glyph index set, supports the use of unique glyph indexes to find glyphs, reducing the need for shaping during runtime.
Reduces power consumption of lightweight devices when displaying static text, improves support for complex languages, and ensures that the displayed text syntax meets the standards of complex languages.
Smart Images

Figure CN114065701B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal and communication technology, and in particular to a text display method, a compilation method and related equipment. Background Art
[0002] Electronic devices need to be shipped to different countries and regions and need to support multiple languages. However, different countries have different ways of processing languages. They can basically be divided into two categories: one is simple language, that is, one character corresponds to one Unicode (universal multiple octet coded, Unicode), and the characters of the text can be directly indexed and displayed through Unicode, and the language itself has no deformation, represented by Chinese, English, and French; the other is complex language, that is, one character may have multiple deformations in different sentences, one Unicode may correspond to multiple glyphs, and it is necessary to perform shaping measures such as glyph replacement or syllable replacement on the language according to the sentence or context semantics, represented by Arabic, Thai, Burmese, etc.
[0003] Currently, when processing language, rich devices with large read-only memory (ROM) and random access memory (RAM), such as electronic devices using the Android system, generally obtain vector glyphs directly through the Unicode index vector font library at runtime, and then render and fully reshape the vector glyphs to display the correct text.
[0004] However, for lightweight devices with only megabyte (MB) ROM and kilobyte (KB) RAM, such as microcontroller units (MCUs), their resource capabilities cannot support the rendering and complete shaping of vector fonts at runtime. Even if lightweight devices use dot matrix fonts: render vector fonts into dot matrix fonts during the compilation phase, so that each Unicode corresponds to a dot matrix of a character; at runtime, use Unicode to index the dot matrix font to obtain the corresponding glyph and display it. Because it cannot support complete shaping at runtime, the syntax of the text displayed when processing complex languages does not conform to the grammatical habits of the complex language, making it impossible for users who use the language to recognize the language. Summary of the invention
[0005] This application provides a text display method, a compilation method and related devices to enhance the support capabilities of lightweight devices for complex languages.
[0006] In a first aspect, the present application provides a compilation method, including: obtaining a text resource file, the text resource file including the correspondence between a text number and a text string; performing text shaping on the string of a first static text in the text resource file to obtain a first glyph index set, the text shaping being used to determine the correct glyphs corresponding to the characters in the text string; and generating a static text glyph index file including the correspondence between the number of the first static text and the first glyph index set according to the correspondence between the number of the first static text in the text resource file and the string of the first static text. The first glyph index set includes one or more unique glyph indexes, each of which has a glyph that uniquely corresponds to it.
[0007] In the above embodiment, the compilation device performs text shaping on the character string of the first static text in the text resource file, and obtains a static text glyph index file containing the correspondence between the serial number of the first static text and the first glyph index set, so that the device using the static text glyph index file can obtain the corresponding glyph index set according to the serial number of the static text. The correct glyph of the static text that has been text-shaped can be displayed by searching the glyph index type font library according to the glyph index set. It is no longer necessary to perform text shaping every time the static text is displayed, which reduces the power consumption of the device using the static text glyph index file and improves the device's ability to support complex languages using the static text glyph index file.
[0008] In combination with some embodiments of the first aspect, in some embodiments, the method further includes: converting the vector character library into a glyph index character library, wherein the glyph index character library is used to use a unique glyph index to search for a glyph that uniquely corresponds to it.
[0009] In the above embodiment, the compilation device can convert an ordinary vector font library indexed by Unicode encoding into a glyph index font library indexed by unique character index during the compilation stage, thereby supporting the use of unique glyph indexes to accurately search for corresponding glyphs. It is no longer necessary to temporarily determine which glyph of a character should be used through context and semantics, thereby improving the efficiency of finding the correct glyph.
[0010] In combination with some embodiments of the first aspect, in some embodiments, text shaping is performed on the character string of the first static text in the text resource file to obtain a first glyph index set, which specifically includes: inputting the character set encoding corresponding to the character string of the first static text into a text shaping algorithm library to obtain the first glyph index set; the text shaping algorithm library uses a first glyph index-type font library; the first glyph index set contains one or more unique glyph indexes, and each unique glyph index has a glyph uniquely corresponding to it in the first glyph index-type font library.
[0011] In the above embodiment, the text shaping algorithm library is used to perform text shaping on the character string of the first static text, thereby improving the efficiency and accuracy of the text shaping.
[0012] In combination with some embodiments of the first aspect, in some embodiments, before the step of performing text shaping on the string of the first static text in the text resource file to obtain a first glyph index set, the method also includes: extracting the first static text from the text resource file.
[0013] In the above embodiment, the compiling device may first extract the static text that meets the requirements for shaping, so as to facilitate the subsequent shaping, thereby improving the efficiency of the compiling device in shaping the static text.
[0014] In combination with some embodiments of the first aspect, in some embodiments, before the step of performing text shaping on the string of the first static text in the text resource file to obtain a first glyph index set, the method also includes: determining the string of the static text in the text resource file according to the first format character, the string of the static text containing the string of the first static text.
[0015] In the above embodiment, the compiling device can determine the static text in the text resource file according to the first format character, which is convenient and fast, and is easy for the compiling device to identify, thereby improving the efficiency of the compiling device in determining the static text.
[0016] In combination with some embodiments of the first aspect, in some embodiments, the text string in the text resource file includes text strings of multiple different languages; the first static text is a text in a complex language; the complex language is a language in which a character corresponding to a character set encoding has multiple glyphs; based on the correspondence between the number of the first static text in the text resource file and the string of the first static text, a static text glyph index file containing the correspondence between the number of the first static text and the first glyph index set is generated, specifically including: based on the correspondence between the number of the first static text in the text resource file, the language type of the first static text and the string of the first static text, a static text glyph index file containing the correspondence between the number of the first static text, the language type of the first static text and the first glyph index set is generated.
[0017] In the above embodiment, when the text resource file contains character strings of texts in multiple languages, the compilation device can only perform text shaping processing on the static text in the complex language, and generate a static text glyph index file containing the serial number of the first static text, the language type of the first static text and the correspondence between the first glyph index set. This reduces the processing burden of the compilation device and improves the support for multiple complex languages of the device that uses the static text execution index file.
[0018] In combination with some embodiments of the first aspect, in some embodiments, the text resource file is a text resource file used by a system of a lightweight device; the method also includes: storing the static text glyph index file in a system directory of the lightweight device.
[0019] In the above embodiment, the compiling device stores the static text glyph index file in the system directory of the lightweight device, so that all programs in the lightweight device can directly use the static text glyph index file, thereby improving the operating efficiency of the device using the static text glyph index file.
[0020] In combination with some embodiments of the first aspect, in some embodiments, the text resource file is a text resource file used by a first application in a lightweight device; the method also includes: storing the static text glyph index file in a directory of the first application in the lightweight device.
[0021] In the above embodiment, an application can have a static text glyph index file that is used alone, which improves the personalized setting space of the device using the static text glyph index file and also improves the freedom of the developer who develops the application.
[0022] In combination with some embodiments of the first aspect, in some embodiments, the text resource file is a text resource file obtained from a network server; the method further includes: storing the static text glyph index file in the network server.
[0023] In the above embodiment, the compilation device stores the static text glyph index file in the network server, so that devices that need to use the static text glyph index file can directly obtain it from the network server, reducing the difficulty for other developers to obtain the static text glyph index file and facilitating the sharing and use of the static text glyph index file.
[0024] In the second aspect, the embodiment of the present application provides a compilation device, which includes: an input device, an output device, a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and the processor calls the computer instructions to make the compilation device execute: obtain a text resource file, the text resource file includes the correspondence between the text number and the text string; perform text shaping on the string of the first static text in the text resource file to obtain a first glyph index set, the text shaping is used to determine the correct glyph corresponding to the character in the text string; according to the correspondence between the number of the first static text in the text resource file and the string of the first static text, generate a static text glyph index file containing the correspondence between the number of the first static text and the first glyph index set. Wherein, the first glyph index set includes one or more unique glyph indexes, and each unique glyph index has a glyph uniquely corresponding to it.
[0025] In the above embodiment, the compilation device performs text shaping on the character string of the first static text in the text resource file, and obtains a static text glyph index file containing the correspondence between the serial number of the first static text and the first glyph index set, so that the device using the static text glyph index file can obtain the corresponding glyph index set according to the serial number of the static text. The correct glyph of the static text that has been text-shaped can be displayed by searching the glyph index type font library according to the glyph index set. It is no longer necessary to perform text shaping every time the static text is displayed, which reduces the power consumption of the device using the static text glyph index file and improves the device's ability to support complex languages using the static text glyph index file.
[0026] In combination with some embodiments of the second aspect, in some embodiments, the one or more processors are further used to call the computer instructions to cause the compilation device to execute: converting the vector font library into a glyph index font library, wherein the glyph index font library is used to use a unique glyph index to find a glyph that uniquely corresponds to it.
[0027] In combination with some embodiments of the second aspect, in some embodiments, the computer instructions are specifically used to call the compilation device to execute: input the character set encoding corresponding to the string of the first static text into the text shaping algorithm library to obtain the first glyph index set; the text shaping algorithm library uses the first glyph index type font; the first glyph index set contains one or more unique glyph indexes, and each unique glyph index has a glyph uniquely corresponding to it in the first glyph index type font.
[0028] In combination with some embodiments of the second aspect, in some embodiments, the one or more processors are further used to call the computer instruction to cause the compilation device to execute: extracting the first static text from the text resource file.
[0029] In combination with some embodiments of the second aspect, in some embodiments, the one or more processors are also used to call the computer instruction to cause the compilation device to execute: determining the string of the static text in the text resource file according to the first format character, and the string of the static text contains the string of the first static text.
[0030] In combination with some embodiments of the second aspect, in some embodiments, the text string in the text resource file includes text strings in multiple different languages; the first static text is a text in a complex language; the complex language is a language in which a character corresponding to a character set encoding has multiple glyphs; the one or more processors are specifically used to call the computer instructions to enable the compilation device to execute: based on the correspondence between the number of the first static text in the text resource file, the language type of the first static text and the string of the first static text, generate a static text glyph index file containing the correspondence between the number of the first static text, the language type of the first static text and the first glyph index set.
[0031] In a third aspect, an embodiment of the present application provides a chip system, which is applied to a compilation device, and the chip system includes one or more processors, which are used to call computer instructions so that the compilation device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0032] In a fourth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when the computer program product is run on a compilation device, enables the compilation device to execute the method described in the first aspect and any possible implementation manner of the first aspect.
[0033] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the instructions are executed on a compilation device, the compilation device executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0034] It can be understood that the compilation device provided in the second aspect, the chip system provided in the third aspect, the computer program product provided in the fourth aspect, and the computer storage medium provided in the fifth aspect are all used to execute the compilation method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
[0035] In a sixth aspect, the present application provides a text display method, comprising: a lightweight device determines a first glyph index set according to a serial number of a first static text; the lightweight device uses the first glyph index set to search a glyph index-type font library to obtain a first glyph set; the glyph index-type font library is used to use a unique glyph index to search for a glyph that uniquely corresponds to it. The lightweight device displays the first glyph set.
[0036] In the above embodiment, the lightweight device can determine the corresponding first glyph index set that has been shaped using the serial number of the first static text to be displayed, and can obtain the correct first glyph set that has been shaped for the first static text by searching the glyph index font library using the first glyph index set, and can then directly display the first glyph set. The glyphs of complex languages can be correctly displayed without shaping the text of complex languages, thereby improving the lightweight device's ability to support complex languages.
[0037] In combination with some embodiments of the sixth aspect, in some embodiments, the lightweight device has only one static text glyph index file, and the static text glyph index file contains the correspondence between the number of the first static text and the first glyph index set; the lightweight device determines the first glyph index set based on the number of the first static text, specifically including: the lightweight device uses the number of the first static text to search the static text glyph index file, and determines the first glyph index set corresponding to the number of the first static text.
[0038] In the above embodiment, there is only one static text glyph index file in the lightweight device, which facilitates the lightweight device to uniformly search for the glyph index set corresponding to the number of the static text, thereby improving the efficiency of the lightweight device in determining the correct execution index set.
[0039] In combination with some embodiments of the sixth aspect, in some embodiments, the lightweight device uses the number of the first static text to search the static text glyph index file and determines the first glyph index set corresponding to the number of the first static text, specifically including: the lightweight device uses the number of the first static text to call the static text interface of the graphics engine and determine the first glyph index set corresponding to the number of the first static text.
[0040] In the above embodiment, the lightweight device can determine the first glyph index set corresponding to the serial number of the first static text by calling the static text interface of the graphics engine, and use a dedicated module to perform a dedicated function, thereby improving the execution efficiency of the lightweight device.
[0041] In combination with some embodiments of the sixth aspect, in some embodiments, there are multiple static text glyph index files in the lightweight device, and different static text glyph index files store the correspondence between different static text numbers and glyph index sets.
[0042] In the above embodiment, a plurality of static text glyph index files may be stored in the lightweight device, so that application development on the lightweight device is more flexible.
[0043] In combination with some embodiments of the sixth aspect, in some embodiments, the lightweight device determines the first glyph index set based on the number of the first static text, specifically including: the lightweight device determines that the number of the first static text belongs to the first static text glyph index file based on the numerical range planning or parameter planning of the text number; the lightweight device uses the number of the first static text to search the first static text glyph index file, and determines the first glyph index set corresponding to the number of the first static text.
[0044] In the above embodiment, the static text glyph index file to which the static text number belongs can be determined by numerical range planning or parameter planning of the text number, thereby improving the efficiency of finding the correct static text glyph index file.
[0045] In combination with some embodiments of the sixth aspect, in some embodiments, the lightweight device determines the first glyph index set based on the number of the first static text, specifically including: the lightweight device uses the number of the first static text to search each static text glyph index file, determines that the number of the first static text belongs to the first static text glyph index file, and determines the first glyph index set corresponding to the number of the first static text.
[0046] In the above embodiment, the static text glyph index file to which the static text number belongs can be determined by searching each static text glyph index file, which simplifies the steps of finding the correct static text glyph index file and reduces the complexity of the lightweight device operation process.
[0047] In combination with some embodiments of the sixth aspect, in some embodiments, the lightweight device stores a correspondence between the number of the static text and the text type parameter, and different text type parameters correspond to different static text glyph index files; the lightweight device determines the first glyph index set based on the number of the first static text, specifically including: the lightweight device determines the first parameter corresponding to the number of the first static text, and the first parameter corresponds to the first static text glyph index file; the lightweight device uses the number of the first static text to search the first static text glyph index file, and determines the first glyph index set corresponding to the number of the first static text.
[0048] In the above embodiment, the static text glyph index file to which the static text number belongs can be determined through the correspondence between the static text number and the text type parameter, thereby improving the accuracy of finding the correct static text glyph index file.
[0049] In combination with some embodiments of the sixth aspect, in some embodiments, the lightweight device uses the number of the first static text to search the first static text glyph index file to determine the first glyph index set corresponding to the number of the first static text, specifically including: the lightweight device uses the number of the first static text to call the first static text interface of the graphics engine to determine the first glyph index set corresponding to the number of the first static text; the first static text interface is a static text interface among multiple static text interfaces of the graphics engine that corresponds to the first static text glyph index file.
[0050] In the above embodiment, different static text glyph index files may correspond to different static text interfaces in the multiple static text interfaces of the graphics engine, thereby improving the efficiency of calling the static text interface in the graphics engine to find the corresponding glyph index set.
[0051] In combination with some embodiments of the sixth aspect, in some embodiments, before the step of the lightweight device determining the first glyph index set based on the number of the first static text, the method also includes: the lightweight device determines that the number of the text to be displayed is the number of the static text.
[0052] In combination with some embodiments of the sixth aspect, in some embodiments, the text to be displayed is text bound to a component to be displayed; the lightweight device displays the first glyph set, specifically including: the lightweight device displays the first glyph set in the numbered component to be displayed that is bound to the first static text.
[0053] In a seventh aspect, the present application provides a lightweight device, comprising: one or more processors, a memory and a display screen; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the lightweight device to execute: determine a first glyph index set according to the serial number of a first static text; use the first glyph index set to search a glyph index-type font library to obtain a first glyph set; the glyph index-type font library is used to use a unique glyph index to search for a glyph uniquely corresponding to it; and display the first glyph set.
[0054] In the above embodiment, the lightweight device can determine the corresponding first glyph index set that has been shaped using the serial number of the first static text to be displayed, and can obtain the correct first glyph set that has been shaped for the first static text by searching the glyph index font library using the first glyph index set, and can then directly display the first glyph set. The glyphs of complex languages can be correctly displayed without shaping the text of complex languages, thereby improving the lightweight device's ability to support complex languages.
[0055] In combination with some embodiments of the seventh aspect, in some embodiments, the lightweight device has only one static text glyph index file, and the static text glyph index file contains the correspondence between the number of the first static text and the first glyph index set; the one or more processors are specifically used to call the computer instructions to enable the lightweight device to execute: use the number of the first static text to search the static text glyph index file, and determine the first glyph index set corresponding to the number of the first static text.
[0056] In combination with some embodiments of the seventh aspect, in some embodiments, the one or more processors are specifically used to call the computer instruction to cause the lightweight device to execute: calling the static text interface of the graphics engine using the number of the first static text, and determining a first glyph index set corresponding to the number of the first static text.
[0057] In combination with some embodiments of the seventh aspect, in some embodiments, there are multiple static text glyph index files in the lightweight device, and different static text glyph index files store the correspondence between different static text numbers and each glyph index set.
[0058] In combination with some embodiments of the seventh aspect, in some embodiments, the one or more processors are specifically used to call the computer instructions to enable the lightweight device to execute: determining that the number of the first static text belongs to the first static text glyph index file based on the numerical range planning or parameter planning of the text number; using the number of the first static text to search the first static text glyph index file, and determining the first glyph index set corresponding to the number of the first static text.
[0059] In combination with some embodiments of the seventh aspect, in some embodiments, the one or more processors are specifically used to call the computer instructions to cause the electronic device to execute: use the number of the first static text to search for each static text glyph index file, determine that the number of the first static text belongs to the first static text glyph index file, and determine the first glyph index set corresponding to the number of the first static text.
[0060] In combination with some embodiments of the seventh aspect, in some embodiments, the one or more processors are specifically used to call the computer instructions to cause the electronic device to execute: calling the first static text interface of the graphics engine using the number of the first static text, and determining a first glyph index set corresponding to the number of the first static text; the first static text interface is a static text interface among multiple static text interfaces of the graphics engine that corresponds to the first static text glyph index file.
[0061] In the eighth aspect, an embodiment of the present application provides a chip system, which is applied to a lightweight device. The chip system includes one or more processors, which are used to call computer instructions so that the lightweight device executes the method described in the sixth aspect and any possible implementation method of the sixth aspect.
[0062] In a ninth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when the computer program product is run on a lightweight device, enables the lightweight device to execute the method described in the sixth aspect and any possible implementation method of the sixth aspect.
[0063] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, which, when executed on a lightweight device, enables the lightweight device to execute the method described in the sixth aspect and any possible implementation method of the sixth aspect.
[0064] It can be understood that the lightweight device provided in the seventh aspect, the chip system provided in the eighth aspect, the computer program product provided in the ninth aspect, and the computer storage medium provided in the tenth aspect are all used to execute the text display method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 is an exemplary schematic diagram of a complex language in an embodiment of the present application in which one Unicode code corresponds to multiple glyphs;
[0066] Figure 2 It is an exemplary schematic diagram of rendering a vector font library of a simple language into a dot-matrix font library of a simple language in the prior art;
[0067] Figure 3 It is an exemplary schematic diagram of rendering a vector font library of a complex language into a dot font library of a complex language in the prior art;
[0068] Figure 4 is an exemplary schematic diagram of a unique glyph index in an embodiment of the present application;
[0069] Figure 5 is an exemplary schematic diagram of rendering a vector font library of a complex language into a glyph index type dot matrix font library of a complex language in an embodiment of the present application;
[0070] Figure 6 This is a schematic diagram of a scenario in which a lightweight device switches a display language in an embodiment of the present application;
[0071] Figure 7 is an exemplary schematic diagram of information flow when the router displays text in a complex language in the prior art;
[0072] Figure 8 It is an exemplary schematic diagram of the processing process when a rich device displays text in a complex language in the prior art;
[0073] Fig. 9 This is a schematic diagram of information flow interaction in an embodiment of the present application;
[0074] Fig.10 is a schematic diagram of the hardware structure of the lightweight device 100 provided in an embodiment of the present application;
[0075] Fig.11 is a software structure block diagram of the lightweight device 100 of the embodiment of the present application;
[0076] Fig.12 is a schematic diagram of the hardware structure of the compiling device 200 provided in an embodiment of the present application;
[0077] Fig.13 This is a flowchart of the compilation method in the embodiment of the present application;
[0078] Fig.14 is an exemplary schematic diagram of a text resource file in an embodiment of the present application;
[0079] Fig.15 This is an exemplary schematic diagram of an information flow of a static text glyph index file compiled by an embodiment of the present application;
[0080] Fig.16 This is a flowchart of a text display method in an embodiment of the present application;
[0081] Fig.17 is an exemplary schematic diagram showing the relationship between pages, components and text numbers in an embodiment of the present application;
[0082] Fig.18 This is an exemplary schematic diagram of determining a static text number by a numerical range in an embodiment of the present application;
[0083] Fig.19 This is an exemplary schematic diagram of determining a static text number through parameters in a text number according to an embodiment of the present application;
[0084] Fig. 20 This is an exemplary schematic diagram of determining a static text number through a text type parameter in an embodiment of the present application;
[0085] Fig.21 This is another exemplary schematic diagram of determining the static text number by using the text type parameter in the embodiment of the present application.
[0086] Fig.22a This is an exemplary schematic diagram of using the number of static text to call a static text interface in an embodiment of the present application;
[0087] Figure 22b is another exemplary schematic diagram of using the number of static text to call a static text interface in an embodiment of the present application;
[0088] Fig.23a is another exemplary schematic diagram of using the number of static text to call a static text interface in an embodiment of the present application;
[0089] Figure 23b is another exemplary schematic diagram of using the number of static text to call a static text interface in an embodiment of the present application;
[0090] Fig.24a is another exemplary schematic diagram of using the number of static text to call a static text interface in an embodiment of the present application;
[0091] Figure 24b This is another exemplary schematic diagram of using the static text number to call the static text interface in an embodiment of the present application. DETAILED DESCRIPTION
[0092] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0093] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0094] To facilitate understanding, the relevant terms and concepts involved in the embodiments of the present application are first introduced below.
[0095] (1)Unicode:
[0096] Unicode (also known as Unicode, Universal Code, Single Code) is an industry standard in the field of computer science, including character sets, encoding schemes, etc. Unicode was created to address the limitations of traditional character encoding schemes. It sets a unified and unique binary encoding for each character in each language to meet the requirements of text conversion and processing across languages and platforms.
[0097] In text processing, Unicode defines a unique code (i.e., an integer) for each character rather than a glyph. In other words, Unicode treats characters in an abstract way (i.e., numbers), and leaves the visual interpretation (such as font size, appearance, font morphology, style, etc.) to other functional modules, such as browsers or word processors. For example, if a character has multiple glyphs, it only corresponds to a unique Unicode code.
[0098] (2) Simple language:
[0099] In the embodiment of the present application, one character corresponds to one Unicode code, and the text characters can be directly indexed and displayed through the Unicode code. The language itself without deformation can be called a simple language, represented by Chinese, English, and French.
[0100] (3) Complex language:
[0101] In the embodiment of the present application, a character may have multiple variations in different sentences, a Unicode code may correspond to multiple glyphs, and a language that needs to be shaped by character replacement or syllable replacement according to the sentence or context semantics can be called a complex language, represented by Arabic, Thai, Burmese, etc.
[0102] Figure 1 This is an exemplary schematic diagram of a complex language in an embodiment of the present application corresponding to a plurality of glyphs in a Unicode encoding. Figure 1 As shown, in Arabic, one Unicode code corresponds to one character. This character has four types of glyph transformations, namely, isol style, fina style, medi style, and init style, depending on the semantics of the sentence or context.
[0103] (4) Font library:
[0104] In the embodiment of the present application, a file that stores character sets of one or more languages and can index characters in the character sets by character set encoding (such as Unicode encoding) is called a character library.
[0105] 4.1, vector font library;
[0106] In the embodiment of the present application, a font library that uses vector fonts to represent character glyphs is called a vector font library.
[0107] Each glyph in a vector font is described by a mathematical curve, which contains key points on the glyph boundary, derivative information of connecting lines, etc. The font rendering engine reads these mathematical vectors and then performs certain mathematical operations to render. The advantage of this type of font is that the actual size of the font can be scaled arbitrarily without deformation or discoloration.
[0108] 4.2, dot matrix font library;
[0109] In the embodiment of the present application, a font library that uses a dot matrix font to represent character glyphs is called a dot matrix font library.
[0110] A dot-matrix font divides each character into 16×16 or 24×24 dots, and then uses the virtuality and reality of each dot to represent the outline of the character. A dot-matrix font is also called a bitmap font, in which each glyph is represented by a set of two-dimensional pixel information. Due to the bitmap, dot-matrix fonts are difficult to scale, and specific dot-matrix fonts can only be clearly displayed at the corresponding font size, otherwise the text will only be forcibly enlarged and the glyphs will be distorted, resulting in mosaic-like jagged edges.
[0111] (5) Text rendering:
[0112] Text rendering can be a process of displaying vector glyphs in a vector font library through mathematical operations, or a process of converting a vector font library into a dot-matrix font library.
[0113] Figure 2 This is an exemplary schematic diagram of rendering a simple language vector font library into a simple language dot matrix font library in the prior art. A simple language vector font library is a vector font corresponding to one Unicode code, and after rendering it into a simple language electronic font library, it is also a Unicode code corresponding to one dot matrix font.
[0114] Figure 3 This is an exemplary schematic diagram of rendering a complex language vector font library into a complex language dot matrix font library in the prior art. A complex language vector font library is a Unicode code corresponding to multiple vector glyphs, and after rendering it into a complex language dot matrix font library, it is also a Unicode code corresponding to multiple dot matrix glyphs.
[0115] (6) Unique glyph index:
[0116] For vector fonts of complex languages, although the same Unicode encoding may correspond to different glyphs, each glyph will have a unique glyph index corresponding to it.
[0117] Figure 4This is an exemplary schematic diagram of the unique glyph index in the embodiment of the present application. In an Arabic vector font library, one Unicode code corresponds to one character. The character has four glyph transformations, namely isol style, fina style, medi style and init style, depending on the semantics of the sentence or context. Among them, the unique glyph index corresponding to the isol style glyph is 40; the unique glyph index corresponding to the fina style glyph is 435; the unique glyph index corresponding to the medi style glyph is 437; and the unique glyph index corresponding to the init style glyph is 436.
[0118] It is understandable that in different character libraries, the unique glyph index corresponding to each glyph may be different, which is not limited here.
[0119] (7) Glyph index font library:
[0120] In the embodiment of the present application, a character library that uses character set encoding (such as Unicode encoding) to index characters is converted into a character library that uses unique glyph indexes to index glyphs, which is called a glyph index type character library.
[0121] Figure 5 This is an exemplary schematic diagram of rendering a vector font library of a complex language into a glyph index type dot matrix font library of a complex language in an embodiment of the present application. After rendering the vector font library of a complex language into a glyph index type dot matrix font library of a complex language, the one-to-one correspondence between the unique glyph index and the vector glyph in the original vector font library of the complex language will be retained and converted into a one-to-one correspondence between the unique glyph index and the dot matrix glyph. In this way, the glyphs in the glyph index type dot matrix font library of the complex language can be directly indexed by the unique glyph index. In an embodiment of the present application, the vector font library of a complex language can be rendered into a glyph index type dot matrix font library of a complex language on a compilation device.
[0122] (8) Text shaping:
[0123] In complex language fonts, a character corresponding to a Unicode code has multiple glyphs, and it is necessary to determine which glyph to use based on the sentence or context semantics. Therefore, after obtaining the character through the Unicode code index font, it is necessary to determine which glyph to use through text shaping.
[0124] In the embodiment of the present application, text shaping refers to the process of inputting the character set encoding of the text and outputting the correct glyph of the text or the glyph index set corresponding to the text. Text shaping is used to determine the correct glyph corresponding to the characters in the text string.
[0125] Text shaping can specifically include: glyph replacement, Bidi bidirectional text shaping, complex syllable replacement, semantic line breaking and other operations.
[0126] In the embodiment of the present application, the character set encoding corresponding to the string of the first static text is input into the text shaping algorithm library to obtain a first glyph index set. The text shaping algorithm library can use a first glyph index type font library, and the first glyph index type font library is a glyph index font library. The first glyph index set can contain one or more unique glyph indexes. Each unique glyph index has a glyph that uniquely corresponds to it in the first glyph index type font library.
[0127] Optionally, the text shaping algorithm library for text shaping can use some open source algorithm libraries, and different open source algorithm libraries may have different functions. Some open source algorithm libraries have weaker functions, such as the GPOS library and the GSUB library, which can only be used for glyph replacement and Bidi bidirectional text shaping; some open source algorithm libraries have stronger functions, such as the Harfbuzz library, the Bidi library, the ICU-linebreak library, etc., which can perform more comprehensive text shaping. In actual applications, you can also use an algorithm library designed by yourself for text shaping, or use a combination of different algorithm libraries for shaping, which is not limited here.
[0128] It is understandable that, since the text shaping in the embodiment of the present application requires the character set encoding of the input text to be output, the glyph index set corresponding to the text is output. The unique glyph index corresponding to the same glyph in different fonts may be different. Therefore, the font used after text shaping and the font used during text shaping need to be the same font, or a font with the same unique glyph index for the same glyph.
[0129] In the embodiment of the present application, the glyph index set obtained after text shaping can be a glyph index array, or a combination of multiple unique glyph indexes saved in other forms, such as a table, a stack, etc., which is not limited here.
[0130] (9) Rich equipment:
[0131] In the embodiment of the present application, a rich device refers to an electronic device with a large ROM and RAM, such as some electronic devices using the Android system, etc. Specifically, for example, a mobile phone, a computer, etc.
[0132] (10) Lightweight equipment:
[0133] In the embodiments of the present application, a lightweight device refers to an electronic device with a small ROM and RAM, such as a microcontroller unit or a single-chip microcomputer (MCU). For example, it only has MB-level ROM and KB-level RAM. Specifically, it includes electronic watches, routers, etc.
[0134] (11)Static text:
[0135] In the embodiment of the present application, static text refers to text with fixed content in a lightweight device. Fixed content text refers to text pre-stored in a resource file of the lightweight device, such as text of setting options, menus, etc. in a lightweight device.
[0136] (12) Dynamic text:
[0137] In the embodiment of the present application, dynamic text is text with unfixed content in a lightweight device. Text with unfixed content refers to text that is not pre-stored in the resource file of the lightweight device, such as text temporarily input by a user or text received from other devices.
[0138] Figure 6 A schematic diagram of a scenario in which a lightweight device switches the display language in an embodiment of the present application. A router currently uses simplified Chinese. According to the user's choice, the router can also support switching to other languages, such as English, Japanese, Spanish, Arabic, Thai, Hindi, etc., including some complex languages.
[0139] Figure 7 This is an exemplary diagram of the information flow when the router displays text in a complex language in the prior art. Since the router is a lightweight device with only MB-level ROM and KB-level RAM, it will use the Unicode encoding corresponding to the text to be displayed to index characters from the dot matrix font library of the complex language and display them during operation. Since its resource capabilities do not support complete shaping, when it switches to some complex languages, such as Thai, Arabic, Hindi, Burmese, etc., the syntax of the text displayed after using Unicode to index the dot matrix font library may not conform to the grammatical habits of the complex language, making it impossible for users who use the language to recognize the language.
[0140] Figure 8 This is an exemplary schematic diagram of the processing process when a rich device in the prior art displays text in a complex language. The rich device will use the Unicode encoding corresponding to the text to be displayed to index characters from the vector font file at runtime, and will use the Freetype library in the multi-language processing unit to render the characters into dot matrix information, and use the Harfbuzz library, Bidi library, ICU-linebreak library, etc. for shaping, syllable and character replacement, bidirectional text display, semantic line breaks, etc., to finally obtain correctly displayed text. All these process operations need to be performed at runtime, which requires a huge amount of resource capabilities to complete.
[0141] Fig. 9This is a schematic diagram of information flow interaction in an embodiment of the present application. In an embodiment of the present application, during compilation, a character library that uses a character set encoding (such as Unicode encoding) to index characters is converted into a glyph index-type character library that uses a unique glyph index to index glyphs. The glyph index-type character library is used to perform text shaping on the static text in the lightweight device, obtain a unique glyph index set of these static texts, and establish a corresponding relationship between the number of the static text and the unique glyph index set. When the lightweight device is running, the corresponding glyph index set can be directly determined according to the number of the static text to be displayed, and then the corresponding glyphs can be indexed from the glyph index-type character library according to the glyph index set, and the indexed glyphs can be displayed. In this way, when the lightweight device is running, there is no need to perform shaping operations to make the displayed static text have the display effect after shaping, avoiding the problem of grammatical errors in complex languages caused by not shaping or incomplete shaping when the lightweight device is running and being unable to recognize the language, thereby improving the lightweight device's support for complex languages.
[0142] In the description of the embodiments of the present application, the string of text to be displayed may be referred to as the text to be displayed, the string of static text may be referred to as static text, the unique identifier of static text may be referred to as the number of static text, the string of dynamic text may be referred to as dynamic text, the set of multiple unique glyph indexes may be referred to as a glyph index set or a unique glyph index set, the set of multiple glyphs may be referred to as a glyph set, and text shaping may be referred to as shaping, which will not be described in detail later.
[0143] The following first introduces an exemplary lightweight device 100 provided in an embodiment of the present application.
[0144] Fig.10 It is a schematic diagram of the hardware structure of the lightweight device 100 provided in an embodiment of the present application.
[0145] The embodiment will be described in detail below by taking the lightweight device 100 as an example.
[0146] It should be understood that the lightweight device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0147] The lightweight device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a display screen 194, etc. It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the lightweight device 100. In other embodiments of the present application, the lightweight device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0148] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0149] The controller may be the nerve center and command center of the lightweight device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0150] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0151] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0152] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to a touch sensor, a charger, a flash, a camera, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to a touch sensor through an I2C interface, so that the processor 110 communicates with the touch sensor through the I2C bus interface, thereby realizing the touch function of the lightweight device 100.
[0153] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module via the I2S bus to achieve communication between the processor 110 and the audio module. In some embodiments, the audio module can transmit an audio signal to the wireless communication module via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0154] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module and the wireless communication module can be coupled via a PCM bus interface. In some embodiments, the audio module can also transmit audio signals to the wireless communication module via the PCM interface to realize the function of answering calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0155] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 to the wireless communication module. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module through the UART interface to implement the Bluetooth function. In some embodiments, the audio module can transmit an audio signal to the wireless communication module through the UART interface to implement the function of playing music through a Bluetooth headset.
[0156] The MIPI interface can be used to connect the processor 110 with the display screen 194, the camera and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera communicate via the CSI interface to realize the shooting function of the lightweight device 100. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the lightweight device 100.
[0157] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with a camera, a display screen 194, a wireless communication module, an audio module, a sensor module, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0158] The SIM interface can be used to communicate with the SIM card interface to implement the function of transmitting data to the SIM card or reading data in the SIM card.
[0159] The USB interface is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface can be used to connect a charger to charge the lightweight device 100, and can also be used to transfer data between the lightweight device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other lightweight devices, such as AR devices, etc.
[0160] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the lightweight device 100. In other embodiments of the present application, the lightweight device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0161] The lightweight device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0162] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the lightweight device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0163] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the lightweight device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0164] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the lightweight device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, applications required for at least one function, etc. The data storage area may store data created during the use of the lightweight device 100, etc. In addition, the internal memory 121 may include RAM, and may also include ROM, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0165] Generally, the capacity of the RAM included in the memory storage 121 of the lightweight device 100 is only at the KB level, and the capacity of the ROM included is only at the MB level, which is not limited here.
[0166] Fig.11 It is a software structure block diagram of the lightweight device 100 according to an embodiment of the present application.
[0167] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into three layers, from top to bottom: application layer, engine layer, and kernel layer.
[0168] The application layer can include a series of application packages.
[0169] like Fig.11 As shown, the application package may include music, short messages, settings, gallery and other applications (also referred to as applications).
[0170] The engine layer provides application programming interface (API) and programming framework for applications. The engine layer includes some predefined functions.
[0171] like Fig.11 As shown, the engine layer may include a graphics engine, a font engine, and the like.
[0172] In the embodiment of the present application, the graphics engine is used to provide an interface of the graphics engine, and the application can call the interface of the graphics engine to draw pages and text.
[0173] In some embodiments of the present application, the graphics engine can provide different interfaces: static text interface and dynamic text interface. The application can call the static text interface to convert the number of the static text into a corresponding glyph index set; the dynamic text interface can be called to shape the dynamic text and generate a corresponding glyph index set.
[0174] In some embodiments of the present application, the static text interface may include multiple different interfaces. The application may access different files storing the correspondence between the static text number and the glyph index set by calling different static text interfaces, thereby obtaining the glyph index set in the corresponding file corresponding to the static text number input when calling the interface. This is not limited here.
[0175] In the embodiment of the present application, the font engine is used to provide a font index interface, and the application can call the font index interface through a unique glyph index to find the corresponding glyph.
[0176] The engine layer may also include a hardware device abstraction layer interface, and the hardware device abstraction layer interface may be used to call an interface of the kernel layer.
[0177] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver. The kernel layer controls the hardware device through the driver and can display graphics and text.
[0178] The hardware device can notify the graphics engine and font engine of the drawing status of text or graphics through interrupts, which then transmit the information back to the application for subsequent processing.
[0179] In some embodiments of the present application, there may be no kernel layer in the system, and the graphics engine and the font engine may directly control the hardware device through the hardware device abstraction layer interface in the engine layer, which is not limited here.
[0180] The following is a schematic diagram of an exemplary hardware structure of the compiling device 200 provided in an embodiment of the present application.
[0181] Fig.12 Schematic diagram of the hardware structure of the compilation device 200 provided in the embodiment of the present application.
[0182] The electronic device 200 may include: an input device 201, an output device 202, a processor 203 and a memory 204 (wherein the number of the processor 203 in the electronic device 200 may be one or more, Figure 2 In some embodiments of the present application, the input device 201, the output device 202, the processor 203 and the memory 204 may be connected via a bus or other means, wherein: Figure 2 The example of connecting through bus is taken in the following.
[0183] The processor 1403 calls the operation instructions stored in the memory 1404 to enable the compiling device 200 to execute the compiling method in the embodiment of the present application.
[0184] The following specifically describes the compilation method and the text display method in the embodiment of the present application in combination with the software and hardware structure of the exemplary lightweight device 100 and the hardware structure of the compilation device 200:
[0185] Fig.13 A flowchart of the compilation method in the embodiment of the present application is shown in FIG.
[0186] S1301, the compiling device converts the vector font library into a glyph index font library;
[0187] In the embodiment of the present application, the compiling device can convert a common vector font library that uses Unicode to index characters into a glyph index font library that uses unique glyph indexes to index glyphs. Please refer to the description of glyph index font library (7) in the above term description, which will not be repeated here.
[0188] It should be noted that, in some embodiments, the glyph index font library converted by the compiling device may be a dot font library. In some embodiments, the execution index font library converted by the compiling device may also be a vector font library, which is not limited here.
[0189] If the glyph index font library is a vector font library, after the lightweight device uses the glyph index font library to find the vector glyph, it still needs to render the vector glyph before it can be displayed.
[0190] If the execution index font is a bitmap font, the lightweight device can directly display the bitmap font after searching for the bitmap font using the glyph index font.
[0191] S1302, the compiling device obtains a text resource file;
[0192] The text resource file may contain the corresponding relationship between the text strings, text numbers, the text display formats, alignment methods, and fonts used in different languages that need to be displayed in the lightweight device. The text strings may include static text strings and dynamic text strings. Dynamic text strings and static text strings can be distinguished using different formatting symbols. For example, you can set the text in angle brackets to be dynamic text strings and the text not in angle brackets to be static text strings.
[0193] In the following, a text string is referred to as text, a static text string is referred to as static text, and a dynamic text string is referred to as dynamic text.
[0194] It should be noted that when designing a system or application, the text resource file will be generated to store the text that needs to be displayed in the system or application.
[0195] The text resource file may be stored in various forms, such as a table, an extensible markup language (XML) format, an array, etc., which is not limited here.
[0196] For example, Fig.14 It is an exemplary diagram of a text resource file. A text number corresponds to text displayed in multiple languages, text alignment, fonts used, format, etc. Among them, the text enclosed in angle brackets is dynamic text, and the text without angle brackets is static text. Among them, id2 corresponds to dynamic text, and id1 and id3 correspond to static text.
[0197] It is understandable that the text in the text resource file may be stored in a character set encoding such as Unicode encoding.
[0198] It should be noted that the text number is generally bound to each component in the page to be displayed in the lightweight device, and the text corresponding to the text number bound to the component can be displayed in the component according to the currently used language selected in the system.
[0199] In some embodiments, there may be only one uniformly used text resource file in a lightweight device, and texts that need to be displayed in the system and applications are all stored in the uniformly used text resource file.
[0200] In some embodiments, there may be two text resource files in a lightweight device, a separate text resource file may be used at the system level, and an application may use another separate text resource file;
[0201] In some embodiments, there may be more text resource files in the lightweight device, a separate text resource file may be provided at the system level, and each application may have its own separate text resource file. Each application's own separate text resource file may be stored in the application's own directory.
[0202] In some embodiments, text resource files provided by a third party may also be used.
[0203] The correspondence between the text and text number that the application needs to use can be added into the text resource file by the application developer himself. It can be added directly into the unified text resource file or added into the application's own separate text resource file. There is no limitation here.
[0204] It is understandable that the text number of each text in the text resource file is edited and assigned by the developer during the design. In order to facilitate the subsequent different processing of static text and dynamic text, different numbering plans can be used to distinguish static text from dynamic text when designing text numbering. For example: set the text within the first numerical range to be static text, and the text outside the first numerical range to be dynamic text; or set the text within the second numerical range to be dynamic text, and the text outside the second numerical range to be static text; or set the text within the third numerical range to be static text, and the text within the fourth numerical range to be dynamic text, etc.; different parameters can also be carried in the text number to distinguish static text from dynamic text, such as setting the first letter of the text number of static text to J, setting the first letter of the text number of dynamic text to D, etc., which is not limited here.
[0205] S1303, the compiling device extracts a string of static text from the text resource file;
[0206] The compiling device can extract the static text string from the text resource file according to the preset text feature, and the extracted static text string can include the first static text string. For example, if the dynamic text is set to have a format character different from the static text, the text without the format character can be determined as static text and extracted.
[0207] For example, if the dynamic text is enclosed in angle brackets and the static text does not have angle brackets, the compiling device may extract the static texts without angle brackets from the text resource file.
[0208] Specifically, if the text resource file contains texts in multiple languages, the compiling device may extract static texts in complex languages from the text resource file.
[0209] S1304: The compiling device performs text shaping on the character string of the first static text in the text resource file to obtain a first glyph index set;
[0210] The compiling device may shape each static text of the complex language extracted from the text resource file to obtain a corresponding character index set. For example, the compiling device may shape the string of the first static text in the text resource file to obtain a first character index set. For a detailed description of text shaping, please refer to the content of (8) Text Shaping in the above term description, which will not be repeated here.
[0211] S1305: The compiling device generates a static text glyph index file including a correspondence relationship between the first static text number and the first glyph index set according to the correspondence relationship between the first static text number and the character string of the first static text in the text resource file;
[0212] If in a text resource file, a text number corresponds to a string of static texts in multiple different languages. The first static text may be a text in a complex language. Then, based on the correspondence between the number of the first static text in the text resource file and the first static text, a static text glyph index file including the correspondence between the number of the first static text and the first glyph index set is generated. Specifically, it may be as follows: based on the correspondence between the number of the first static text in the text resource file, the language type of the first static text and the first static text, a static text glyph index file including the correspondence between the number of the first static text, the language type of the first static text and the first glyph index set is generated.
[0213] Fig.15The following is an exemplary diagram of an information flow for compiling a static text glyph index file in an embodiment of the present application. Exemplarily, according to the method described in step S1303, the compiling device extracts the static texts not enclosed in angle brackets in the text resource: text 1, text 2, text 3, text 4, text 5, text 6, text 7, and text 8, and performs text shaping.
[0214] According to the method described in step S1304, the shaping uses open source algorithm libraries such as Harfbuzz library, Bidi library, ICU-linebreak library and the glyph index type font library compiled in step S1301, and performs syllable and character replacement, bidirectional text display, semantic line break and other operations. Finally, the glyph index set 1 is generated for text 1, the glyph index set 2 is generated for text 2, the glyph index set 3 is generated for text 3, the glyph index set 4 is generated for text 4, the glyph index set 5 is generated for text 5, the glyph index set 6 is generated for text 6, the glyph index set 7 is generated for text 7, and the glyph index set 8 is generated for text 8.
[0215] According to the method described in step S1305, the compilation device generates a static text glyph index file according to the correspondence between the number of the static text in the text resource file, the language type and the static text: for example, since id1 in the text resource file corresponds to text 1 in the language type Hindi, and text 1 is shaped to generate glyph index set 1, therefore, in the static text glyph index file, id1, Chinese and glyph index set 1 correspond; similarly, id1, Burmese and glyph index set 2 correspond; id1, Arabic and glyph index set 3 correspond; id1, Thai and glyph index set 4 correspond; id2, Hindi and glyph index set 5 correspond; id2, Burmese and glyph index set 6 correspond; id2, Arabic and glyph index set 7 correspond; id2, Thai and glyph index set 8 correspond.
[0216] Optionally, the correspondence in the static text glyph index file may also include a text type parameter, and the value of the flag bit may be set to a static text parameter corresponding to the text number, indicating that the texts corresponding to the text numbers in the static text glyph index file are all static texts.
[0217] Optionally, if there are multiple different text resource files, different static text parameters can be used to distinguish the sources of the text resource files.
[0218] It is understandable that the static text glyph index file may be stored in various forms, such as a table, a binary file, an array, etc., which is not limited here.
[0219] Optionally, the compiling device may also store the static text glyph index file.
[0220] Optionally, depending on the different sources and uses of the text resource file, the compilation device can store the static text glyph index file in different locations. For example, if the text resource file is a text resource file used uniformly by the system and application in a lightweight device, the compilation device can store the obtained static text glyph index file in the system directory of the lightweight device. For example, if the text resource file is a text resource file used independently by an application in a lightweight device, the compilation device can store the obtained static text glyph index file in the directory of the application. For example, if the text resource file is a text resource file provided by a third party on the network, the compilation device can store the obtained static text glyph index file in a public server on the network. This is not limited here.
[0221] In an embodiment of the present application, a compiling device shapes the static text in a text resource file, obtains and stores a static text glyph index file, so that a device using the static text glyph index file can obtain a corresponding glyph index set according to the number of the static text. By searching the glyph index type font library according to the glyph index set, the correct glyph of the shaped static text can be displayed. It is no longer necessary to shape the static text every time it is displayed, which reduces the power consumption of the device using the static text glyph index file and improves the device's ability to support complex languages using the static text glyph index file.
[0222] Fig.16 A flowchart of a text display method in an embodiment of the present application.
[0223] S1601, the lightweight device determines whether the text number bound to the component to be displayed is a static text number or a dynamic text number;
[0224] It should be noted that a display page generally consists of one or more components to be displayed, and each component can be bound to one or more text numbers.
[0225] For example, Fig.17 As shown, it is an exemplary schematic diagram showing the relationship between a display page, a component and a text number. There are three components to be displayed, wherein component 1 is bound to text id 1, component 2 is bound to text id 2, and component 3 is bound to text id 3.
[0226] There are many ways for a lightweight device to determine whether the text number bound to the component to be displayed is a static text number or a dynamic text number:
[0227] Optionally, if the developer has planned the text numbering when designing the system or application, and uses different numbering plans in the text resource file to distinguish static text from dynamic text, the lightweight device can determine whether the text number is a static text number or a dynamic text number according to the numerical range of the text number.
[0228] For example, if the text number within the first numerical range is a static text number, and the text number outside the first numerical range is a dynamic text number, then the lightweight device can determine whether the text number is a static text number or a dynamic text number based on whether the text number belongs to the first numerical range;
[0229] For example, if the text number within the second numerical range is a dynamic text number, and the text number outside the second numerical range is a static text number, then the lightweight device can determine whether the text number is a static text number or a dynamic text number based on whether the text number belongs to the second numerical range;
[0230] For example, if it is set that a text number within the third numerical range is a static text number, and a text number outside the fourth numerical range is a dynamic text number, then the lightweight device can determine whether the text number is a static text number or a dynamic text number according to whether the text number belongs to the third numerical range or the fourth numerical range.
[0231] Fig.18 This is an exemplary schematic diagram of determining the static text number by a numerical range in an embodiment of the present application. If the text number is set within 100 to 100000, it is the number of the static text, and the text number is within 100001 to 500000, it is the number of the dynamic text. If the number of the text id1 bound to component 1 is 2222, 2222 is within the numerical range of 100 to 100000, so the text id1 is the number of the static text.
[0232] Optionally, the planning of text numbering may also use different parameters in the text numbering to identify whether the text number is a dynamic text number or a static text number.
[0233] like Fig.19 The figure shows an exemplary schematic diagram of determining the static text number by the parameters in the text number in the embodiment of the present application. If the first letter of the text number of the static text is set to J, the first letter of the text number of the dynamic text is set to D. If the number of the text id1 bound to component 1 is J777, since its first letter is J, the text id1 is the number of the static text.
[0234] Optionally, since the static text is converted into a glyph index set and saved in a static text glyph index file during the compilation phase, if the lightweight device only uses a unified static text glyph index file, the lightweight device uses the text number to query the static text glyph index file. If the text number can be found in the static text glyph index file, it can be indicated that the text number is the number of the static text, otherwise it is the number of the dynamic text.
[0235] Optionally, a text type parameter corresponding to the text number may be stored in the correspondence in the text resource file or the static text glyph index file, to identify whether the text number is a static text number or a dynamic text number. The lightweight device may query the text resource file or the static text glyph index file according to the text number to obtain the text type parameter, thereby determining whether the text number is a static text number or a dynamic text number.
[0236] like Fig. 20 The figure shows an exemplary schematic diagram of determining the static text number by the text type parameter in the embodiment of the present application. The corresponding relationship of the text resource file may include a text type parameter. If the first parameter, the second parameter, and the third parameter all represent static text, the fourth parameter represents dynamic text. Using the text id1 to search the text resource file, it can be obtained that the corresponding text type parameter is the first parameter, so it can be determined that the text id1 is the number of the static text.
[0237] like Fig.21 Another exemplary schematic diagram of determining the static text number by the text type parameter in the embodiment of the present application is shown. The corresponding relationship of the static text glyph index file may include a text type parameter. If the first parameter, the second parameter, and the third parameter all represent static text, the fourth parameter represents dynamic text. Using text id1 to search the static text glyph index file can obtain that its corresponding text type parameter is the first parameter, so it can be determined that the text id1 is the number of the static text.
[0238] It is understandable that there are many different ways for a lightweight device to determine whether a text number is a static text number or a dynamic text number, which is not limited here.
[0239] S1602: The lightweight device determines a first glyph index set according to the serial number of the first static text;
[0240] After determining that the text number bound to the component to be displayed is the number of a static text, for example, the number of a first static text, the lightweight device may determine the first glyph index set according to the number of the first static text.
[0241] Specifically, the lightweight device can call the static text interface of the graphics engine, use the first static text number to find the correspondence between the static text number and the glyph index set stored in the static text glyph index file, and obtain the first glyph index set corresponding to the first static text number.
[0242] Optionally, if the lightweight device supports multiple languages, the lightweight device can call the static text interface of the graphics engine, use the number of the first static text and the language currently used in the system, search for the correspondence between the static text number, language type and glyph index set stored in the static text glyph index file, and obtain the first glyph index set corresponding to the number of the first static text and the language currently used.
[0243] In some embodiments, the lightweight device may use multiple text resource files, such as a common text resource file in the system directory, a text resource file used independently in each application, or a text resource file stored in a network server, etc. Correspondingly, after compiling the static text glyph index file, the lightweight device may also use multiple static text glyph index files, such as a common static text glyph index file in the system directory, a static text glyph index file used independently in each application, or a static text glyph index file stored in a network server.
[0244] In this case, the lightweight device can use a variety of different methods to find the static text glyph index file corresponding to the serial number of the first static text:
[0245] Optionally, different static text glyph index files may be divided into different numerical ranges according to a pre-defined numbering plan. According to the numerical range to which the text number belongs, it may be determined in which static text glyph index file to search for the number of the first static text.
[0246] When there are multiple static text glyph index files, the graphics engine can have one static text interface or multiple static text interfaces, corresponding to different static text glyph index files:
[0247] Fig.22aAn exemplary schematic diagram of using the number of static text to call a static text interface in an embodiment of the present application. When there is only one static text interface, the correspondence between the static text index file and the storage address can also be stored in the lightweight device. After the lightweight device determines that the number of the first static text belongs to the first static text index file, it can query the correspondence between the static text index file and the storage address, determine the storage address of the first static text index file, and then use the number of the first static text and the storage address of the first static text index file to call the static text interface, so that the graphics engine can find the first glyph index set corresponding to the number of the first static text from the first static text index file.
[0248] Figure 22b This is an exemplary schematic diagram of using the static text number to call the static text interface in an embodiment of the present application. When there are multiple static text interfaces, the multiple static text interfaces can correspond to different static text index files respectively. After the lightweight device determines that the number of the first static text belongs to the value range of the number in the first static text index file, it can call the first static text interface corresponding to the first static text index file.
[0249] Optionally, text numbers with different parameters can be assigned to different text resource files, i.e., corresponding static text font index files, according to a pre-defined numbering plan. According to the parameters carried in the text number, it can be determined which static text font index file to search for the number of the first static text. Fig.23a As shown, the text id1 contains parameter J1, so the lightweight device can determine that it corresponds to the first static text index file, and can use the number of the first static text and the storage address of the first static text index file to call the static text interface. Figure 23b As shown, the text id1 includes parameter J1, so the lightweight device can determine that it corresponds to the first static text interface and can use the number of the first static text to call the first static text interface.
[0250] Optionally, the lightweight device may store a correspondence between a static text number and a text type parameter, and different text type parameters may correspond to different static text glyph index files. The lightweight device may use the number of the first static text to search for the correspondence between the number of the static text and the text type parameter, and determine the text type parameter corresponding to the number of the first static text, for example, the first parameter. Then Fig.24a As shown, the static text interface is called using the first static text number and the storage address of the first static text glyph index file corresponding to the first parameter, or as shown Figure 24b As shown, the first static text interface corresponding to the first parameter is called using the number of the first static text.
[0251] It is understandable that there may be other ways to search for the static text glyph index file corresponding to the serial number of the first static text, which are not limited here.
[0252] S1603: The lightweight device uses the first glyph index set to search a glyph index-type font library to obtain a first glyph set.
[0253] It can be understood that the glyph index item font library used by the lightweight device is the same as the glyph index font library used when the compiling device shapes and generates a static text glyph index file.
[0254] The lightweight device can use the first glyph index set to search the glyph index-type font library to obtain a first glyph set. The first glyph set is the glyphs after shaping the text content of the first static text.
[0255] S1604: The lightweight device displays the first glyph set in the to-be-displayed component bound to the serial number of the first static text;
[0256] The lightweight device can display the first glyph set in the to-be-displayed component bound to the number of the first static text. If the glyphs in the glyph set are vector glyphs, the lightweight device can render and display the vector glyphs when displaying. If the glyphs in the glyph set are dot-matrix glyphs, the lightweight device can directly display the dot-matrix glyphs when displaying.
[0257] S1605: The lightweight device determines the first dynamic text according to the serial number of the first dynamic text;
[0258] After determining that the text number bound to the component to be displayed is the number of a dynamic text, for example, the number of a first dynamic text, the lightweight device may determine the first dynamic text according to the number of the first dynamic text.
[0259] Specifically, the lightweight device may use the serial number of the first dynamic text to search for a text resource file, and determine the first dynamic text corresponding to the serial number of the first dynamic text.
[0260] S1606: The lightweight device shapes the first dynamic text to generate a second glyph index set;
[0261] The specific shaping process can be referred to step S1304, which will not be described in detail here.
[0262] S1606: The lightweight device uses the second glyph index set to search a glyph index-type font library to obtain a second glyph set;
[0263] Similar to step S1604, it will not be repeated here.
[0264] S1607: The lightweight device displays the second glyph set in the to-be-displayed component that is bound to the serial number of the first dynamic text.
[0265] Similar to step S1605, it will not be repeated here.
[0266] In the embodiment of the present application, the lightweight device can determine the corresponding first glyph index set that has been shaped by using the serial number of the first static text to be displayed, and can obtain the correct first glyph set that has been shaped for the first static text by searching the glyph index font library using the first glyph index set, and then can directly display the first glyph set. The glyphs of complex languages can be correctly displayed without shaping the text of complex languages, thereby improving the lightweight device's ability to support complex languages.
[0267] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0268] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0269] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0270] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A compilation method, It is characterized in that include: Obtain a text resource file, wherein the text resource file includes a correspondence between a text number and a text string; Performing text shaping on a character string of a first static text in the text resource file to obtain a first glyph index set, wherein the text shaping is used to determine a correct glyph corresponding to a character in the text string; According to the correspondence between the serial number of the first static text and the character string of the first static text in the text resource file, a static text glyph index file including the correspondence between the serial number of the first static text and the first glyph index set is generated.
2. The method according to claim 1, It is characterized in that The method further comprises: The vector font library is converted into a glyph index font library, where the glyph index font library is used to search for a glyph that uniquely corresponds to the glyph using a unique glyph index.
3. The method according to claim 2, It is characterized in that The step of performing text shaping on the character string of the first static text in the text resource file to obtain a first glyph index set specifically includes: The character set encoding corresponding to the character string of the first static text is input into a text shaping algorithm library to obtain the first glyph index set; the text shaping algorithm library uses a first glyph index type font library; the first glyph index set includes one or more unique glyph indexes, and each unique glyph index has a uniquely corresponding glyph in the first glyph index type font library.
4. The method according to claim 3, It is characterized in that Before the step of performing text shaping on the character string of the first static text in the text resource file to obtain the first glyph index set, the method further includes: The character string of the static text in the text resource file is determined according to the first format character, and the character string of the static text includes the character string of the first static text.
5. The method according to any one of claims 1 to 4, It is characterized in that The text strings in the text resource file include text strings in multiple different languages; the first static text is a text in a complex language; the complex language is a language in which a character corresponding to a character set encoding has multiple glyphs; The step of generating a static text glyph index file including a correspondence between the number of the first static text and the first glyph index set according to the correspondence between the number of the first static text and the character string of the first static text in the text resource file specifically includes: According to the correspondence between the number of the first static text, the language type of the first static text and the character string of the first static text in the text resource file, a static text glyph index file is generated, which contains the correspondence between the number of the first static text, the language type of the first static text and the first glyph index set.
6. A text display method, It is characterized in that include: The lightweight device determines a first glyph index set according to the serial number of the first static text; The lightweight device uses the first glyph index set to search for a glyph index-type font library to obtain a first glyph set; the glyph index-type font library is used to use a unique glyph index to search for a glyph that uniquely corresponds to it; The lightweight device displays the first set of glyphs.
7. The method according to claim 6, It is characterized in that There is only one static text glyph index file in the lightweight device, and the static text glyph index file contains the correspondence between the serial number of the first static text and the first glyph index set; The lightweight device determines a first glyph index set according to the serial number of the first static text, specifically including: The lightweight device uses the serial number of the first static text to search the static text glyph index file and determines a first glyph index set corresponding to the serial number of the first static text.
8. The method according to claim 7, It is characterized in that The lightweight device uses the serial number of the first static text to search the static text glyph index file to determine a first glyph index set corresponding to the serial number of the first static text, specifically including: The lightweight device uses the serial number of the first static text to call the static text interface of the graphics engine to determine a first glyph index set corresponding to the serial number of the first static text.
9. The method according to claim 6, It is characterized in that The lightweight device has a plurality of static text glyph index files, and different static text glyph index files store the correspondence between different static text serial numbers and glyph index sets.
10. The method according to claim 9, It is characterized in that The lightweight device determines a first glyph index set according to the serial number of the first static text, specifically including: The lightweight device determines, according to a numerical range planning or parameter planning of the text number, that the number of the first static text belongs to a first static text glyph index file; The lightweight device uses the serial number of the first static text to search the first static text glyph index file and determines a first glyph index set corresponding to the serial number of the first static text.
11. The method according to claim 9, It is characterized in that The lightweight device determines a first glyph index set according to the serial number of the first static text, specifically including: The lightweight device uses the serial number of the first static text to search for each static text glyph index file, determines that the serial number of the first static text belongs to the first static text glyph index file, and determines a first glyph index set corresponding to the serial number of the first static text.
12. The method according to claim 10 or 11, It is characterized in that The lightweight device uses the serial number of the first static text to search the first static text glyph index file to determine a first glyph index set corresponding to the serial number of the first static text, specifically including: The lightweight device uses the number of the first static text to call the first static text interface of the graphics engine to determine the first glyph index set corresponding to the number of the first static text; the first static text interface is a static text interface corresponding to the first static text glyph index file among the multiple static text interfaces of the graphics engine.
13. A compiling device, It is characterized in that include: Input devices, output devices, processors and memory; The memory is coupled to the processor, and the memory is used to store computer program code, wherein the computer program code includes computer instructions, and the processor calls the computer instructions to cause the compiling device to execute: Obtain a text resource file, wherein the text resource file includes a correspondence between a text number and a text string; Performing text shaping on a character string of a first static text in the text resource file to obtain a first glyph index set, wherein the text shaping is used to determine a correct glyph corresponding to a character in the text string; According to the correspondence between the serial number of the first static text and the character string of the first static text in the text resource file, a static text glyph index file including the correspondence between the serial number of the first static text and the first glyph index set is generated.
14. The compiling device according to claim 13, It is characterized in that The processor is further configured to call the computer instruction so that the compiling device executes: The vector font library is converted into a glyph index font library, where the glyph index font library is used to search for a glyph that uniquely corresponds to the glyph using a unique glyph index.
15. The compiling device according to claim 13, It is characterized in that The processor is specifically configured to call the computer instruction so that the compiling device executes: The character set encoding corresponding to the character string of the first static text is input into a text shaping algorithm library to obtain the first glyph index set; the text shaping algorithm library uses a first glyph index type font library; the first glyph index set includes one or more unique glyph indexes, and each unique glyph index has a uniquely corresponding glyph in the first glyph index type font library.
16. The compiling device according to claim 15, It is characterized in that The one or more processors are further configured to call the computer instructions so that the compiling device executes: The character string of the static text in the text resource file is determined according to the first format character, and the character string of the static text includes the character string of the first static text.
17. The compiling device according to any one of claims 13 to 16, It is characterized in that The text strings in the text resource file include text strings in multiple languages; the first static text is a text in a complex language; the complex language is a language type in which a character corresponding to a character set encoding has multiple glyphs; the one or more processors are specifically used to call the computer instructions to enable the compilation device to execute: According to the correspondence between the number of the first static text, the language type of the first static text and the character string of the first static text in the text resource file, a static text glyph index file is generated, which contains the correspondence between the number of the first static text, the language type of the first static text and the first glyph index set.
18. A lightweight device, It is characterized in that The lightweight device comprises: one or more processors, a memory and a display screen; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions to enable the lightweight device to execute: Determine a first glyph index set according to the serial number of the first static text; Using the first glyph index set to search a glyph index-type font library to obtain a first glyph set; the glyph index-type font library is used to use a unique glyph index to search for a glyph that uniquely corresponds to it; The first glyph set is displayed.
19. The lightweight device according to claim 18, It is characterized in that The lightweight device has only one static text glyph index file, wherein the static text glyph index file contains a correspondence between the serial number of the first static text and the first glyph index set; the one or more processors are specifically configured to call the computer instructions so that the lightweight device executes: The static text glyph index file is searched using the serial number of the first static text to determine a first glyph index set corresponding to the serial number of the first static text.
20. The lightweight device according to claim 19, It is characterized in that The one or more processors are specifically configured to call the computer instructions so that the lightweight device executes: The static text interface of the graphics engine is called using the serial number of the first static text to determine a first glyph index set corresponding to the serial number of the first static text.
21. The lightweight device according to claim 18, It is characterized in that The lightweight device has a plurality of static text glyph index files, and different static text glyph index files store the correspondence between different static text serial numbers and glyph index sets.
22. The lightweight device according to claim 21, It is characterized in that The one or more processors are specifically configured to call the computer instructions so that the lightweight device executes: Determining, according to a numerical range planning or parameter planning of a text number, that the number of the first static text belongs to a first static text glyph index file; The first static text glyph index file is searched using the serial number of the first static text to determine a first glyph index set corresponding to the serial number of the first static text.
23. The lightweight device according to claim 21, It is characterized in that The one or more processors are specifically configured to call the computer instructions so that the electronic device executes: The first static text number is used to search for each static text glyph index file, determine that the first static text number belongs to the first static text glyph index file, and determine a first glyph index set corresponding to the first static text number.
24. A lightweight device according to claim 22 or 23, It is characterized in that The one or more processors are specifically configured to call the computer instructions so that the electronic device executes: The first static text interface of the graphics engine is called using the number of the first static text to determine a first glyph index set corresponding to the number of the first static text; the first static text interface is a static text interface corresponding to the first static text glyph index file among multiple static text interfaces of the graphics engine.
25. A chip system, wherein the chip system is applied to a compilation device, the chip comprising one or more processors, and the processor is used to call computer instructions so that the compilation device executes the method as described in any one of claims 1-5.
26. A computer program product comprising instructions, It is characterized in that When the computer program product is run on a compiling device, the compiling device is caused to execute the method according to any one of claims 1 to 5.
27. A computer-readable storage medium comprising instructions, It is characterized in that When the instruction is executed on a compiling device, the compiling device is caused to execute the method according to any one of claims 1 to 5.
28. A chip system, wherein the chip system is applied to a lightweight device, the chip comprising one or more processors, and the processor is used to call computer instructions so that the lightweight device executes the method as described in any one of claims 6-12.
29. A computer program product comprising instructions, It is characterized in that When the computer program product runs on a lightweight device, the lightweight device is enabled to execute the method according to any one of claims 6 to 12.
30. A computer-readable storage medium comprising instructions, It is characterized in that When the instruction is executed on a lightweight device, the lightweight device is caused to execute the method according to any one of claims 6 to 12.
Citation Information
Patent Citations
Method for processing complex text by using Android browser
CN102194004A
Digital content entering system and digital content entering program
CN1379346A
Cited By
Text display method, compilation method and related device
WO2022022554A1