CN118133776A - Character display method and device, storage medium and electronic equipment - Google Patents

Character display method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN118133776A
CN118133776A CN202211537781.9A CN202211537781A CN118133776A CN 118133776 A CN118133776 A CN 118133776A CN 202211537781 A CN202211537781 A CN 202211537781A CN 118133776 A CN118133776 A CN 118133776A
Authority
CN
China
Prior art keywords
character
characters
displayed
adjustment value
solid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211537781.9A
Other languages
Chinese (zh)
Inventor
冯善龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202211537781.9A priority Critical patent/CN118133776A/en
Publication of CN118133776A publication Critical patent/CN118133776A/en
Pending legal-status Critical Current

Links

Landscapes

  • Controls And Circuits For Display Device (AREA)

Abstract

The application discloses a character display method, a character display device, a storage medium and electronic equipment. The method comprises the following steps: acquiring a bitmap of characters to be displayed, wherein the characters to be displayed comprise at least two characters; obtaining a character distance adjustment value table, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters in the second solid-color image comprise the single characters in the first solid-color image; according to the character distance adjusting value table, determining a character distance adjusting value between two adjacent characters in the characters to be displayed; and displaying the character to be displayed based on the bitmap of the character to be displayed and the character distance adjustment value between two adjacent characters in the character to be displayed. The application can display characters to the user.

Description

