Character display method and device, equipment, storage medium and program product

By determining the target language in the wearable device and reading character feature information from the preset font library, and displaying the target characters in combination with display parameters, the problem of insufficient flexibility in displaying characters in multiple languages ​​is solved, and efficient multilingual character display is achieved.

CN119902836APending Publication Date: 2025-04-29SHENZHEN DO INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411856182.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

How to improve the flexibility of wearing devices to display the language characters required by users and deal with multiple languages ​​used by different users.

Method used

By determining the target language, the target font library corresponding to the target language is determined from multiple preset font libraries, and character feature information is read from the target font library according to the character identification of the target character, and the target character is displayed in combination with the target display parameters.

Benefits of technology

It effectively reduces the complexity of displaying target characters in the target string, improves the flexibility of electronic devices to display target language characters, and can quickly adapt to the display needs of different languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902836A_ABST
    Figure CN119902836A_ABST
Patent Text Reader

Abstract

The invention relates to a character display method and device, equipment, a storage medium and a program product. The method comprises the steps of determining a to-be-displayed target character string, and obtaining a target language; the target character string comprises a character identifier of at least one target character to be displayed; according to the target language, determining a target font library corresponding to the target language from a plurality of preset font libraries; and according to the character identifier of each target character, respectively reading the character feature information of each target character from the target character library, and displaying the target character according to the character feature information of the target character and the target display parameter. By adopting the method, the flexibility of displaying the language characters required by the user by the equipment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of display technology, and in particular to a character display method, device, equipment, storage medium and program product. Background Art

[0002] For example, wearable devices such as smart watches are targeting more and more user groups. Since different users may use different languages, wearable devices need to display the language and text required by the user. Therefore, the problem of how to improve the flexibility of the device to display the language characters required by the user needs to be solved urgently. Summary of the invention

[0003] Based on this, it is necessary to provide a character display method, apparatus, device, storage medium and program product that can improve the flexibility of the device in displaying the language characters required by the user in order to address the above technical problems.

[0004] In a first aspect, the present application provides a character display method. The method comprises:

[0005] Determine a target character string to be displayed and obtain a target language; the target character string includes a character identifier of at least one target character to be displayed;

[0006] According to the target language, determining a target character library corresponding to the target language from a plurality of preset character libraries;

[0007] According to the character identifier of each target character, the character feature information of each target character is read from the target character library respectively, and the target character is displayed according to the character feature information of the target character and the target display parameter.

[0008] In one of the embodiments, according to the target language, a target font library corresponding to the target language is determined from a plurality of preset font libraries, including: determining a target language label of the target language; determining a target font library label corresponding to the target language label from a language relationship table; the language relationship table includes a correspondence between a plurality of language labels and font library labels; and determining the target font library from a plurality of preset font libraries according to the target font library label.

[0009] In one of the embodiments, character feature information of each target character is read from a target font library according to a character identifier of each target character, including: determining a target font size of the target character; the target font size is used to represent a display size of the target character; according to the target font size, determining a target font file corresponding to the target font size from the target font library; the target font library includes a plurality of font files, each font file corresponding to a different font size; according to the character identifier of each target character, character feature information of each target character is read from the target font file.

[0010] In one of the embodiments, the character identifier of the target character is in a first encoding format; according to the character identifier of each target character, the character feature information of each target character is read from the target font file respectively, including: for each target character, the character identifier of the target character in the first encoding format is converted into a character identifier in a second encoding format; according to the character identifier of the target character in the second encoding format, the character feature information of the target character is read from the target font file; wherein the target font file includes the correspondence between the feature information of multiple characters and the character identifier in the second encoding format.

[0011] In one embodiment, determining a target font size of a target character includes: obtaining a character height of the target character; and determining a font size that matches the character height from a plurality of font sizes according to the character height to obtain the target font size.

[0012] In one embodiment, determining a target string to be displayed includes: obtaining an initial string; determining whether line breaking is required based on the initial string; if it is determined that line breaking is required, performing line breaking on the initial string to obtain a target string; if it is determined that line breaking is not required, using the initial string as the target string.

[0013] In one of the embodiments, determining whether line branch processing is required based on an initial character string includes: determining whether the initial character string contains line branch indication information; the line branch indication information indicates whether the initial character string is composed of multiple lines of character strings; if it does not contain the line branch indication information, determining that line branch processing is required; if it contains the line branch indication information, determining that line branch processing is not required.

[0014] In one embodiment, dividing the initial character string into lines includes: determining the display size of the effective display area for displaying the target character string; determining the number of display lines according to the character string length and the display size of the initial character string; dividing the initial character string into lines according to the number of display lines.

[0015] In one of the embodiments, the process of generating each preset character library includes: determining at least one preset language; the preset language is the language that the electronic device needs to display during the device display process; obtaining the full font file corresponding to each preset language; the full font file includes character feature information of all characters corresponding to the preset language and character identifiers in the second encoding format; according to the character display requirements of the electronic device and the full font files, determining the preset character library corresponding to each preset language; the preset character library includes character feature information of at least one character in the preset language that the electronic device needs to display during the device display process.

[0016] In one of the embodiments, according to the character display requirements of the electronic device and each full font file, the preset font library corresponding to each preset language is determined, including: for each preset language, according to the character display requirements, at least one identification set file corresponding to the preset language is determined; wherein different identification set files correspond to different font sizes, and each identification set file includes a character identification in a second encoding format of at least one character; according to each identification set file corresponding to each font size, character feature information of the characters in each identification set file is obtained from the full font file to obtain the font file corresponding to each font size; the font file includes character identification and character feature information of multiple characters in the second encoding format; according to the font file corresponding to each font size, the preset font library corresponding to the preset language is obtained.

[0017] In one of the embodiments, the method further includes: determining a font label corresponding to each preset font; storing each preset font and the font label in correspondence; wherein the font label is used to indicate a storage location of the preset font.

[0018] In one of the embodiments, the target character is displayed according to the character feature information and the target display parameters of the target character, including: dividing the character display area for displaying the target character into a first area and a second area according to the character display style represented by the character feature information of the target character; and filling the first area according to the target display parameters to display the target character.

[0019] In a second aspect, the present application also provides a character display device. The device comprises:

[0020] A first determination module is used to determine a target character string to be displayed and obtain a target language; the target character string includes a character identifier of at least one target character to be displayed;

[0021] A second determination module is used to determine a target character library corresponding to the target language from a plurality of preset character libraries according to the target language;

[0022] The display module is used to read the character feature information of each target character from the target character library according to the character identifier of each target character, and display the target character according to the character feature information of the target character and the target display parameter.

[0023] In one embodiment, the second determining module is specifically configured to:

[0024] Determine a target language label of a target language; determine a target font label corresponding to the target language label from a language relationship table; the language relationship table includes a correspondence between a plurality of language labels and font labels; and determine a target font from a plurality of preset fonts according to the target font label.

[0025] In one of the embodiments, the display module is specifically used to: determine a target font size of a target character; the target font size is used to represent the display size of the target character; according to the target font size, determine a target font file corresponding to the target font size from a target font library; the target font library includes multiple font files, each font file corresponds to a different font size; according to the character identifier of each target character, read the character feature information of each target character from the target font file respectively.

[0026] In one embodiment, the character identifier of the target character is in a first encoding format; the display module is specifically configured to:

[0027] For each target character, the character identifier of the target character in the first encoding format is converted into a character identifier in the second encoding format; based on the character identifier of the target character in the second encoding format, the character feature information of the target character is read from the target font file; wherein the target font file includes the correspondence between the feature information of multiple characters and the character identifier in the second encoding format.

[0028] In one embodiment, the display module is specifically used for:

[0029] The text height of the target character is obtained; according to the text height, a font size matching the text height is determined from multiple font sizes to obtain the target font size.

[0030] In one embodiment, the first determination module is specifically configured to:

[0031] Get an initial string; determine whether line-breaking processing is required based on the initial string; if it is determined that line-breaking processing is required, perform line-breaking processing on the initial string to obtain a target string; if it is determined that line-breaking processing is not required, use the initial string as the target string.

[0032] In one embodiment, the first determination module is specifically configured to:

[0033] Determine whether the initial character string contains line branch indication information; the line branch indication information indicates whether the initial character string is composed of multiple lines of character strings; if it does not contain the line branch indication information, determine that line branch processing is required; if it contains the line branch indication information, determine that line branch processing is not required.

[0034] In one embodiment, the first determination module is specifically configured to:

[0035] Determine the display size of the effective display area for displaying the target character string; determine the number of display lines according to the character string length and display size of the initial character string; and divide the initial character string into lines according to the number of display lines.

[0036] In one of the embodiments, the device further comprises a generating module, configured to:

[0037] Determine at least one preset language; the preset language is the language that the electronic device needs to display during the device display process; obtain the full font files corresponding to each preset language; the full font files include character feature information of all characters corresponding to the preset language and character identifiers in a second encoding format; determine the preset font library corresponding to each preset language according to the character display requirements of the electronic device and the full font files; the preset font library includes character feature information of at least one character in the preset language that the electronic device needs to display during the device display process.

[0038] In one embodiment, the generating module is specifically used for:

[0039] For each preset language, according to the character display requirements, at least one identification set file corresponding to the preset language is determined; wherein different identification set files correspond to different font sizes, and each identification set file includes a character identification in a second encoding format of at least one character; according to each identification set file corresponding to each font size, character feature information of the characters in each identification set file is obtained from the full font file to obtain a font file corresponding to each font size; the font file includes character identifications and character feature information of multiple characters in the second encoding format; according to the font file corresponding to each font size, a preset font library corresponding to the preset language is obtained.

[0040] In one embodiment, the device further includes a storage module, configured to:

[0041] Determine a font label corresponding to each preset font library; store each preset font library and the font label in correspondence; wherein the font label is used to indicate a storage location of the preset font library.

[0042] In one embodiment, the display module is specifically used for:

[0043] According to the character display style represented by the character feature information of the target character, the character display area displaying the target character is divided into a first area and a second area; according to the target display parameter, the first area is filled to display the target character.

[0044] In a third aspect, the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the first aspects are implemented.

[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect above.

[0046] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0047] The above-mentioned character display, device, equipment, storage medium and program product determine the target character string to be displayed and obtain the target language; the target character string includes the character identifiers of multiple target characters to be displayed; according to the target language, the target character library corresponding to the target language is determined from multiple preset character libraries; according to the character identifiers of each target character, the character feature information of each target character is read from the target character library respectively, and the target character is displayed according to the character feature information of the target character and the target display parameters. In this way, when displaying the target character string, it is only necessary to determine the target language, so that the character feature information of the target character in the target character string to be displayed can be read from the target character library, and then the target character can be displayed in combination with the target display parameters, which effectively reduces the complexity of displaying the target characters in the target character string and improves the flexibility of the electronic device in displaying the characters of the target language. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A schematic diagram of a flow chart of a character display method in an embodiment;

[0050] Figure 2 A schematic diagram of a process for determining a target character library in one embodiment;

[0051] Figure 3 A schematic diagram of a process for determining a target character string in one embodiment;

[0052] Figure 4 A schematic diagram of a flow chart for determining whether branch processing is required in one embodiment;

[0053] Figure 5 A schematic diagram of a branch processing flow in one embodiment;

[0054] Figure 6 A schematic diagram of a process for determining a preset character library in one embodiment;

[0055] Figure 7 A schematic diagram of another process of determining a preset character library in one embodiment;

[0056] Figure 8 A schematic diagram of a set of characters in one embodiment;

[0057] Fig. 9 A schematic diagram of a parameter set in an embodiment;

[0058] Fig.10 A schematic diagram of a process for reading character feature information in an embodiment;

[0059] Fig.11 A schematic diagram of a dot matrix of a character in one embodiment;

[0060] Fig.12 A schematic flow chart of another character display method in one embodiment;

[0061] Fig.13 is a structural block diagram of a character display device in an embodiment;

[0062] Fig.14 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. It should be understood that many specific details are set forth in the following description to facilitate a full understanding of the present application, but the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present application, so the present application is not limited by the specific embodiments disclosed below.

[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0065] It will be understood that “at least one” means one or more, and “plurality” means two or more.

[0066] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0067] With the continuous development of electronic devices, there are more and more types of electronic devices, and wearable devices are one of them. With the development of globalization, in the current wearable device market, there are different language display requirements for different countries and regions, and the requirements for various language displays are getting higher and higher.