Character display method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic technology, and in particular, to a character display method, a device, a computer readable storage medium, and an electronic apparatus.
Background
With the development of electronic technology, electronic devices such as smartphones, tablet computers, or wearable devices are becoming more popular. On the interactive interface of an electronic device, it is often necessary to display characters to a user, for example, to display article information in a browser application; in gaming applications, information such as score, number of steps, or time is displayed, and therefore, it is desirable to provide a character display scheme to display characters to a user.
Disclosure of Invention
The embodiment of the application provides a character display method, a character display device, a computer readable storage medium and electronic equipment, which can display characters to a user.
In a first aspect, an embodiment of the present application provides a character display method, including:
Acquiring a bitmap of characters to be displayed, wherein the characters to be displayed comprise at least two characters;
acquiring a character distance adjustment value table, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters comprise the single characters in the first solid-color image;
According to the character distance adjustment value table, determining a character distance adjustment value between two adjacent characters in the characters to be displayed;
And displaying the character to be displayed based on the bitmap of the character to be displayed and the character distance adjustment value between two adjacent characters in the character to be displayed.
In a second aspect, an embodiment of the present application provides a character display device, including:
The bitmap acquisition module is used for acquiring a bitmap of characters to be displayed, wherein the characters to be displayed comprise at least two characters;
The device comprises an adjustment value table acquisition module, a character distance adjustment value table acquisition module and a character distance adjustment module, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters comprise the single characters in the first solid-color image;
The adjustment value determining module is used for determining the word distance adjustment value between two adjacent characters in the characters to be displayed according to the word distance adjustment value table;
and the character display module is used for displaying the characters to be displayed based on the bitmap of the characters to be displayed and the character distance adjustment value between two adjacent characters in the characters to be displayed.
In a third aspect, an embodiment of the present application provides a storage medium having stored thereon a computer program which, when executed on a computer, causes the computer to execute the character display method provided by the embodiment of the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, including a memory, and a processor, where the processor is configured to execute the character display method provided by the embodiment of the present application by calling a computer program stored in the memory.
In the embodiment of the application, the bitmap of the character to be displayed is obtained, and the character to be displayed comprises at least two characters; acquiring a character distance adjustment value table, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters comprise the single characters in the first solid-color image; according to the character distance adjustment value table, determining a character distance adjustment value between two adjacent characters in the characters to be displayed; based on the bitmap of the character to be displayed and the character distance adjustment value between two adjacent characters in the character to be displayed, the character to be displayed is displayed, and the character can be displayed to the user.
Drawings
The technical solution of the present application and its advantageous effects will be made apparent by the following detailed description of the specific embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a character display method according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a first scenario of a character display method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a second scenario of a character display method according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a third scenario of a character display method according to an embodiment of the present application.
Fig. 5 is a second flowchart of a character display method according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a character display device according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It should be noted that the terms "first," "second," and "third," etc. are used herein to distinguish between different objects and not to describe a particular order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the particular steps or modules listed and certain embodiments may include additional steps or modules not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The embodiment of the application provides a character display method, a character display device, a computer readable storage medium and electronic equipment, wherein the character display method can be applied to neural network character display in any fields such as images, sounds, natural languages, control and the like and in any structures. The execution body of the character display method may be the character display device provided by the embodiment of the application or the electronic device integrated with the character display device, where the character display device may be implemented in a hardware or software manner. The electronic device may be a wearable device, a smart phone, a tablet computer, a palm computer, a notebook computer, or the like, which is configured with a processor and has a character display capability.
Referring to fig. 1, fig. 1 is a schematic flow chart of a character display method according to an embodiment of the application, where the flow chart may include:
In 101, a bitmap of a character to be displayed is obtained, the character to be displayed comprising at least two characters.
The characters to be displayed may include chinese characters, english characters, or numeric characters, among others. For example, the character to be displayed may be "my love my ancestor"; the character to be displayed may also be "ABCDEF"; the character to be displayed may also be "12345"; the character to be displayed may also be "123 me love my ancestor.
In this embodiment, the electronic device may determine a character to be displayed, and obtain a bitmap of the character to be displayed.
Wherein a character to be displayed corresponds to a bitmap. For example, assuming that the character to be displayed includes "12345", the electronic device may obtain a bitmap of the character to be displayed "1", a bitmap of the character to be displayed "2", a bitmap of the character to be displayed "3", a bitmap of the character to be displayed "4", and a bitmap of the character to be displayed "5".
It will be appreciated that the interactive interface of a character on an electronic device is typically displayed in pixels, i.e. the character is made up of a plurality of pixels. The bitmap of the character is the pixel values of the corresponding pixel locations. By obtaining a bitmap of the character, the character can be displayed on an interactive interface on the electronic device.
In 102, a range adjustment value table is obtained, wherein the range adjustment value table includes a range adjustment value between two characters, the range adjustment value table is determined based on a character boundary position of a single character in a first solid image and a character boundary position of two characters in a second solid image, the two characters in the second solid image including the single character in the first solid image.
In 103, a character distance adjustment value between two adjacent characters in the characters to be displayed is determined according to the character distance adjustment value table.
It will be appreciated that when the character to be displayed includes at least two characters, a bitmap of each character to be displayed and a word spacing adjustment value between two adjacent characters in the character to be displayed need to be obtained before the character to be displayed is displayed.
In this embodiment, the electronic device determines the word distance adjustment value table including the word distance adjustment values between the two characters in advance according to the character boundary positions of the single character in the first solid color image and the character boundary positions of the two characters in the second solid color image. Wherein the two characters in the second solid image comprise a single character in the first solid image. The character boundary position is the position of a pixel point for constituting the boundary of a character.
For example, assuming that two characters in the second solid image are character "2" and character "4", a single character in the first solid image is character "2" or character "4", and based on the two characters in the second solid image, i.e., character "2" and character "4", a single character in the first solid image, i.e., character "2" or character "4", the electronic device may obtain a word distance adjustment value between character "2" and character "4", i.e., a word distance adjustment value of character "2" with respect to character "4" and a word distance adjustment value of character "4" with respect to character "2".
After determining at least two characters to be displayed, the electronic device may determine a word distance adjustment value between two adjacent characters in the characters to be displayed according to the word distance adjustment value table.
For example, assuming that the character to be displayed includes "12345", the electronic device may determine a list of word distance adjustment values between the character to be displayed "1" and the character to be displayed "2", a list of word distance adjustment values between the character to be displayed "2" and the character to be displayed "3", a list of word distance adjustment values between the character to be displayed "3" and the character to be displayed "4", and a list of word distance adjustment values between the character to be displayed "4" and the character to be displayed "5" according to the list of word distance adjustment values.
In 104, the character to be displayed is displayed based on the bitmap of the character to be displayed and the adjustment value of the word distance between two adjacent characters in the character to be displayed.
In this embodiment, after obtaining the bitmap of the character to be displayed and the adjustment value of the word distance between two adjacent characters in the character to be displayed, the electronic device may display the character to be displayed based on the bitmap of the character to be displayed and the adjustment value of the word distance between two adjacent characters in the character to be displayed.
In this embodiment, by acquiring a bitmap of characters to be displayed, the characters to be displayed include at least two characters; obtaining a character distance adjustment value table, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters in the second solid-color image comprise the single characters in the first solid-color image; according to the character distance adjusting value table, determining a character distance adjusting value between two adjacent characters in the characters to be displayed; based on the bitmap of the characters to be displayed and the character spacing adjustment value between two adjacent characters in the characters to be displayed, the characters to be displayed are displayed, and the characters can be displayed to the user.
In an alternative embodiment, the character-distance adjustment value table is determined by the external device based on the character boundary positions of the individual characters in the first solid image and the character boundary positions of the two characters in the second solid image.
It will be appreciated that the list of word size adjustment values may be determined by the external device. That is, the external device determines the word pitch adjustment value table based on the character boundary positions of the single character in the first solid image and the character boundary positions of the two characters in the second solid image. When the characters need to be displayed through the electronic equipment, the electronic equipment can acquire the character spacing adjustment value table from the external equipment, determine the character spacing adjustment values between adjacent characters according to the character spacing adjustment value table, and further display the characters according to the character spacing adjustment values.
In an alternative embodiment, the electronic device may be a wearable device, and the external device is a mobile phone terminal having a communication connection relationship with the wearable device. When the characters are required to be displayed through the wearable device, the wearable device can acquire the character spacing adjustment value table from the mobile phone terminal, and according to the character spacing adjustment value table, the character spacing adjustment values between adjacent characters are determined, and then the characters are displayed according to the character spacing adjustment values.
In an alternative embodiment, the single character includes a first character, the two characters include a first character and a second character, and before obtaining the bitmap of the character to be displayed, the method further includes:
Acquiring a first solid image including a first character;
Acquiring a second solid-color image comprising a first character and a second character, wherein the first character and the second character are displayed in the second solid-color image according to a designated sequence;
Determining a first character boundary position of a first character in a first solid image, and determining a second character boundary position of the first character and a second character in a second solid image;
determining a position difference value of the first character boundary position and the second character boundary position in an image coordinate system;
Obtaining a word distance adjustment value of the second character relative to the first character according to the position difference value;
And obtaining a word distance adjustment value table according to the word distance adjustment value of the second character relative to the first character.
For example, taking the first character as "4" and the second character as "2", the first character is printed into the first solid image by the external device storing the bitmap of the characters and the character spacing adjustment value between the two characters, and the first character and the second character are printed into the second solid image.
Optionally, in the first solid image, the pixel value of the position where the first character is located is different from the pixel value of the position other than the position where the first character is located. In the second solid image, the pixel values of the positions where the first character and the second character are located are different from the pixel values of the positions other than the positions where the first character and the second character are located. For example, the pixel value of the position where the first character is located is not 0, and the pixel value of the position other than the position where the first character is located is 0; the pixel values of the positions of the first character and the second character are not 0, and the pixel values of the positions other than the positions of the first character and the second character are 0. The display size of the first character in the first solid image is the same as the display size in the second solid image. The display size of the second character in the second solid image corresponds to the display size of the first character in the second solid image, i.e. the display sizes of the first character and the second character in the second solid image are the same, only the glyphs are different.
The first character and the second character are displayed in the second solid image in a specified order, wherein the specified order is determined according to a display direction of the characters. For example, if the display direction of the characters is from left to right, the second solid image in which the order is from right to left, that is, the first character "4" and the second character "2" are displayed is as shown in fig. 2. If the display direction of the characters is from right to left, the designated sequence is from left to right, the corresponding image coordinate system is also established by taking the upper right corner of the image as an origin, the horizontal direction as an X axis and the vertical direction as a Y axis, and the corresponding character boundary position is also the position of the leftmost corresponding pixel point.
The following description will be given by taking the case where the display direction of the characters is from left to right and the designated order is from right to left.
The electronic device may obtain the first solid image including the first character and the second character.
For example, assume that a first solid image is shown in fig. 3 and a second solid image is shown in fig. 2. The electronic device may determine a first character boundary position for character "4" in the first solid image and determine a second character boundary position for character "2" and character "4" in the second solid image.
The first character boundary position is a position where a pixel point with a pixel value not 0 at the rightmost side in the first solid color image is located, that is, a position where a pixel point with a pixel value not 0 at the rightmost side where the character "4" is located. Specifically, the first character boundary position is a first abscissa of the position of the pixel point where the pixel value at the rightmost side in the first solid-color image is not 0in the image coordinate system. The image coordinate system is established by taking the upper left corner of the first solid-color image as an original point, taking the horizontal direction as an X axis and taking the straight direction as a Y axis.
The second character boundary position is the position of the pixel point with the pixel value at the rightmost side not being 0 in the second solid-color image, namely the position of the pixel point with the pixel value at the rightmost side not being 0 in the position of the character '4'. Specifically, the second character boundary position is a second abscissa of the position of the pixel point with the pixel value of not 0 at the rightmost side in the second solid-color image in the image coordinate system. The image coordinate system is established by taking the upper left corner of the second solid-color image as an original point, taking the horizontal direction as an X axis and taking the straight direction as a Y axis.
After obtaining the first abscissa and the second abscissa, the electronic device may determine a difference between the second abscissa and the first abscissa, as a position difference, and use the position difference as a word distance adjustment value of the character "2" relative to the character "4".
It will be appreciated that other characters, such as character "a", character "yes" or character "4", etc., may be obtained through the same procedure as the above procedure, and that other characters, such as character "a", character "yes" or character "3", etc., may be obtained through the same procedure as the above procedure, with respect to other characters, such as character "Z", character "assorted" or character "9", etc., thereby finally obtaining a table of the character-spacing adjustment values.
In an alternative embodiment, the electronic device may obtain the word distance adjustment value between any two characters in the character library according to the same process as the above process, so as to obtain a word distance adjustment value table, further determine, when determining at least two characters to be displayed, the word distance adjustment value of an adjacent character to be displayed in the at least two characters to be displayed according to the word distance adjustment value table, and then display the at least two characters to be displayed based on the word distance adjustment value and the bitmap of each character to be displayed.
In an alternative embodiment, after acquiring the first solid image including the first character, the method further includes:
Determining the boundary of the first character;
determining a modulus taking area of the first character according to the boundary;
And performing modulo on the first solid-color image according to the modulo area to obtain a bitmap of the first character.
In this embodiment, after the first solid image of the first character is acquired, the boundary of the first character may be determined; determining a modulus taking area of the first character according to the boundary; and performing modulo on the first solid-color image according to the modulo area to obtain a bitmap of the first character.
For example, assuming that the pixel value of the pixel point at the position where the first character "4" is located is not 0 and the pixel value of the pixel point at the position other than the position where the first character "4" is located is 0 as shown in fig. 3, the electronic device may obtain the pixel value at the position where the pixel point at the pixel value other than 0 in the modulo region is located, to obtain the bitmap of the first character.
In an alternative embodiment, determining the boundary of the first character includes:
determining a first boundary and a second boundary of a first character in the X-axis direction of an image coordinate system in a first solid image;
determining a third boundary and a fourth boundary of the first character in the Y-axis direction of the image coordinate system in the first solid image;
determining a modulus-taking area of the first character according to the boundary, wherein the modulus-taking area comprises:
and determining the area enclosed by the first boundary, the second boundary, the third boundary and the fourth boundary as a modulus taking area.
For example, assuming that the pixel value of the pixel at the position where the first character "4" is located is not 0 and the pixel value of the pixel at the position other than the position where the first character "4" is located is 0 as in fig. 4, the electronic device may determine the first boundary and the second boundary of the first character "4" in the X-axis direction of the image coordinate system, determine the third boundary and the fourth boundary of the first character "4" in the Y-axis direction of the image coordinate system, and determine the region enclosed by the first boundary, the second boundary, the third boundary, and the first boundary as the modulo region. Then, the electronic device obtains the pixel value of the pixel point with the pixel value not being 0 in the modulus region, and a bitmap of the first character '4' is obtained. The image coordinate system is established by taking the upper left corner of the first solid-color image as an original point, taking the horizontal direction as an X axis and taking the straight direction as a Y axis.
It will be appreciated that the bitmaps of other characters may be obtained by the same process as described above, thereby ultimately obtaining bitmaps of all characters in the character library.
In an alternative embodiment, the character display method further includes:
according to the bitmap of the first character and the character distance adjustment value table, packaging to form a character display file;
obtaining a bitmap of a character to be displayed, comprising:
Acquiring a bitmap of a character to be displayed from a character display file;
obtaining a word distance adjustment value table, comprising:
and acquiring a word distance adjustment value table from the character display file.
In this embodiment, after obtaining the bitmap and the word distance adjustment value table of the first character, the electronic device may package the bitmap and the word distance adjustment value table of the first character to form the character display file. The character display file may be a binary file, e.g., the character display file may be a font.
After determining the characters to be displayed, the electronic device may obtain a bitmap of each character to be displayed from the character display file, obtain a word distance adjustment value table from the character display file, obtain a word distance adjustment value between adjacent characters to be displayed according to the word distance adjustment value table, and display the characters to be displayed based on the bitmap and the word distance adjustment value.
In an alternative embodiment, the above process of how to obtain the word distance adjustment value table and how to obtain the bitmap of the character may be performed by the external device, and after the external device obtains the word distance adjustment value table and the bitmap of the character, the external device may package the character display file according to the bitmap of the character and the word distance adjustment value table. When the electronic equipment needs to display the characters, the character display file can be acquired, and the characters are displayed according to the character display file.
In an alternative embodiment, the electronic device may be a wearable device, and the external device is a mobile phone terminal having a communication connection relationship with the wearable device. When the characters are required to be displayed through the wearable device, the wearable device can acquire the character display file from the mobile phone terminal, and display the characters according to the character display file.
In an alternative embodiment, determining a first character boundary position of a first character in a first solid image includes:
determining a scanning strategy;
Scanning the first solid-color image according to a scanning strategy to obtain a scanning result;
And determining the boundary position of the first character in the first solid-color image according to the scanning result.
The scanning strategy may include: progressive pixels, interlaced pixels or interlaced pixels, etc.
For example, assuming that the pixel value of the pixel point where the first character "4" is located is not 0 in the first solid-color image as shown in fig. 3, the pixel value of the pixel point where the pixel point other than the position where the first character "4" is located is 0, and the scanning policy is to scan the pixel point line by line, the electronic device may scan the ARGB value of the pixel point line by line, obtain the pixel values of the pixel point according to the ARGB value, and finally scan to obtain the pixel values of all the pixel points in the first solid-color image, and take the position where the pixel point where the pixel value on the rightmost side is not 0 in the first solid-color image as the boundary position of the first character.
In an alternative embodiment, determining a scanning strategy includes:
acquiring input scanning precision;
And determining a scanning strategy according to the scanning precision.
In this embodiment, the higher the scanning accuracy is, the slower the scanning speed is, so the user can determine the scanning accuracy according to the actual requirement, and then determine the scanning strategy according to the scanning accuracy. Wherein, a scanning precision corresponds to a plurality of scanning strategies. For example, the scanning precision of the progressive scanning pixel point and the progressive scanning pixel point is 100%, the scanning precision of the 1-line scanning pixel point and the 1-column scanning pixel point is 50%, and the scanning precision of the 2-line scanning pixel point and the 2-column scanning pixel point is 30%, then when the input scanning precision is 30%, the electronic device may scan the pixel points at 2 lines or 2 columns; when the input scanning accuracy is 100%, the electronic device can scan the pixel points row by row or column by column.
In an alternative embodiment, the method for obtaining the bitmap of the first character by taking the modulus of the first solid color image according to the modulus taking area includes:
Determining the modulus taking precision;
And taking the mode of the first solid-color image according to the mode taking area and the mode taking precision to obtain a bitmap of the first character.
In this embodiment, the electronic device may determine the modulus precision, and obtain the bitmap of the first character for the first solid-color image area according to the modulus region and the modulus precision. One modulo precision may correspond to multiple modulo strategies. The modulo policies may include progressive modulo, interlaced modulo, or bay modulo, and so on. The line-by-line die taking or column-by-column die taking corresponds to 100% of die taking precision, the 1-line die taking or 1-column die taking corresponds to 50% of die taking precision, and the 2-line die taking or 2-column die taking corresponds to 30% of die taking precision. Assuming that the modulus precision is 50%, the electronic device may acquire pixel values of valid pixel points in the modulus region every 1 row or every 1 column, to obtain a bitmap of the first character.
For example, assuming that the pixel value of the pixel point at the position where the first character "4" is located is not 0 in the first solid-color image as shown in fig. 4, the pixel value of the pixel point at the position other than the position where the first character "4" is located is 0, and the modulo precision is 50%, the electronic device may acquire the pixel value of the pixel point at the pixel value other than 0 in the modulo area every 1 row or every 1 column, to obtain the bitmap of the first character.
In an alternative embodiment, determining the modulus precision includes:
and determining the modulus taking precision according to the display capability of the character display device.
It will be appreciated that the character display device may be an electronic device as described above, with the display capabilities of the different character display devices being different. Based on this, the display capability of the character display device can be quantified, and the display capability of the character display device can be characterized by the corresponding capability evaluation value, wherein the better the display capability of the character display device is, the larger the capability evaluation value is. A mapping relationship between the capability assessment value and the modulo precision may also be set. When the modulus taking precision needs to be determined, a capability evaluation value corresponding to the display capability of the electronic equipment can be obtained, and the modulus taking precision is determined according to the mapping relation between the capability evaluation value and the modulus taking precision and the capability evaluation value.
Referring to fig. 5, fig. 5 is a second flowchart of a character display method according to an embodiment of the application, where the flowchart may include:
in 201, a first solid image including a first character is acquired.
In 202, a second solid image is acquired that includes a first character and a second character, the first character and the second character being displayed in a specified order in the second solid image.
In 203, a first character boundary position of the first character in the first solid image is determined, and a second character boundary position of the first character and the second character in the second solid image is determined.
In 204, a difference in the positions of the first character boundary position and the second character boundary position in the image coordinate system is determined.
At 205, a font adjustment value for the second character relative to the first character is obtained based on the position difference.
In 206, a list of word distance adjustment values is obtained based on the word distance adjustment values of the second character relative to the first character.
In 207, a first boundary and a second boundary of the first character in the first solid image in the X-axis direction of the image coordinate system are determined.
In 208, third and fourth boundaries of the first character in the first solid image in the Y-axis direction of the image coordinate system are determined.
In 209, the region bounded by the first boundary, the second boundary, the third boundary, and the fourth boundary is determined as a modulo region.
At 210, the first solid image is modulo according to the modulo area to obtain a bitmap of the first character.
At 211, the character display file is formed by encapsulation according to the bitmap of the first character and the list of the word distance adjustment values .
In 212, a bitmap of the character to be displayed is obtained from the character display file, the character to be displayed comprising at least two characters.
In 213, a list of word distance adjustment values is obtained from the character display file.
In 214, a font distance adjustment value between two adjacent characters in the characters to be displayed is determined according to the font distance adjustment value table.
In 215, the character to be displayed is displayed based on the bitmap of the character to be displayed and the adjusted value of the word distance between two adjacent characters in the character to be displayed.
It will be appreciated that the specific implementation of steps 201 to 215 may be referred to the previous embodiments, and will not be repeated here.
It will be appreciated that in the actual process, the foregoing steps are not in a strict time-limited order, and that the order of some steps may be interchanged on the premise of achieving the same technical effect of the present application.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a character display device according to an embodiment of the application. The character display device 300 includes: a bitmap acquisition module 301, an adjustment value table acquisition module 302, an adjustment value determination module 303 and a character display module 304.
The bitmap obtaining module 301 is configured to obtain a bitmap of a character to be displayed, where the character to be displayed includes at least two characters.
The adjustment value table obtaining module 302 is configured to obtain a word distance adjustment value table, where the word distance adjustment value table includes a word distance adjustment value between two characters, the word distance adjustment value table is determined according to a character boundary position of a single character in a first solid color image and a character boundary position of two characters in a second solid color image, and the two characters include the single character in the first solid color image.
And the adjustment value determining module 303 is configured to determine a word distance adjustment value between two adjacent characters in the characters to be displayed according to the word distance adjustment value table.
The character display module 304 is configured to display the character to be displayed based on the bitmap of the character to be displayed and a word distance adjustment value between two adjacent characters in the character to be displayed.
In an alternative embodiment, the character-distance adjustment value table is determined by the external device according to the character boundary positions of the single character in the first solid image and the character boundary positions of the two characters in the second solid image.
In an alternative embodiment, the adjustment value table acquisition module 302 may be configured to: acquiring a first solid image comprising the first character; acquiring a second solid-color image comprising the first character and the second character, wherein the first character and the second character are displayed in the second solid-color image according to a specified sequence; determining a first character boundary position of the first character in the first solid image, and determining a second character boundary position of the first character and the second character in the second solid image; determining a position difference between the first character boundary position and the second character boundary position in an image coordinate system; obtaining a word distance adjustment value of the second character relative to the first character according to the position difference value; and obtaining the word distance adjustment value table according to the word distance adjustment value of the second character relative to the first character.
In an alternative embodiment, the bitmap acquisition module 301 may be configured to: determining a boundary of the first character; determining a modulus taking area of the first character according to the boundary; and performing mould extraction on the first solid-color image according to the mould extraction area to obtain a bitmap of the first character.
In an alternative embodiment, the bitmap acquisition module 301 may be configured to: determining a first boundary and a second boundary of the first character in the X-axis direction of the image coordinate system in the first solid image; determining a third boundary and a fourth boundary of the first character in the Y-axis direction of the image coordinate system in the first solid image; and determining the area enclosed by the first boundary, the second boundary, the third boundary and the fourth boundary as the modulus taking area.
In an alternative embodiment, the character display device 300 may further include a file encapsulation module, which may be used to: according to the bitmap of the first character and the character distance adjustment value table, packaging to form a character display file;
The bitmap acquisition module 301 may be configured to: acquiring a bitmap of a character to be displayed from the character display file;
The adjustment value table acquisition module 302 may be configured to: and acquiring a word distance adjustment value table from the character display file.
In an alternative embodiment, the bitmap acquisition module 301 may be configured to: determining the modulus taking precision; and performing die extraction on the first solid-color image according to the die extraction area and the die extraction precision to obtain a bitmap of the first character.
In an alternative embodiment, the bitmap acquisition module 301 may be configured to: and determining the modulus taking precision according to the display capability of the character display device.
In an alternative embodiment, the adjustment value table acquisition module 302 may be configured to: determining a scanning strategy; scanning the first solid-color image according to the scanning strategy to obtain a scanning result; and determining a first character boundary position of the first character in the first solid-color image according to the scanning result.
In an alternative embodiment, the adjustment value table acquisition module 302 may be configured to: acquiring input scanning precision; and determining a scanning strategy according to the scanning precision.
An embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed on a computer, causes the computer to execute the character display method as provided in the present embodiment.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the processor is used for executing the character display method provided by the embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the application.
The electronic device 400 may include a memory 401, a processor 402, and an output unit 403, among other components. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 7 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
Memory 401 may be used to store applications and data. The memory 401 stores an application program including executable code. Applications may constitute various functional modules. The processor 402 executes various functional applications and data processing by running application programs stored in the memory 401.
The processor 402 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing application programs stored in the memory 401 and calling data stored in the memory 401, thereby performing overall monitoring of the electronic device.
The output unit 403 may be used to display information input by a user or information provided to a user and various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video and any combination thereof. The output unit may include a display panel.
In this embodiment, the processor 402 in the electronic device loads executable codes corresponding to the processes of one or more application programs into the memory 401 according to the following instructions, and the processor 402 executes the application programs stored in the memory 401, so as to implement the flow:
Acquiring a bitmap of characters to be displayed, wherein the characters to be displayed comprise at least two characters;
acquiring a character distance adjustment value table, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters comprise the single characters in the first solid-color image;
According to the character distance adjustment value table, determining a character distance adjustment value between two adjacent characters in the characters to be displayed;
And displaying the character to be displayed based on the bitmap of the character to be displayed and the character distance adjustment value between two adjacent characters in the character to be displayed.
In an alternative embodiment, the character-distance adjustment value table is determined by the external device according to the character boundary positions of the single character in the first solid image and the character boundary positions of the two characters in the second solid image.
In an alternative embodiment, the single character includes a first character, the two characters include the first character and a second character, and before the processor 401 executes the obtaining the bitmap of the character to be displayed, the processing may further execute: acquiring a first solid image comprising the first character; acquiring a second solid-color image comprising the first character and the second character, wherein the first character and the second character are displayed in the second solid-color image according to a specified sequence; determining a first character boundary position of the first character in the first solid image, and determining a second character boundary position of the first character and the second character in the second solid image; determining a position difference between the first character boundary position and the second character boundary position in an image coordinate system; obtaining a word distance adjustment value of the second character relative to the first character according to the position difference value; and obtaining the word distance adjustment value table according to the word distance adjustment value of the second character relative to the first character.
In an alternative embodiment, after the processor 401 executes the capturing the first solid image including the first character, it may further execute: determining a boundary of the first character; determining a modulus taking area of the first character according to the boundary; and performing mould extraction on the first solid-color image according to the mould extraction area to obtain a bitmap of the first character.
In an alternative embodiment, the processor 401 executing the determining the boundary of the first character may execute: determining a first boundary and a second boundary of the first character in the X-axis direction of the image coordinate system in the first solid image; determining a third boundary and a fourth boundary of the first character in the Y-axis direction of the image coordinate system in the first solid image; when the processor 401 executes the determining the modulo area of the first character according to the boundary, the method may be performed: and determining the area enclosed by the first boundary, the second boundary, the third boundary and the fourth boundary as the modulus taking area.
In an alternative embodiment, the processor 401 may further perform: according to the bitmap of the first character and the character distance adjustment value table, packaging to form a character display file; when the processor 401 executes the obtaining the bitmap of the character to be displayed, it may execute: acquiring a bitmap of a character to be displayed from the character display file; when the processor 401 executes the obtained word distance adjustment value table, it may execute: and acquiring a word distance adjustment value table from the character display file.
In an alternative embodiment, when the processor 401 performs the modulo operation on the first solid image according to the modulo area to obtain the bitmap of the first character, the method may be performed: determining the modulus taking precision; and performing die extraction on the first solid-color image according to the die extraction area and the die extraction precision to obtain a bitmap of the first character.
In an alternative embodiment, when the processor 401 executes the determining the modulo progress, it may execute: and determining the modulus taking precision according to the display capability of the character display device.
In an alternative embodiment, when the processor 401 executes the determining the first character boundary position of the first character in the first solid image, it may execute: determining a scanning strategy; scanning the first solid-color image according to the scanning strategy to obtain a scanning result; and determining a first character boundary position of the first character in the first solid-color image according to the scanning result.
In an alternative embodiment, when the processor 401 executes the determined scanning strategy, it may execute: acquiring input scanning precision; and determining a scanning strategy according to the scanning precision.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of a certain embodiment that are not described in detail may be referred to the detailed description of the character display method, which is not repeated herein.
The character display device provided by the embodiment of the present application belongs to the same concept as the character display method in the above embodiment, and any method provided in the character display method embodiment may be run on the character display device, and the specific implementation process is detailed in the character display method embodiment, which is not described herein.
It should be noted that, for the character display method according to the embodiment of the present application, it will be understood by those skilled in the art that all or part of the flow of implementing the character display method according to the embodiment of the present application may be implemented by controlling related hardware through a computer program, where the computer program may be stored in a computer readable storage medium, such as a memory, and executed by at least one processor, and the execution may include the flow of the embodiment of the character display method as described in the embodiment of the present application. The computer readable storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), etc.
For the character display device according to the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist alone physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated module, if implemented as a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium such as read-only memory, magnetic or optical disk, etc.
The above description of the character display method, the device, the storage medium and the electronic equipment provided by the embodiment of the application applies specific examples to describe the principle and the implementation of the application, and the description of the above embodiments is only used for helping to understand the method and the core idea of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (13)