[0068] As the audience of multilingual subdivisions increases, language developers need to spend a lot of time and energy to adapt the corresponding display text standards for different countries. Therefore, the current problem of how to improve the flexibility of devices to display the language characters required by users needs to be solved urgently.

[0069] In view of this, an embodiment of the present application provides a character display method, which improves the flexibility of language and text display through the designed multi-language font range and character display logic.

[0070] It should be noted that the character display method provided in the embodiment of the present application may be executed by a character display device, which may be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. The electronic device may be a wearable device, such as a smart watch, a smart bracelet, a head-mounted device, etc. Of course, the electronic device may also be other devices other than wearable devices that require language character display, such as various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, etc., which are not fully exemplified here. In the following method embodiments, the execution subject is an electronic device for explanation.

[0071] In one embodiment, Figure 1 As shown, a character display method is provided, comprising the following steps:

[0072] Step 101, determine the target character string to be displayed and obtain the target language.

[0073] The target character string includes a character identifier of at least one target character to be displayed. In other words, the target character string includes a character identifier of one or more target characters. Thus, the character feature information of the target character can be extracted from the target character according to the character identifier to display the target character.

[0074] The target character string corresponds to the target language, that is, the target characters of the target language need to be displayed.

[0075] Optionally, obtaining the target language includes: identifying a language environment currently set by the electronic device to obtain the target language, wherein the language environment represents that the electronic device displays characters based on the target language.

[0076] Optionally, the character identifier is the Unicode code corresponding to the character. Unicode is a computing industry standard that aims to provide a unique digital identifier for every character, symbol, and emoticon in all writing systems in the world. Unicode is a universal character set that includes almost all known writing systems, as well as many special symbols and emoticons. Unicode consists of code points and encoding forms. For code points, each character in Unicode is represented by a unique code point, which is a 20-bit or 32-bit number. For example, the code point for the letter 'A' is U+0041. For encoding forms, Unicode characters can be encoded in a variety of ways, the most common of which are UTF-8, UTF-16, and UTF-32. These encoding forms convert code points into a series of bytes for storage and transmission in computer systems. UTF-8 is a variable-length encoding that uses 1 to 4 bytes to represent a Unicode character. UTF-16 usually uses two bytes to represent a character, but for characters beyond the Basic Multilingual Plane, four bytes are used. UTF-32 uses a fixed four bytes to represent each character.

[0077] Optionally, the character identifier is in a first encoding format, such as UTF-8 encoding, thereby saving space during storage and use.

[0078] Step 102: Determine a target character library corresponding to the target language from a plurality of preset character libraries according to the target language.

[0079] A plurality of preset character libraries are pre-deployed in the electronic device, and different preset character libraries correspond to different preset languages.

[0080] Therefore, according to the target language, a preset character library corresponding to the target language can be determined as the target character library.

[0081] Optionally, each preset language is a language that the electronic device may need to display during the device display process. For each preset character library, the character feature information of the characters in the preset character library is determined according to a predetermined character display requirement of the electronic device.

[0082] Step 103, reading the character feature information of each target character from the target character library according to the character identifier of each target character, and displaying the target character according to the character feature information of the target character and the target display parameter.

[0083] Optionally, if the target character string includes multiple target characters, the character identifiers of the target characters are traversed in sequence, and the character feature information of the target characters is read from the target character library until the character feature information of all the target characters is obtained.

[0084] Optionally, for each target character, after obtaining the character feature information of the target character, the target character is displayed according to the character feature information of the target character and the target display parameters, and then the character feature information of the next target character is read and displayed in combination with the target display parameters until the last target character is displayed.

[0085] Exemplarily, the character feature information of each character includes at least one of the character shape, character size and character style, which are not fully illustrated here. It is understandable that according to the character feature information, the character display style of the target character can be determined; and according to the target display parameters, the display color and anti-aliasing of the target character can be determined.

[0086] Optionally, the same string uses the same target display parameter.

[0087] The above character display method can determine the target string to be displayed and obtain the target language; the target string includes the character identifiers of multiple target characters to be displayed; according to the target language, the target character library corresponding to the target language is determined from multiple preset character libraries; according to the character identifiers of each target character, the character feature information of each target character is read from the target character library respectively, and the target character is displayed according to the character feature information of the target character and the target display parameters. In this way, when displaying the target string, it is only necessary to determine the target language, so that the character feature information of the target character in the target string to be displayed can be read from the target character library, and then the target character can be displayed in combination with the target display parameters, which effectively reduces the complexity of displaying the target characters in the target string and improves the flexibility of the electronic device in displaying characters of the target language.

[0088] In one embodiment, Figure 2 A schematic diagram of a process for determining a target character library is shown. According to the target language, a target character library corresponding to the target language is determined from a plurality of preset character libraries, including:

[0089] Step 201, determining a target language label of a target language.

[0090] Step 202: Determine the target character library tag corresponding to the target language tag from the language relationship table.

[0091] The language relationship table includes the correspondence between multiple language tags and font tags.

[0092] Among them, a corresponding language label can be assigned to each preset language in advance. After the preset character library corresponding to the preset language is determined, the corresponding character library label can be assigned to the preset character library. In this way, a corresponding relationship between each language label and character library label can be formed to form a language relationship table.

[0093] Exemplarily, in an optional implementation, the method further includes: determining a font label corresponding to each preset font library; storing each preset font library and the font label in correspondence; wherein the font label is used to indicate a storage location of the preset font library.

[0094] In other words, after each preset font is generated, a font label is assigned to each preset font, and the preset font is stored in the position indicated by the font label. In this way, when the target font is determined, the target font can be determined according to the target font label, and the character data in the target font can be read from the position indicated by the target font label.

[0095] As mentioned above, the target language can be determined according to the language environment, so that the target language can be represented by the target language label. For example, if the language environment set by the user in the electronic device is to use Chinese to display the characters of each display interface, the target language is Chinese, and the Chinese language label can be determined as the target language label. By querying the language relationship table according to the Chinese language label, the Chinese character library label can be obtained.

[0096] For example, the language tag of Chinese is: DOUI_LANGUAGE_CN, and the font tag of Chinese is: FONT_TAG_CHINESE. The language tag of English is: DOUI_LANGUAGE_EN, and the font tag of Chinese is: FONT_TAG_EN. The tags of other languages ​​are similar and are not fully illustrated here.

[0097] Step 203: Determine a target font from a plurality of preset fonts according to the target font label.

[0098] Each preset character library is identified by a corresponding character library tag. Therefore, the target character library can be determined from multiple preset character libraries according to the target character library tag. For example, the Chinese character library is determined as the target character library according to the character library tag of the Chinese language.

[0099] In the embodiment of the present application, by setting the language relationship table, the electronic device can quickly determine the target character library label by querying the language relationship table according to the target language label, thereby helping the electronic device to quickly determine the target character library. And because the language label and the character library label are used to identify the character library and the language, the accuracy of the target character library determined according to the language label and the character library label can be guaranteed.

[0100] In one embodiment, in addition to the preset character library, other character libraries are built into the electronic device. When acquiring the target character string, the electronic device can also acquire a character flag, which indicates whether the character feature information of the target character in the target character string is located in the preset character library. If so, the above process of determining the target character library corresponding to the target language from multiple preset character libraries according to the target language is performed. Otherwise, the character feature information is directly acquired from other character libraries.

[0101] In one embodiment, the language relationship table may also include protocol tags of protocols corresponding to each preset language. The protocol is a protocol used by the electronic device and the target application in the electronic device to interact. Exemplarily, USER_LANG_xx is the format of the protocol tag.

[0102] The process of determining the target character string to be displayed is described below.

[0103] In one embodiment, Figure 3 A schematic diagram of a process for determining a target character string is shown. Determining a target character string to be displayed includes:

[0104] Step 301, obtaining an initial character string.

[0105] Optionally, a text drawing module is used in the electronic device to display each target character. Therefore, the API interface of the text drawing module can be used to receive the initial character string transmitted by the upper layer.

[0106] Step 302: Determine whether line separation is required based on the initial character string.

[0107] In an optional implementation, the initial character string is a multi-line character string that is pre-split into lines, in which case it is determined that the initial character string does not need to be split into lines. Otherwise, it is determined that the initial character string needs to be split into lines.

[0108] In one embodiment, Figure 4 A schematic diagram of a process for determining whether a branch process is required is shown. Determining whether a branch process is required based on an initial character string includes:

[0109] Step 401, determining whether the initial character string contains branch indication information.

[0110] The line-break indication information indicates whether the initial character string consists of multiple lines of character strings.

[0111] In other words, when the electronic device recognizes that the initial character string is composed of multiple lines, it determines that line break indication information is included.

[0112] Exemplarily, the electronic device identifies the number of lines of the initial character string, and if the number of lines is greater than 1, determines that the character string contains line branch indication information; otherwise, determines that the character string does not contain line branch indication information.

[0113] Step 402: If the bank branch indication information is not included, it is determined that bank branch processing is required.

[0114] If the line break indication information is not included, if the initial character string is too long to be fully displayed in one line in the display area, line break processing needs to be considered.

[0115] Step 403: If bank branch indication information is included, it is determined that bank branch processing is not required.

[0116] If the line break indication information is included, it means that the initial character string has been pre-broken into lines, and there is no need to re-execute the line break processing.

[0117] Step 303: If it is determined that line division processing is required, line division processing is performed on the initial character string to obtain a target character string.

[0118] In an optional implementation, the initial character string is divided into multiple lines according to a default number of line breaks.

[0119] In another optional implementation, Figure 5 A schematic diagram of a process flow of line branching is shown. Line branching of the initial character string includes:

[0120] Step 501: determine the display size of the effective display area for displaying the target character string.

[0121] Optionally, the electronic device may determine the effective display area for displaying the target string after the layout of the UI (User Interface) system of the electronic device, and obtain the display size of the effective display area. Exemplarily, the display size includes the height of the effective display area, and may also include the length of the effective display area and the starting display position, etc., which are not fully exemplified here.

[0122] Step 502: Determine the number of display lines according to the character string length and display size of the initial character string.

[0123] The display size may be the height of the effective display area, so that the initial character string is divided into multiple lines while all target characters in the initial character string can be fully displayed.

[0124] Step 503, dividing the initial character string into lines according to the number of display lines.

[0125] After line processing, the target string is obtained.

[0126] Step 304: If it is determined that line separation is not required, the initial character string is used as the target character string.

[0127] In the embodiment of the present application, the line-by-line processing is used to ensure that the determined target character string can be fully displayed in the effective display area, thereby avoiding the situation where an overly long character string is displayed in one line and is incomplete.

[0128] In one embodiment, character feature information of each target character is read from a target character library according to the character identifier of each target character, including: reading the character feature information of each target character line by line, and displaying the target character according to the character feature information of the target character and target display parameters.

[0129] In other words, each time a character feature information is read, the target character is displayed. In this way, there is no need to store each character feature information after reading, but the character feature information of the target character can be released immediately after display, which reduces the complexity of information processing of the electronic device and reduces the occupation of memory space.

[0130] Since the character feature information is read from the target character library, for ease of understanding, the following first describes the process of generating each preset character library. Optionally, the process of generating each preset character library can be executed by a computer device, such as a personal computer or a server. The generated preset character library can be deployed in an electronic device.

[0131] In one embodiment, Figure 6 A schematic diagram of a process for determining a preset character library is shown. The process of generating each preset character library includes:

[0132] Step 601: Determine at least one preset language.

[0133] The preset language is the language that the electronic device needs to display during the device display process.

[0134] For example, when using the electronic device, only Chinese, English and Japanese are needed, and these three are determined as the preset languages. Of course, the preset language can also be one, which is not specifically limited here.

[0135] Since the electronic device needs to display characters in a preset language during the device display process, it is necessary to build a preset character library required during the use of the electronic device.

[0136] Step 602, obtaining full font files corresponding to each preset language.

[0137] The full font file includes character feature information of all characters corresponding to the preset language and character identifiers in the second encoding format.

[0138] Optionally, obtain the full font file corresponding to the preset language from the download address of the preset language. For example, if the preset language is Chinese, download the Chinese font file from the font official website. For example, if you download the full font file of Songti, the full font file includes the character feature information of all Chinese characters. The character feature information includes information such as character shape, character size, and character style. The character style is the font, which is the Songti style here. Of course, the full font file of the corresponding font can also be obtained according to the display requirements of the predetermined electronic device.

[0139] Optionally, the full font template file is in TTF format or OTF format.