1. A character display method, comprising:
Acquiring a bitmap of characters to be displayed, wherein the characters to be displayed comprise at least two characters;
acquiring a character distance adjustment value table, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters comprise the single characters in the first solid-color image;
According to the character distance adjustment value table, determining a character distance adjustment value between two adjacent characters in the characters to be displayed;
And displaying the character to be displayed based on the bitmap of the character to be displayed and the character distance adjustment value between two adjacent characters in the character to be displayed.
2. The character display method according to claim 1, wherein the character spacing adjustment value table is determined by an external device based on character boundary positions of individual characters in the first solid image and character boundary positions of two characters in the second solid image.
3. The character display method according to claim 1 or 2, wherein the single character includes a first character, the two characters include the first character and a second character, and further comprising, before the obtaining of the bitmap of the character to be displayed:
acquiring a first solid image comprising the first character;
Acquiring a second solid-color image comprising the first character and the second character, wherein the first character and the second character are displayed in the second solid-color image according to a specified sequence;
determining a first character boundary position of the first character in the first solid image, and determining a second character boundary position of the first character and the second character in the second solid image;
Determining a position difference between the first character boundary position and the second character boundary position in an image coordinate system;
obtaining a word distance adjustment value of the second character relative to the first character according to the position difference value;
And obtaining the word distance adjustment value table according to the word distance adjustment value of the second character relative to the first character.
4. The character display method according to claim 3, wherein after the acquisition of the first solid image including the first character, further comprising:
Determining a boundary of the first character;
determining a modulus taking area of the first character according to the boundary;
And performing mould extraction on the first solid-color image according to the mould extraction area to obtain a bitmap of the first character.
5. The character display method according to claim 4, wherein the determining the boundary of the first character includes:
Determining a first boundary and a second boundary of the first character in the X-axis direction of the image coordinate system in the first solid image;
Determining a third boundary and a fourth boundary of the first character in the Y-axis direction of the image coordinate system in the first solid image;
the determining the modulo area of the first character according to the boundary comprises the following steps:
and determining the area enclosed by the first boundary, the second boundary, the third boundary and the fourth boundary as the modulus taking area.
6. The character display method according to claim 4, characterized in that the method further comprises:
according to the bitmap of the first character and the character distance adjustment value table, packaging to form a character display file;
the obtaining the bitmap of the character to be displayed comprises the following steps:
acquiring a bitmap of a character to be displayed from the character display file;
the step of obtaining the word distance adjustment value table comprises the following steps:
And acquiring a word distance adjustment value table from the character display file.
7. The method of claim 4, wherein said modulo the first solid image according to the modulo area to obtain a bitmap of the first character comprises:
Determining the modulus taking precision;
and performing die extraction on the first solid-color image according to the die extraction area and the die extraction precision to obtain a bitmap of the first character.
8. The character display method according to claim 7, wherein the determining the modulo progress comprises:
and determining the modulus taking precision according to the display capability of the character display device.
9. A character display method according to claim 3, wherein the determining a first character boundary position of the first character in the first solid image comprises:
determining a scanning strategy;
scanning the first solid-color image according to the scanning strategy to obtain a scanning result;
and determining a first character boundary position of the first character in the first solid-color image according to the scanning result.
10. The character display method according to claim 9, wherein the determining a scanning policy includes:
acquiring input scanning precision;
And determining a scanning strategy according to the scanning precision.
11. A character display device, comprising:
The bitmap acquisition module is used for acquiring a bitmap of characters to be displayed, wherein the characters to be displayed comprise at least two characters;
The device comprises an adjustment value table acquisition module, a character distance adjustment value table acquisition module and a character distance adjustment module, wherein the character distance adjustment value table comprises character distance adjustment values between two characters, the character distance adjustment value table is determined according to character boundary positions of single characters in a first solid-color image and character boundary positions of two characters in a second solid-color image, and the two characters comprise the single characters in the first solid-color image;
The adjustment value determining module is used for determining the word distance adjustment value between two adjacent characters in the characters to be displayed according to the word distance adjustment value table;
and the character display module is used for displaying the characters to be displayed based on the bitmap of the characters to be displayed and the character distance adjustment value between two adjacent characters in the characters to be displayed.
12. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to perform the character display method according to any one of claims 1 to 10.
13. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, and wherein the processor is configured to execute the character display method according to any one of claims 1 to 10 by calling the computer program stored in the memory.
CN202211537781.9A 2022-12-01 2022-12-01 Character display method and device, storage medium and electronic equipment Pending CN118133776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211537781.9A CN118133776A (en) 2022-12-01 2022-12-01 Character display method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211537781.9A CN118133776A (en) 2022-12-01 2022-12-01 Character display method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN118133776A true CN118133776A (en) 2024-06-04