[0140] The full font file includes character feature information and character identifiers of all characters of the language, and the character identifiers in the full font file adopt a second encoding format, wherein the second encoding format is the universal UTF-16.

[0141] Step 603, determining the preset character libraries corresponding to the preset languages ​​according to the character display requirements of the electronic device and the full font files.

[0142] Since the full font file includes information of all characters, and the display requirements of the electronic device do not need to display all characters, the information of the characters required by the electronic device during use can be filtered out to form a preset font library.

[0143] Therefore, the preset character library includes character feature information of at least one character in a preset language that the electronic device needs to display during the device display process.

[0144] In the embodiment of the present application, the preset character library of each preset language required can be determined according to the character display requirements of the electronic device, which can ensure that the electronic device can obtain the character feature information of each character when displaying, and the storage capacity of the generated preset character library is small, reducing the storage space occupied. And because it matches the character display requirements, it has better compatibility.

[0145] In one embodiment, Figure 7 Another flow chart of determining a preset character library is shown. According to the character display requirements of the electronic device and the full font files, the preset character libraries corresponding to the preset languages ​​are determined, including:

[0146] Step 701: for each preset language, at least one identification set file corresponding to the preset language is determined according to character display requirements.

[0147] The character display requirement describes the information of each character that may need to be displayed during the use of the electronic device.

[0148] For example, the character display requirement describes that the font sizes involved in the use of the electronic device are 18, 22, 26, etc., and describes the character identifier of at least one character corresponding to each font size. Optionally, the characters corresponding to each font size may overlap or may be different.

[0149] According to the character display requirements, the character identifiers of all characters corresponding to each font size can be determined, and the character identifiers corresponding to the same font size can be added to the created file to obtain an identifier set file of the font size. Here, each character identifier can be a character identifier in the second encoding format. In this way, an identifier set file corresponding to each font size can be obtained. Such as UTF-16. That is, different identifier set files correspond to different font sizes, and each identifier set file includes a character identifier in the second encoding format for at least one character.

[0150] Optionally, identifies the collection file as a file in TXT format.

[0151] For example, Figure 8 A set of all characters corresponding to a font size of 26 and a font size of 28 is shown, wherein the electronic device obtains the character identifier of each character, and for the sake of convenience, the character itself is displayed. By comparison, it can be seen that the character identifiers in the two identifier set files may not be completely the same.

[0152] Step 702: According to each mark set file corresponding to each font size, character feature information of characters in each mark set file is obtained from the full font file to obtain a font library file corresponding to each font size.

[0153] For example, for a font size of 18, each character identifier is read from the identifier set file of the font size of 18, and then the character feature information corresponding to these character identifiers is determined from the full font file, the determined character feature information is extracted, and the character feature information and the corresponding character identifier are added to the created file to obtain the font file corresponding to the font size of 18. The process of obtaining font files of other font sizes is similar.

[0154] Thus, for each character library file, the character library file may include character identifiers and character feature information of a plurality of characters in the second encoding format.

[0155] In an optional implementation, the electronic device may store the above-mentioned full font file and the identification set file of each font size, and the electronic device may know the storage path of each file.

[0156] A modulo algorithm module is pre-deployed in the electronic device. The names of each font size, the storage path of the identification set file of each font size, the storage path of the full font file and the pre-defined font files of each font size are input into the modulo algorithm module, and the algorithm outputs the name of the font file of each font size.

[0157] Optionally, the font file is in bin format.

[0158] Among them, in the modulus algorithm module, each font size is traversed, and when the target font size is traversed, the identification set file is found according to the storage path of the identification set file of the target font size, and the character identifications included therein are read, and the full font file is found according to the storage path of the full font file, and then the character feature information of all characters corresponding to the target font size is read from the full font file, added to the created bin format file, and a name is set for the bin format file according to the naming corresponding to the target font size, so that the bin format file is output as the font library file corresponding to the target font size.

[0159] Step 703, obtaining a preset font library corresponding to a preset language according to the font library files corresponding to each font size.

[0160] It can be seen from this that the electronic device can obtain the font library files corresponding to each font size.

[0161] Optionally, the character library files of the same preset language are merged to obtain a preset character library corresponding to the preset language, that is, the preset character library is a total character library, which includes multiple character library files in bin format.

[0162] In addition, as mentioned above, the font tag of the font file may also be determined, and the font file may be stored.

[0163] In an optional embodiment, for each preset font library, the electronic device may also obtain the predetermined anti-aliasing parameters and font version corresponding to the preset font library, and store the preset font library in correspondence with the anti-aliasing parameters and font version. For example, the anti-aliasing parameters, font version and font label are also input into the modulo algorithm module, and the preset font library corresponding to the anti-aliasing parameters, font version and font label output by the modulo algorithm module is obtained. For example, Fig. 9 A schematic diagram of a parameter set input to the modulo algorithm module is shown.

[0164] When there are multiple preset languages, the position of the preset font library of each preset language in all font libraries can be subdivided. For example, the font library tag of preset font library 1 is FONT_TAG_LATIN, and the font library tag corresponds to the first address value 0xE6000; the font library tag of preset font library 2 is FONT_TAG_JAPAN, and the font library tag corresponds to the first address value 0x108000. The preset font library is stored according to the first address value corresponding to the font library tag, and when reading the preset font library, it is also read according to the first address value, so that the search range can be narrowed.

[0165] In the embodiment of the present application, a preset character library of the required preset language can be constructed according to the use requirements of the electronic device, so that the electronic device can display characters in each preset language, improving the flexibility of character display, and the preset character library can be simply transplanted and applied to other devices, which can achieve cross-platform and cross-system, and can display multiple languages ​​on different platforms, providing developers with a more efficient and convenient development experience, while providing display solutions for different languages. Unified the development standards of multiple languages ​​and improved development efficiency.

[0166] The process of reading character feature information is described below.

[0167] In one embodiment, Fig.10 A schematic diagram of a process for reading character feature information is shown. According to the character identifier of each target character, the character feature information of each target character is read from the target character library respectively, including:

[0168] Step 1001, determine the target font size of the target character.

[0169] Wherein, the target font size is used to represent the display size of the target character;

[0170] In one embodiment, determining a target font size of a target character includes: obtaining a character height of the target character; and determining a font size that matches the character height from a plurality of font sizes according to the character height to obtain a target font size.

[0171] For example, the electronic device may know the height information corresponding to each font size, and may determine the font size with the smallest difference from the height of the text as the target font size.

[0172] Step 1002: According to the target font size, determine a target font library file corresponding to the target font size from the target font library.

[0173] As can be seen from the above, the target font library includes multiple font files, each of which corresponds to a different font size. Therefore, after reading the target font library according to the font tag, the target font file corresponding to the target font size can be determined from the target font library according to the target font size.

[0174] For example, the name of each font file includes its corresponding font size, and the name of each font file is identified and compared and matched with the target font size, thereby obtaining the target font file.

[0175] Step 1003: Read the character feature information of each target character from the target character library file according to the character identifier of each target character.

[0176] Among them, if the encoding format of the character identifier of the target character is consistent with the encoding format of the character identifiers of each character included in the target font file, for example, both are UTF-16, then the character feature information of each target character is read from the target font file respectively according to the character identifier of each target character.

[0177] If the encoding format of the character identifier of the target character is inconsistent with the encoding format of the character identifiers of each character included in the target font file, it is necessary to convert the encoding format and then read the character feature information of each target character from the target font file.

[0178] In an optional embodiment, the character identifier of the target character is in a first encoding format; according to the character identifier of each target character, the character feature information of each target character is read from the target font file respectively, including: for each target character, the character identifier of the target character in the first encoding format is converted into a character identifier in a second encoding format; according to the character identifier of the target character in the second encoding format, the character feature information of the target character is read from the target font file; wherein the target font file includes the correspondence between the feature information of multiple characters and the character identifier in the second encoding format.

[0179] Optionally, use the gui_font_get_data interface to obtain character feature information of a specified target character from the target font file.

[0180] Optionally, a character pointer p_char of the font to be acquired, a feature pointer p_font_unit for receiving character feature information, and a pointer p_utf8_size indicating the write length of the character feature information may be defined. The character pointer points to the character identifier of the target character 1 in the character string, and the character feature information of the target character 1 is read according to the character identifier of the target character 1, and the character feature information of the target character 1 is stored in the position currently pointed to by the feature pointer, and the write length is the character length indicated by p_utf8_size, for example, the character length in UTF8 format.

[0181] In the embodiment of the present application, the target font library file can be quickly determined according to the target font size, thereby improving the efficiency of obtaining the character feature information of the target character.

[0182] In one embodiment, during the process of drawing a character string, the Unicode code of the character to be drawn and displayed is used to match the corresponding target character library. If a language change is found, the character library label is determined according to the re-determined language label, and the target character library is re-acquired. In this way, since the Unicode code is unique, it can effectively avoid the phenomenon of garbled characters appearing in the drawing when multiple languages ​​are mixed.

[0183] In one embodiment, the target character is displayed according to the character feature information and the target display parameters of the target character, including: dividing the character display area for displaying the target character into a first area and a second area according to the character display style represented by the character feature information of the target character; and filling the first area according to the target display parameters to display the target character.

[0184] The character display style describes the shape, size, etc. of the character feature information.

[0185] The character display area is the area where the target character is currently displayed. In this area, only the position occupied by the target character needs to be filled, and other positions are transparent. Therefore, the character display area where the target character is displayed is divided into a first area and a second area, for example, the first area is the area that needs to be filled, and the second area is the area that does not need to be filled.

[0186] Optionally, the target display parameter includes at least one of a display layout rule, a display color, a text height, an anti-aliasing parameter, and an alignment mode of the target character string.

[0187] Display layout rules refer to typesetting rules, for example: 1. Automatically wrap when the layout width is exceeded, and automatically wrap when a line break is detected. 2. When drawing a string, horizontal alignment, vertical alignment, and last line alignment. 3. A string has no more than 50 lines. 4. When a character cannot be drawn in the valid area, an ellipsis is drawn and the drawing process stops. 5. By default, it is drawn from left to right and from top to bottom.

[0188] Character feature information is similar to an array, and character display can be done in a dot matrix, which can save loading time and facilitate data storage. Fig.11 The dot matrix diagram of the "%" character is shown, wherein each 0x00 area constitutes the second area, which can be regarded as a transparent colorless area, and each 0xFF area represents the first area that needs to be filled with a color area. Optionally, there is a grayscale gradient between 0xFF and 0x00.

[0189] When the last character of the last line is read and displayed, drawing ends.

[0190] For ease of understanding, the character display method provided by the present application is described below with a complete embodiment. Fig.12The flowchart of the character display method shown in the figure, the electronic device can obtain a predetermined language relationship table. The language relationship table includes the correspondence between multiple groups of language labels and character library labels. Among them, the language label is used to identify the corresponding language, and the character library label is used to indicate the location of the corresponding character library. In order to simplify the text processing and exchange process, reduce the problems caused by inconsistent encoding, and make it possible to mix multiple languages ​​in the same document or application, we need to standardize the character set range of each language, which is very important for text processing in a multilingual environment. You can refer to the internationally common character range set and set a reasonable set interval according to the specific use needs of the electronic device. This is conducive to the standardized management of characters and increases the compatibility and extensibility of multiple languages. Therefore, at least one preset language required during the use of the electronic device can be confirmed, and the Unicode code range of each preset language can be determined.

[0191] Then, download the font file (TTF or OTF format file) corresponding to each preset language from the font official website. The font file includes the character feature information of all characters in the preset language and the Unicode code corresponding to the characters. The character feature information includes the shape, size and style of the character. The font file is stored. If there are multiple preset languages, multiple font files are downloaded.

[0192] In the process of font library modeling, the total font library corresponding to each language can be obtained. Among them, the character identifiers of all characters corresponding to all font sizes of the preset language required for device display are determined, and classified as follows: the character identifiers of multiple characters corresponding to each font size are added to the same TXT file to obtain multiple TXT files corresponding to multiple font sizes. Store each TXT file. For each preset language, the path of each TXT file of the preset language, the path of the corresponding font file, all font sizes involved, the predefined file names corresponding to each font size, anti-aliasing parameters, corresponding predetermined font labels and other parameters are input into the running script of the modeling tool, and the running script is run according to the parameters to traverse each font size. For example, for font size 18, the TXT file and font file corresponding to font size 18 are read according to the path, and the Unicode codes of multiple characters in the TXT file corresponding to font size 18 are determined, and the character feature information corresponding to these Unicode codes in the font file is taken out, added to the created bin format file, and the bin file is named according to the file name corresponding to font size 18, and the bin file corresponding to font size 18 (i.e., the font file above) is obtained. That is, the feature information of all characters required for the project is extracted from all characters of the preset language. Similarly, bin files of other font sizes are obtained, and each Bin file includes the U code and character feature information of each character. The bin files are merged to obtain the total font library corresponding to the preset language, and the total font library of the target language is bound to the font library label and anti-aliasing parameters, and the total font library is stored. Among them, the font library label indicates the storage location of the total font library bin file. For example, the font library label can indicate the starting position of the total font library storage, so that the information in the total font library can be read from the starting position. If there are multiple preset languages ​​in the project, the total font libraries corresponding to the multiple preset languages ​​are obtained.

[0193] When the electronic device is in use, the language relationship table and each total character library are deployed in the electronic device.

[0194] When the electronic device is to display the text to be displayed, the target character string representing the text to be displayed is obtained, as well as the height of the effective drawing area, the character height, the alignment, the color information and the font library flag, etc. The font library flag is used to indicate whether the target character string is from the total font library of each of the above preset languages.

[0195] By reading the settings of the electronic device and determining the currently used language, the language label can be obtained, and the font label corresponding to the language label can be determined according to the language relationship table. In addition, according to the text height, the font size corresponding to the text height can be determined.

[0196] The target total font library is determined according to the font library label, and the bin file corresponding to the font size is determined from the multiple bin files therein. At this time, since the bin file is bound to the anti-aliasing parameter, the anti-aliasing parameter can also be determined.

[0197] And, if the string is multi-line, the number of lines of the string is directly read, otherwise, the required number of lines is determined according to the length of the string and the width of the effective drawing area. In this way, the number of display lines of the target string can be obtained.

[0198] In order to save storage space, in the application process of electronic devices, the character string is encoded in UTF-8, that is, the target character string to be displayed is encoded in UTF-8. The target character string in UTF-8 encoding is converted into a UTF-16 character string.

[0199] The target string may be traversed line by line, and for the currently traversed target line, the character identifiers of the characters in the target line in the UTF-8 encoding form are traversed.

[0200] When the character identifier of the target character in the UTF-8 encoding form is traversed, it is converted into the character identifier of the UTF-16 encoding form. According to the converted character identifier of the target character, the character feature information of the target character is read from the above determined bin file.

[0201] Typesetting layout and text rendering are performed according to the character feature information, the number of rows to which the target character belongs, anti-aliasing parameters, alignment, and color information of the target character, so as to display the target character.

[0202] After drawing the target character, traverse the next character in the target row until the last character in the last row is traversed, and then the drawing ends.

[0203] The embodiment of the present application provides a multi-language display framework based on a GUI framework, aiming to achieve multi-language cross-platform and cross-system compatibility. The framework can easily display multi-language characters on various embedded systems and chip platforms, can quickly adapt to the operating systems of various chip platforms and various devices, unify the standards for multi-language development, and improve the efficiency of multi-language development.

[0204] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0205] Based on the same inventive concept, the embodiment of the present application also provides a character display device for implementing the character display method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more character display device embodiments provided below can refer to the limitations on the character display method above, and will not be repeated here.

[0206] In one embodiment, Fig.13 As shown, a character display device is provided, and the character display device 1300 includes: a first determination module 1301, a second determination module 1302 and a display module 1303, wherein:

[0207] The first determination module 1301 is used to determine a target character string to be displayed and obtain a target language; the target character string includes a character identifier of at least one target character to be displayed;

[0208] A second determination module 1302 is used to determine a target character library corresponding to the target language from a plurality of preset character libraries according to the target language;

[0209] The display module 1303 is used to read the character feature information of each target character from the target character library according to the character identifier of each target character, and display the target character according to the character feature information of the target character and the target display parameter.

[0210] In one embodiment, the second determining module 1302 is specifically configured to:

[0211] Determine a target language label of a target language; determine a target font label corresponding to the target language label from a language relationship table; the language relationship table includes a correspondence between a plurality of language labels and font labels; and determine a target font from a plurality of preset fonts according to the target font label.

[0212] In one of the embodiments, the display module 1303 is specifically used to: determine a target font size of a target character; the target font size is used to represent the display size of the target character; according to the target font size, determine a target font file corresponding to the target font size from a target font library; the target font library includes multiple font files, each font file corresponds to a different font size; according to the character identifier of each target character, read the character feature information of each target character from the target font file respectively.

[0213] In one embodiment, the character identifier of the target character is in the first encoding format; the display module 1303 is specifically used to:

[0214] For each target character, the character identifier of the target character in the first encoding format is converted into a character identifier in the second encoding format; based on the character identifier of the target character in the second encoding format, the character feature information of the target character is read from the target font file; wherein the target font file includes the correspondence between the feature information of multiple characters and the character identifier in the second encoding format.

[0215] In one embodiment, the display module 1303 is specifically configured to:

[0216] The text height of the target character is obtained; according to the text height, a font size matching the text height is determined from multiple font sizes to obtain the target font size.

[0217] In one embodiment, the first determining module 1301 is specifically configured to:

[0218] Get an initial string; determine whether line-breaking processing is required based on the initial string; if it is determined that line-breaking processing is required, perform line-breaking processing on the initial string to obtain a target string; if it is determined that line-breaking processing is not required, use the initial string as the target string.

[0219] In one embodiment, the first determining module 1301 is specifically configured to:

[0220] Determine whether the initial character string contains line branch indication information; the line branch indication information indicates whether the initial character string is composed of multiple lines of character strings; if it does not contain the line branch indication information, determine that line branch processing is required; if it contains the line branch indication information, determine that line branch processing is not required.

[0221] In one embodiment, the first determining module 1301 is specifically configured to:

[0222] Determine the display size of the effective display area for displaying the target character string; determine the number of display lines according to the character string length and display size of the initial character string; and divide the initial character string into lines according to the number of display lines.

[0223] In one of the embodiments, the device further comprises a generating module, configured to:

[0224] Determine at least one preset language; the preset language is the language that the electronic device needs to display during the device display process; obtain the full font files corresponding to each preset language; the full font files include character feature information of all characters corresponding to the preset language and character identifiers in a second encoding format; determine the preset font library corresponding to each preset language according to the character display requirements of the electronic device and the full font files; the preset font library includes character feature information of at least one character in the preset language that the electronic device needs to display during the device display process.

[0225] In one embodiment, the generating module is specifically used for:

[0226] For each preset language, according to the character display requirements, at least one identification set file corresponding to the preset language is determined; wherein different identification set files correspond to different font sizes, and each identification set file includes a character identification in a second encoding format of at least one character; according to each identification set file corresponding to each font size, character feature information of the characters in each identification set file is obtained from the full font file to obtain a font file corresponding to each font size; the font file includes character identifications and character feature information of multiple characters in the second encoding format; according to the font file corresponding to each font size, a preset font library corresponding to the preset language is obtained.

[0227] In one embodiment, the device further includes a storage module, configured to:

[0228] Determine a font label corresponding to each preset font library; store each preset font library and the font label in correspondence; wherein the font label is used to indicate a storage location of the preset font library.

[0229] In one embodiment, the display module 1303 is specifically configured to:

[0230] According to the character display style represented by the character feature information of the target character, the character display area displaying the target character is divided into a first area and a second area; according to the target display parameter, the first area is filled to display the target character.

[0231] Each module in the above character display device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0232] In one embodiment, an electronic device is provided. The electronic device may be a wearable device, and its internal structure diagram may be as shown in FIG. Fig.14As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a character display method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.

[0233] Those skilled in the art will understand that Fig.14 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0234] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0235] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0236] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0237] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0238] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0239] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A character display method, characterized in that: The method comprises: Determine a target character string to be displayed and obtain a target language; the target character string includes a character identifier of at least one target character to be displayed; According to the target language, determining a target character library corresponding to the target language from a plurality of preset character libraries; According to the character identifier of each target character, the character feature information of each target character is read from the target character library respectively, and the target character is displayed according to the character feature information of the target character and the target display parameter.

2. The method according to claim 1, characterized in that The step of determining a target character library corresponding to the target language from a plurality of preset character libraries according to the target language includes: determining a target language label for the target language; Determining a target character library label corresponding to the target language label from a language relationship table; the language relationship table includes a correspondence between a plurality of language labels and character library labels; The target character library is determined from the plurality of preset character libraries according to the target character library label.

3. The method according to claim 1, characterized in that The step of reading the character feature information of each target character from the target character library according to the character identifier of each target character comprises: Determining a target font size of the target character; the target font size is used to represent the display size of the target character; According to the target font size, determining a target font file corresponding to the target font size from the target font library; the target font library includes a plurality of font files, each of which corresponds to a different font size; According to the character identifier of each target character, the character feature information of each target character is read from the target character library file respectively.

4. The method according to claim 3, characterized in that The character identifier of the target character is in a first encoding format; and the character feature information of each target character is read from the target character library file according to the character identifier of each target character, including: For each of the target characters, converting the character identifier of the target character in the first encoding format into a character identifier in the second encoding format; According to the character identifier of the target character in the second encoding format, character feature information of the target character is read from the target character library file; wherein the target character library file includes a correspondence between feature information of a plurality of characters and the character identifier in the second encoding format.

5. The method according to claim 3, characterized in that: The step of determining a target font size of the target character comprises: Get the text height of the target character; According to the character height, a font size matching the character height is determined from multiple font sizes to obtain the target font size.

6. The method according to claim 1, characterized in that The step of determining a target character string to be displayed includes: Get the initial string; Determine whether line branching is required according to the initial character string; If it is determined that line division processing is required, line division processing is performed on the initial character string to obtain the target character string; If it is determined that line separation is not required, the initial character string is used as the target character string.

7. The method according to claim 6, characterized in that The determining whether line branching is required according to the initial character string includes: Determine whether the initial character string contains line-break indication information; the line-break indication information indicates whether the initial character string consists of multiple lines of character strings; If the bank branch indication information is not included, it is determined that bank branch processing is required; If the bank branch indication information is included, it is determined that bank branch processing is not required.

8. The method according to claim 6, characterized in that The line-by-line processing of the initial character string includes: Determine the display size of the effective display area for displaying the target character string; Determining the number of display lines according to the character string length of the initial character string and the display size; The initial character string is processed into lines according to the number of display lines.

9. The method according to claim 4, characterized in that The process of generating each of the preset character libraries includes: Determine at least one preset language; the preset language is the language that the electronic device needs to display during the device display process; Acquire a full font file corresponding to each of the preset languages; the full font file includes character feature information and character identifiers in a second encoding format for all characters corresponding to the preset languages; According to the character display requirements of the electronic device and each of the full font files, a preset font library corresponding to each of the preset languages ​​is determined; the preset font library includes character feature information of at least one character in the preset language that the electronic device needs to display during the device display process.

10. The method according to claim 9, characterized in that The step of determining the preset character libraries corresponding to the preset languages ​​according to the character display requirements of the electronic device and the full font files includes: For each of the preset languages, according to the character display requirements, determining at least one identification set file corresponding to the preset language; wherein different identification set files correspond to different font sizes, and each identification set file includes a character identification of the second encoding format of at least one character; According to the identification set files corresponding to the font sizes, character feature information of the characters in the identification set files are obtained from the full font file to obtain a font library file corresponding to the font sizes; the font library file includes character identifications and character feature information of a plurality of characters in a second encoding format; The preset character library corresponding to the preset language is obtained according to the character library files corresponding to the font sizes.

11. The method according to claim 9, characterized in that The method further comprises: Determine the font label corresponding to each of the preset fonts; Storing each of the preset character libraries and the character library labels in correspondence; The font library tag is used to indicate the storage location of the preset font library.

12. The method according to any one of claims 1 to 11, characterized in that: The step of displaying the target character according to the character feature information and the target display parameter of the target character comprises: Dividing a character display area displaying the target character into a first area and a second area according to a character display style represented by character feature information of the target character; The first area is filled according to the target display parameter to display the target character.

13. A character display device, characterized in that: The device comprises: A first determination module is used to determine a target character string to be displayed and obtain a target language; the target character string includes a character identifier of at least one target character to be displayed; A second determination module is used to determine a target character library corresponding to the target language from a plurality of preset character libraries according to the target language; The display module is used to read the character feature information of each target character from the target character library according to the character identifier of each target character, and display the target character according to the character feature information of the target character and the target display parameter.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

15. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.