Family

ID=91238262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211537781.9A Pending CN118133776A (en) 2022-12-01 2022-12-01 Character display method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN118133776A (en)

Similar Documents

Publication Publication Date Title
CN109978972B (en) Method and device for editing characters in picture
CN110321788B (en) Training data processing method, device, equipment and computer readable storage medium
US11551392B2 (en) Graphic drawing method and apparatus, device, and storage medium
CN111476852B (en) Reader refresh method, computing device, and computer storage medium
US20130215045A1 (en) Stroke display method of handwriting input and electronic device
CN111915705A (en) Picture visual editing method, device, equipment and medium
CN107122104B (en) Data display method and device
CN110471700B (en) Graphic processing method, apparatus, storage medium and electronic device
CN102576296A (en) Vector-based magnified pointer
CN105389308B (en) Webpage display processing method and device
CN112449230B (en) Character string display processing method, device, terminal and storage medium
CN112435634A (en) Image display method, image display apparatus, and readable storage medium
US20050162427A1 (en) Font processor, terminal device, font processing method, and font processing program
CN118133776A (en) Character display method and device, storage medium and electronic equipment
CA1200025A (en) Graphic and textual image generator for a raster scan display
CN113096217B (en) Picture generation method and device, electronic equipment and storage medium
US9229608B2 (en) Character display apparatus, character display method, and computer readable medium
CN113867862B (en) List page layout method and computing device
EP3929871A1 (en) Picture processing method, picture set processing method, computer device, and storage medium
CN111079771B (en) Method, system, terminal equipment and storage medium for extracting characteristics of click-to-read image
CN113934500A (en) Rendering method, rendering device, storage medium and electronic equipment
CN114518859A (en) Display control method, display control device, electronic equipment and storage medium
CN109643222B (en) Layout element processing method, device, storage medium and electronic equipment/terminal/server
CN111401165A (en) Station caption extraction method, display device and computer-readable storage medium
CN113721818B (en) Image processing method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination