Character display method and device, electronic equipment and readable storage medium
By building a personalized font library, standardized fonts are generated based on the objects that users copy from their handwriting, solving the problem of unattractive handwriting in existing technologies and improving display effects and coverage.
Patent Information
- Application Number
- CN202511385037.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-01-09
AI Technical Summary
The existing text display methods of electronic devices cannot meet the aesthetic needs of different groups of people. Professional font libraries are expensive and have limited coverage, and users' handwritten fonts are not aesthetically pleasing, resulting in poor display effects.
By identifying the constituent units of a user's handwritten font and their unit information, a personalized font library is built, generating standardized handwritten fonts based on the user's copying objects, thereby improving the display effect.
It achieves beautification based on the user's handwritten font, improves the display effect of handwritten text, covers more text, has a low operating threshold, and is highly flexible.
Smart Images

Figure CN121300680A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic equipment technology, specifically relating to a text display method, device, electronic equipment, and readable storage medium. Background Technology
[0002] With the rapid development of society, various touch display devices have emerged based on users' handwriting needs, such as electronic writing tablets, electronic whiteboards, or touch drawing boards, which can display users' handwritten text on electronic devices.
[0003] However, some users' handwriting may not be aesthetically pleasing, resulting in poor display of handwritten text on electronic devices. Summary of the Invention
[0004] The purpose of this application is to provide a text display method, apparatus, electronic device, and readable storage medium that can improve the display effect of user-written text.
[0005] In a first aspect, embodiments of this application provide a text display method, which includes: receiving a first input from a user; and in response to the first input, displaying the input text corresponding to the first input according to a first personalized font library; wherein the first personalized font library is determined based on the font of the first font being copied by the user.
[0006] Secondly, embodiments of this application provide a text display device, which includes: a receiving module and a display module; the receiving module is used to receive a first input from a user; the display module is used to respond to the first input received by the receiving module and display the input text corresponding to the first input according to a first personalized font library; wherein, the first personalized font library is determined based on the font of the object to which the user imitates the first font.
[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.
[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0011] In this embodiment, the electronic device receives a first input from a user; in response to the first input, it displays the input text corresponding to the first input according to a first personalized font library; wherein, the first personalized font library is determined based on the font of the object the user is imitating for the first font. Thus, since the first personalized font library, based on the font of the object the user is imitating for the first font, can standardize the user's handwriting during the imitation process, when the electronic device receives the user's input text, it can select a standardized handwritten font from the personalized font library as the displayed handwritten font, thereby improving the aesthetics of the user's handwriting and thus enhancing the display effect of the user's handwritten text. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of a text display method provided in an embodiment of this application;
[0013] Figure 2 This is a schematic diagram illustrating an example of text processing provided in an embodiment of this application;
[0014] Figure 3 This is a schematic diagram of the structure of a text display device provided in an embodiment of this application;
[0015] Figure 4 This is a schematic diagram of the structure of a text display device provided in an embodiment of this application;
[0016] Figure 5 This is one of the hardware structure diagrams of an electronic device provided in the embodiments of this application;
[0017] Figure 6 This is a second schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0019] The following explains some terms and nouns used in the embodiments of this application.
[0020] 1) Computer font technology: contains a set of electronic data files of glyphs and characters used to display text on the screen of electronic devices.
[0021] 2) Stylus technology: Stylus input commands to the touchscreen of electronic devices, allowing users to select documents and write by tapping the touchscreen with the stylus.
[0022] 3) The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0023] 4) The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."
[0024] 5) The identifiers in this application are text, symbols, images, etc. used to indicate information, and may be used as carriers for displaying information in the form of identifiers or other containers, including but not limited to text identifiers, image identifiers, symbol identifiers, etc.
[0025] It should be noted that the text display method provided in this application can be executed by electronic devices such as mobile phones, tablets, laptops, PDAs, and in-vehicle electronic devices. Some embodiments of this application use electronic devices as the executing entity to illustrate the text display method provided in this application.
[0026] In related technologies, existing text display methods may have the following technical problems:
[0027] 1. The fonts displayed on electronic devices cannot meet the aesthetic needs of different groups of people. Ordinary people find it difficult to create their own font libraries and can only download fonts created by professionals from the internet.
[0028] 2. Currently, handwritten font libraries on the market rely on professional calligraphers to write characters one by one, which are then entered and packaged into a font library using software. Due to the high production cost, these font libraries usually only cover commonly used characters. In actual use, if uncommon characters are encountered, the text will be converted to a basic Song typeface, resulting in poor text display, an unattractive appearance, and potentially readability issues.
[0029] 3. Users typically use a stylus to handwrite notes on electronic devices; however, the writer's handwriting skill determines the aesthetics of the notes. People with poor handwriting hope to produce beautiful notes, but their limited skills make this difficult. Furthermore, existing handwriting font libraries do not contain the fonts users desire, resulting in text display effects that fail to meet user expectations.
[0030] To address this, this application provides a method for intelligently constructing a font library, which is a personalized handwritten font library generated by a user copying a particular font. In this method, the system identifies the character components and their information after deconstructing the user's handwritten font. Based on these character components and their information, a handwritten font library with strokes or radicals is constructed. Thus, after the user inputs text, the electronic device obtains the character components and their information from the constructed font library to assemble the corresponding character. This method has a low barrier to entry, making it usable by ordinary people. Furthermore, because it can use various basic strokes and radicals to generate characters, the font library covers a more comprehensive range of characters, ensuring no rare or obscure characters are missed.
[0031] The text display method, apparatus, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0032] The text display method provided in this application can be implemented by a text display device. Exemplarily, the text display device can be an electronic device, or a component within that electronic device, such as an integrated circuit or a chip. The text display method provided in this application will be described executively below using an electronic device as an example.
[0033] This application provides a text display method. Figure 1 A flowchart illustrating a text display method provided in an embodiment of this application is shown, which can be applied to electronic devices. For example... Figure 1 As shown, the text display method provided in this application embodiment may include the following steps 201 and 202.
[0034] Step 201: The electronic device receives the user's first input.
[0035] In some embodiments of this application, the above-mentioned electronic device is an electronic device with touch function.
[0036] For example, the aforementioned electronic device may be a touch screen phone, a touch screen writing tablet, or an electronic whiteboard, etc.
[0037] In some embodiments of this application, the first input described above is handwritten input by the user on an electronic device.
[0038] In some embodiments of this application, the first input mentioned above includes input of N characters handwritten by the user, where N is a positive integer.
[0039] For example, an electronic device receives handwritten input from a user using a stylus on the display screen of the electronic device, the handwritten input including text written by the user, such as "The bright moonlight shines before my window".
[0040] It should be noted that, in the embodiments of this application, a character is composed of character constituent units, wherein the character constituent units include strokes, radicals and characters.
[0041] Step 202: The electronic device responds to the first input and displays the input text corresponding to the first input according to the first personalized font library.
[0042] In some embodiments of this application, the first personalized font library mentioned above includes at least one of the following: strokes, radicals, and characters.
[0043] In some embodiments of this application, the first personalized font library described above corresponds to a personalized font.
[0044] For example, the personalized font mentioned above is a font generated based on a tracing font input by the user.
[0045] In some embodiments of this application, the aforementioned first personalized font library is determined based on the font that the user imitates from the object of imitation of the first font.
[0046] In some embodiments of this application, the first font is a font preset by the electronic device, such as KaiTi, SongTi, HeiTi, or LiShu, and this application does not impose any restrictions.
[0047] In some embodiments of this application, the objects to be copied include at least one of the following: strokes, radicals, and characters.
[0048] For example, before creating a personalized font library, the electronic device can display a text that covers commonly used characters, strokes, or radicals, i.e., the aforementioned tracing object. The electronic device determines the personalized font library based on the font that the user traces in this text.
[0049] Exemplarily, before establishing a personalized font library, the electronic device may display different common characters, or common strokes, or common radicals, that is, the above-mentioned copying objects. The electronic device determines the personalized font library according to the copied fonts of the user's copied common characters, or common strokes, or common radicals.
[0050] In some embodiments of the present application, in response to a first input, the electronic device matches the corresponding character composition units in the first personalized font library according to the characters corresponding to the user's first input, and then the electronic device generates the characters corresponding to the first input of the personalized font based on the matched character composition units.
[0051] In some embodiments of the present application, the electronic device obtains the feature information of the character composition units of each character in the characters corresponding to the user's first input, compares the feature information of the character composition units in the first personalized font library with the feature information of the character composition units of each character in the characters corresponding to the user's first input respectively, and determines the character composition unit with the highest similarity as the matched character composition unit, so as to generate the characters corresponding to the first input of the personalized font.
[0052] Exemplarily, the electronic device may adopt an optical character recognition model to recognize the corresponding character composition units in the first personalized font library.
[0053] In some embodiments of the present application, the electronic device generates and displays the first characters of N first personalized fonts based on the character composition units of each first character, the unit information corresponding to each character composition unit, and the first personalized font library.
[0054] In some embodiments of the present application, the above-mentioned first character is one of the N characters corresponding to the first input.
[0055] In some embodiments of the present application, the above-mentioned character composition units include at least one of the following: the font strokes of each first character, the font radicals of each first character.
[0056] Correspondingly, the unit information corresponding to the font character composition unit of each first character and its unit information is the stroke order, and the unit information corresponding to the font radical of each first character is the radical position of the font radical.
[0057] In some embodiments of the present application, the above-mentioned font radical is a character-forming unit composed of strokes and having the function of combining Chinese characters.
[0058] For example, wood, heart, mouth, also, main, イ, or リ.
[0059] In some embodiments of the present application, the radical position of the above-mentioned font radical is the position where the radical is located in the character.
[0060] For example, the radical position of the font radical "氵" in the character "江" is on the left side.
[0061] In some embodiments of the present application, the above font strokes are the smallest writing units that make up Chinese characters.
[0062] For example, 一 (horizontal), 丨 (vertical), (folding), 乙 (horizontal fold and hook).
[0063] In some embodiments of the present application, the above stroke order can be understood as the pen form of the stroke, that is, the specific form of the stroke.
[0064] For example, the stroke order of the stroke "乙" is "horizontal fold and hook".
[0065] In some embodiments of the present application, the electronic device deconstructs each first character to obtain the character composition units of each first character of the first font and their corresponding unit information.
[0066] For example, taking the character "江" as an example, the electronic device deconstructs the character "江", that is, the above first character, and obtains that the font radical of "江" is: 氵, 工; the strokes of "江" are: dot, dot, lift, horizontal, vertical, horizontal. It can be understood that the strokes of the character are obtained according to the stroke order.
[0067] In some embodiments of the present application, the electronic device determines the font library of the font according to the user-selected personalized font, such as the personalized font library of the above first personalized font.
[0068] Exemplarily, one or more personalized font libraries can be pre-stored in the electronic device, and the present application does not make any restrictions.
[0069] In a possible embodiment, when the electronic device obtains the font radical and the radical position of the font radical of each first character in the N characters handwritten by the user, the electronic device can first detect whether there is a font radical of the first personalized font in the first personalized font library that corresponds one by one to all the font radicals of the first character.
[0070] If all the font radicals of the first character exist in the first personalized font library, then a first character of the first personalized font is generated according to all the font radicals of the first character obtained from the font library.
[0071] If all the font radicals of the first character do not exist in the first personalized font library, then obtain the font strokes and stroke order of the first character, and then obtain the font strokes of the first personalized font that correspond one by one to the font strokes of the first character from the font library, and generate a first character of the first personalized font according to the font strokes of the first personalized font and the stroke order of the first character.
[0072] If there are partial font radicals of the first character in the first personalized font library, further obtain the font strokes and stroke orders of the other non-existent font radicals, and then obtain the font strokes of the personalized font corresponding one by one to the font strokes of the other non-existent font radicals from the font library. And generate the first character of the personalized font according to the font strokes of the personalized font, the partial font radicals of the personalized font, the stroke order of the first character, and the radical positions of the partial font radicals.
[0073] For example, taking the first character "江" in the N characters handwritten by the user as an example, the electronic device deconstructs the first character "江" and obtains the font radicals of "江" as: 氵, 工; If it is detected that both font radicals exist in the first personalized font library, directly form the official script "江" with the "氵, 工" of the personalized font. If both font radicals are not detected in the first personalized font library, further obtain the font strokes of "江": "dot, dot, tick, horizontal, vertical, horizontal", and then obtain the font strokes of the personalized font from the first personalized font library according to the font strokes of "江": "dot, dot, tick, horizontal, vertical, horizontal", and form the "江" of the personalized font. If only the font radical "氵" is detected in the first personalized font library and "工" is not detected, further obtain the font strokes of "工": "horizontal, vertical, horizontal", and then obtain the font strokes of the personalized font from the first personalized font library according to the font strokes of "工": "horizontal, vertical, horizontal", and then form the "江" of the personalized font according to the "氵" of the personalized font and the "horizontal, vertical, horizontal" of the personalized font.
[0074] In a possible embodiment, when the electronic device obtains the font strokes and stroke orders of each first character in the N characters handwritten by the user, the electronic device directly searches for the corresponding font strokes one by one from the first personalized font library based on all the font strokes to form the first character of the personalized font.
[0075] For example, taking the first character "江" in the characters input by the user as an example, the electronic device deconstructs the first character "江" and obtains the font strokes of "江": "dot, dot, tick, horizontal, vertical, horizontal", and then obtains the font strokes of the personalized font from the first personalized font library according to the font strokes of the regular script "江": "dot, dot, tick, horizontal, vertical, horizontal", and forms the "江" of the personalized font.
[0076] In this way, the electronic device queries the corresponding font radicals in the first personalized font library through the font radicals to form the characters of the first personalized font. Since the font radicals are the basic components of Chinese characters, generally any Chinese character can be composed of different font radicals, so as to ensure that when the font is converted, the corresponding characters can be obtained from the font library.
[0077] In the text display method provided in the embodiments of the present application, the electronic device receives the first input from the user; in response to the first input, the input text corresponding to the first input is displayed according to the first personalized font library; wherein, the first personalized font library is determined according to the copied font of the copying object of the first font by the user. In this way, since the first personalized font library is based on the copied font of the copying object of the first font by the user, the user's handwritten font can be standardized during the copying process. Therefore, when the text input by the user is received, the electronic device can select the handwritten font with standardized handwriting from the personalized font library as the displayed handwritten font, thereby improving the beautification degree of the user's handwritten font and further improving the display effect of the user's handwritten text.
[0078] Optionally, in some embodiments of the present application, the text display method provided in the embodiments of the present application further includes step 301.
[0079] Step 301: The electronic device determines the copied font according to the copied content of the copying object of the first font by the user.
[0080] In some embodiments of the present application, the above-mentioned copied content includes but is not limited to: a piece of text, font strokes, and font radicals. [[ID=1'3]]
[0081] Exemplarily, the above-mentioned piece of text can be a standard model essay provided by the electronic device. Exemplarily, the electronic device can provide a standard model essay, and the standard model essay includes multiple common characters.
[0082] For example, taking the standard model essay "Before my bed a pool of light, I wonder if it's frost on the ground" as an example, the user can handwrite and copy "Before my bed a pool of light, I wonder if it's frost on the ground" on the electronic device with a stylus. Or taking the text sample "氵,亻,犭,丿,丶" as an example, the user can handwrite and copy "氵,亻,犭,丿,丶" on the electronic device with a stylus.
[0083] In some embodiments of the present application, the electronic device deconstructs each character in the copied content input by the user to generate the font strokes and font radicals corresponding to each character.
[0084] In a possible embodiment, if each character in the above-mentioned copied content is handwritten by the user and it is found during the deconstruction process that there are some connected strokes, the electronic device takes the entire connected stroke as one stroke and constructs the font library based on this, such as the stroke "氵".
[0085] For example, if the object to be copied by the user is a connected character in running script font, since the generated deconstructed strokes contain connected strokes, the beautified font style is more natural and unrestrained. Therefore, when the electronic device generates the copied font, it also generates connected radical components. Taking "lake" as an example, the three dots of the radical for "water" have connected strokes. When converting the fonts of "river" and "stream", the radicals also have connected strokes.
[0086] In some embodiments of the present application, the electronic device constructs a first personalized font library based on all the obtained font strokes and font radical components.
[0087] Exemplarily, the electronic device can be based on the "General Standard Chinese Character Table" and, according to the commonly used characters composed of existing stroke components in the font library, so as to find the corresponding characters more quickly and save the time for composing characters.
[0088] In this way, the electronic device can select the corresponding font strokes and font radical components from the constructed font library containing font strokes and font radical components to form the characters input by the user, so that the font of the formed characters is a unified font, thereby improving the display effect of the characters.
[0089] Optionally, in some embodiments of the present application, the text display method provided by the embodiments of the present application further includes step 401 and step 402.
[0090] Step 401: The electronic device receives a second input from the user.
[0091] In some embodiments of the present application, the above second input is used to select a second personalized font library.
[0092] In some embodiments of the present application, the above second input includes a touch input by the user clicking on the font library control identifier, or a touch input on the display screen of the electronic device, or a voice command input by the user, or a specific gesture input by the user. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit it.
[0093] Exemplarily, the above touch input includes a sliding input or a click input by the user on the display screen of the electronic device, etc. The specific gesture in the embodiments of the present application can be any one of a single click gesture, a sliding gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double press gesture, and a double click gesture; the click input in the embodiments of the present application can be a single click input, a double click input, or a click input of any number of times, and the above click input can also be a long press input or a short press input.
[0094] In some embodiments of the present application, one of the above font library control identifiers corresponds to one personalized font library.
[0095] For example, the electronic device stores at least one personalized font library, each personalized font library corresponding to a font library control identifier. The electronic device determines the personalized font corresponding to the personalized font library to be displayed when the user selects a font library control identifier.
[0096] In some embodiments of this application, the aforementioned second personalized font library is determined based on the font that the user imitates from the object of imitation of the second personalized font.
[0097] Step 402: The electronic device responds to the second input and displays the input text according to the second personalized font library.
[0098] In some embodiments of this application, the electronic device responds to a second input, retrieves the corresponding second personalized font text from a second personalized font library based on the text input by the user, and displays it.
[0099] In some embodiments of this application, the electronic device responds to a second input by selecting and displaying the text that has the highest similarity to the text entered by the user from a second personalized font library.
[0100] For example, the text input by the user can be the text that the user is about to input, the text currently displayed, or the text that the user has already input; this application does not impose any restrictions.
[0101] In this way, electronic devices can convert the text entered by the user into different personalized fonts according to the user's selection, thus improving the flexibility and choice of personalized fonts.
[0102] Optionally, in some embodiments of this application, the text display method provided in the embodiments of this application further includes steps 501 and 502, or steps 501 and 503.
[0103] Step 501: The electronic device receives a third input from the user.
[0104] In some embodiments of this application, the third input is used to input text samples of a third font.
[0105] In some embodiments of this application, the text samples of the aforementioned third font can be imitation objects uploaded by the user.
[0106] In some embodiments of this application, the text corresponding to the third input is the user's copy of a text sample of a third font.
[0107] Step 502: The electronic device responds to the third input and displays a prompt message.
[0108] In some embodiments of this application, the above-mentioned prompt information is used to indicate missing stroke examples, radical examples, and / or character examples.
[0109] For example, the above prompts may include "Insufficient text input" or "Lack of common strokes," etc.
[0110] For example, the above prompt message can be displayed floating on the display screen, or it can be an updated display interface; this application does not impose any restrictions.
[0111] In some embodiments of this application, after the above prompt information is displayed, the electronic device will provide other text samples for the user to copy, or the user can upload more text samples for copying.
[0112] Step 503: The electronic device responds to the third input and creates a third personalized font library based on the text sample of the third font.
[0113] In some embodiments of this application, the electronic device deconstructs each character in the text sample of the third font input by the user, and generates the font strokes and font radicals corresponding to each character.
[0114] In some embodiments of this application, the electronic device constructs a third personalized font library based on all the acquired font strokes and font radicals.
[0115] For example, electronic devices can use the "General Standard Character List" to find commonly used characters with existing stroke components in a third personalized font library more quickly, saving time in composing characters.
[0116] In one example, the electronic device displays a text sample of a third font uploaded by the user, which the user then uses to copy the text. The electronic device then detects the user's copy and if it detects a lack of common characters, strokes, or radicals, it displays a message informing the user that they can then choose to upload other text samples to enrich the text content for creating a second personalized font library.
[0117] In another example, the electronic device displays a tracing object based on a text sample of a third font uploaded by the user. The user then traces the tracing object, and the electronic device further breaks down the text sample and generates more commonly used characters according to the "General Standard Character List" to create a second personalized font library.
[0118] In this way, on the one hand, users can flexibly upload their favorite fonts for copying, enabling the electronic device to create a personalized font library based on the copied fonts by the users. On the other hand, when the text in the text sample is lacking, the electronic device can guide the user to add copied content or form common characters by itself to create a personalized font library, so as to ensure that the font content in the personalized font library can cover the existing characters sufficiently, and further ensure that the fonts of the characters input by the user can be converted into unified fonts.
[0119] Optionally, in some embodiments of the present application, the text display method provided by the embodiments of the present application further includes step 601 and step 602.
[0120] Step 601: The electronic device optimizes the copied font according to the copying object of the first font.
[0121] Step 602: The electronic device creates a first personalized font library according to the optimized copied font.
[0122] In some embodiments of the present application, the electronic device optimally adjusts the copied font input by the user according to the copying object of the first font.
[0123] Exemplarily, the electronic device can identify the feature information between the character 1 in the copying object of the first font and the corresponding character 1 in the copied font input by the user, and based on this feature information, adjust the character 1 in the copied font input by the user. For example, operations such as straightening the "丨" or leveling the "一" for beautification.
[0124] In some embodiments of the present application, the electronic device structures the characters corresponding to the beautified copied font, obtains the character composition units of these characters to create a first personalized font library.
[0125] It should be noted that the process of creating the first personalized font library can refer to the content in step 202 above, and will not be elaborated here.
[0126] In this way, creating a personalized font library based on the optimized copied font can effectively ensure the beauty of the generated personalized font library.
[0127] Optionally, in some embodiments of the present application, the above step 202 can be specifically implemented through the following step 202a.
[0128] Step 202a: In response to the first input, when the display style is associated with the first personalized font library, the electronic device displays the input text corresponding to the first input according to the font and display style of the first personalized font library.
[0129] In some embodiments of the present application, the above display style can be the default setting of the electronic device or the display style set by the user.
[0130] In some embodiments of the present application, the above display style is the display style of the first personalized font.
[0131] Exemplarily, the above display style may include but is not limited to: highlighting, font color, bold display, underlined display.
[0132] In some embodiments of the present application, when the electronic device displays the text input by the user, that is, the text corresponding to the first input, it displays the text corresponding to the first input of the first personalized font according to the display style associated with the first personalized font library.
[0133] For example, the user inputs "Before my bed a pool of light, I wonder if it's frost aground", and selects to convert the font of the input text into the personalized font in the first personalized font library. If the display style associated with the first personalized font library is highlighting, the electronic device highlights "Before my bed a pool of light, I wonder if it's frost aground" in the first personalized font.
[0134] In this way, the electronic device can directly distinguish and display the user's handwritten content, thereby improving the display effect of the handwritten document.
[0135] Optionally, in some embodiments of the present application, in the step of "the electronic device responds to the first input and displays the input text corresponding to the first input according to the first personalized font library" in step 202, the electronic device may first perform size normalization processing on N characters in the input text corresponding to the first input. For each of the N characters of the first personalized font, the electronic device may first determine the size of a first character. If the size of the first character is too large or too small, then the electronic device may perform the following step 202c1. If the size of the first character is normal, then perform the following step 202c2. It should be noted that in the embodiments of the present application, after the electronic device executes this process N times, it can obtain N characters of the first personalized font after normalization processing, and then execute step 202c3.
[0136] Step 202c1: When the first difference between the size of the second character and the target size is less than or equal to the preset difference, the electronic device adjusts the second character to the first size.
[0137] Step 202c2: When the first difference between the size of the second character and the target size is greater than the preset difference, the electronic device keeps the size of the second character unchanged.
[0138] In some embodiments of the present application, the above second character is any one of the N characters of the first personalized font, that is, any one of the characters corresponding to the first input.
[0139] In some embodiments of this application, the target size is the median size of all the characters in the N characters, or the target size is a preset size.
[0140] In some embodiments of this application, the median value mentioned above can be the median of the size of one character among N characters.
[0141] In some embodiments of this application, the above dimensions include the width and height of the text.
[0142] In some embodiments of this application, the electronic device can calculate the median width value (hereinafter referred to as the median width) of the characters in N characters and the median height value (hereinafter referred to as the median height) of the characters in N characters, and use the median width and median height as the target size.
[0143] In some embodiments of this application, the above-mentioned preset difference is the default setting of the electronic device, or it can be a user-defined setting.
[0144] In some embodiments of this application, the difference between the first dimension and the target dimension is less than a first difference, for example, the first difference is 0.
[0145] In some embodiments of this application, the electronic device detects the size of each of the N characters, namely the second character mentioned above, then obtains the target size, and adjusts each character to the size of the target size.
[0146] Step 202c3: The electronic device displays N texts in the first personalized font based on the second font.
[0147] In some embodiments of this application, N texts in a first personalized font are displayed based on a second text whose size is adjusted or remains unchanged.
[0148] In this way, since the size of the N first personalized fonts can be brought closer to the target size, the size difference between different fonts can be reduced, thus making the layout of the N first personalized fonts visually neater.
[0149] The following specific examples illustrate the text display method provided in the embodiments of this application.
[0150] Example 1: As Figure 2 As shown, the text display method may include the following steps A1 to A6.
[0151] Step A1: The electronic device receives the template text input by the user.
[0152] The above-mentioned sample text can be understood as the content of the copy of the object that the user copied.
[0153] For example, an electronic device can acquire input template text in the following two ways:
[0154] Method 1: Guide users to trace a sample text. These texts cover the most commonly used Chinese character components, strokes, and stroke shapes.
[0155] Method 2: Users upload their favorite calligraphy characters to trace, and the system checks whether the most commonly used Chinese character components, strokes, and stroke shapes are covered. If not, users are guided to upload more character examples and trace them.
[0156] Step A2: The electronic device parses the text structure in the template text.
[0157] For example, the above-mentioned text structure can be understood as the above-mentioned text components and their unit information, including three levels: radical, stroke, and stroke shape.
[0158] For example, an electronic device forms an element library, namely the aforementioned font library, by disassembling the structure of each character in a template text.
[0159] Step A3: The electronic device generates a handwritten font library.
[0160] For example, electronic devices can assemble a font library that includes commonly used characters, font radicals, and font strokes by using the various font radicals and strokes in the font library based on the "General Standard Chinese Characters List" published by the Ministry of Education.
[0161] It is understandable that when assembling handwritten text on an electronic device, it can first search the radical layer of the font library to see if there are any relevant radical elements. If so, it can be used; if not, it can be searched from the stroke layer, and so on.
[0162] Step A4: The electronic device detects content input in the handwriting area, namely the N characters entered by the user.
[0163] Step A5: The electronic device calls the Optical Character Recognition (OCR) model to detect and extract the text.
[0164] For example, electronic devices can use an OCR model to recognize handwritten content and extract Chinese characters and their positions from the recognition results.
[0165] Step A6: The electronic device calls the text from the built font library to replace the handwritten input.
[0166] For example, the electronic device retrieves the corresponding text from the font library based on the user's input, and then replaces the original handwriting in the handwriting area with text from multiple font libraries.
[0167] For example, electronic text display devices can be made to uniformly size each character according to its average size, horizontally centered, and with evenly distributed character spacing, thereby improving aesthetics.
[0168] In this way, when users use a stylus to write notes on electronic devices, the handwritten text can be automatically recognized and converted into a beautiful preset handwritten font. That is, the corresponding radicals and strokes are selected from the built font library to form another font, thereby improving the aesthetics of the text display.
[0169] Each of the above-described method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application does not impose any restrictions on this.
[0170] The text display method provided in this application can be executed by an electronic device or a text display device. This application uses a text display device as an example to illustrate the text display device provided in this application.
[0171] Figure 3 A schematic diagram of a possible structure of the text display device involved in an embodiment of this application is shown. For example... Figure 3 As shown, the text display device 700 may include a receiving module 701 and a display module 702.
[0172] The receiving module 701 is used to receive a first input from the user; the display module is used to respond to the first input received by the receiving module and display the input text corresponding to the first input according to a first personalized font library; wherein the first personalized font library is determined based on the font of the first font that the user imitates.
[0173] Optionally, in some embodiments of this application, combined with Figure 3 ,like Figure 4 As shown, the above-mentioned device 700 further includes: a processing module 703, which is used to determine the copying font based on the copying content of the first font by the user; wherein the copying object includes at least one of the following: strokes, radicals, and characters.
[0174] Optionally, in some embodiments of this application, the first personalized font library mentioned above includes at least one of the following: strokes, radicals, and characters.
[0175] Optionally, in some embodiments of this application, the receiving module 701 is further configured to receive a second input from the user; the second input is used to select a second personalized font library.
[0176] The display module 702 is further configured to respond to the second input received by the receiving module 701 and display the input text according to the second personalized font library; wherein the second personalized font library is determined based on the font of the object that the user imitates for the first personalized font.
[0177] Optionally, in some embodiments of this application, combined with Figure 3 ,like Figure 4 As shown, the above-mentioned device 700 further includes: a processing module 703; the above-mentioned receiving module 701 is also used to receive a third input from the user; the above-mentioned third input is used to input a text sample of a third font;
[0178] The aforementioned display module 702 is further configured to, in response to the aforementioned third input received by the aforementioned receiving module 701, display prompt information, wherein the prompt information is used to indicate missing stroke examples, radical examples, and / or character examples; or,
[0179] The processing module 703 is used to create a third personalized font library based on the text sample of the third font in response to the third input received by the receiving module 701.
[0180] Optionally, in some embodiments of this application, combined with Figure 3 ,like Figure 4 As shown, the above-mentioned device 700 further includes: a processing module 703; the processing module 703 is used to optimize the copied font according to the copying object of the first font; the processing module 703 is also used to create the first personalized font library according to the optimized copied font.
[0181] Optionally, in some embodiments of this application, the display module 702 is specifically used to respond to the first input received by the receiving module 701, and, in the case of the first personalized font library associated with the display style, display the input text corresponding to the first input according to the font of the first personalized font library and the display style.
[0182] In the text display device provided in this application embodiment, the text display device receives a first input from a user; in response to the first input, it displays the input text corresponding to the first input according to a first personalized font library; wherein, the first personalized font library is determined based on the tracing font of the object from which the user imitates the first font. Thus, since the first personalized font library, based on the tracing font of the object from which the user imitates the first font, can standardize the user's handwriting during the imitation process, when the text input by the user is received, the text display device can select the standardized handwriting font from the personalized font library as the displayed handwriting font, thereby improving the aesthetics of the user's handwriting and thus improving the display effect of the user's handwriting.
[0183] The text display device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0184] The text display device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0185] The text display device provided in this application embodiment can implement all the processes implemented in the text display method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0186] Optionally, such as Figure 5 As shown, this application embodiment also provides an electronic device 800, including a processor 801 and a memory 802. The memory 802 stores a program or instructions that can run on the processor 801. When the program or instructions are executed by the processor 801, they implement the various steps of the above-described text display method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0187] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0188] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0189] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
[0190] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0191] The user input unit 107 is used to receive a first input from a user; the display module is used to respond to the first input received by the receiving module and display the input text corresponding to the first input according to a first personalized font library; wherein the first personalized font library is determined based on the font of the first font that the user imitates.
[0192] Optionally, in some embodiments of this application, the processor 110 is further configured to determine the imitation font based on the imitation content of the imitation object of the first font by the user; wherein the imitation object includes at least one of the following: strokes, radicals, and characters.
[0193] Optionally, in some embodiments of this application, the first personalized font library mentioned above includes at least one of the following: strokes, radicals, and characters.
[0194] Optionally, in some embodiments of this application, the user input unit 107 is further configured to receive a second input from the user; the second input is used to select a second personalized font library.
[0195] The display unit 106 is further configured to respond to the second input received by the user input unit 107 and display the input text according to the second personalized font library; wherein the second personalized font library is determined based on the font of the object that the user imitates for the first personalized font.
[0196] Optionally, in some embodiments of this application, the user input unit 107 is further configured to receive a third input from the user; the third input is used to input a text sample of a third font.
[0197] The aforementioned display unit 106 is further configured to display prompt information in response to the third input received by the aforementioned user input unit 107, the prompt information being used to indicate missing stroke examples, radical examples, and / or character examples; or,
[0198] The processor 110 is also configured to create a third personalized font library based on the text sample of the third font in response to the third input received by the user input unit 107.
[0199] Optionally, in some embodiments of this application, the processor 110 is further configured to optimize the copied font according to the copying object of the first font; the processor 110 is further configured to create the first personalized font library according to the optimized copied font.
[0200] Optionally, in some embodiments of this application, the display unit 106 is specifically used to respond to the first input received by the user input unit 107, and, in the case of the first personalized font library associated display style, to display the input text corresponding to the first input according to the font of the first personalized font library and the display style.
[0201] In the electronic device provided in this application embodiment, the electronic device receives a first input from a user; in response to the first input, it displays the input text corresponding to the first input according to a first personalized font library; wherein, the first personalized font library is determined based on the tracing font of the object from which the user imitates the first font. Thus, since the first personalized font library, based on the tracing font of the object from which the user imitates the first font, can standardize the user's handwriting during the imitation process, when the electronic device receives the user's input text, it can select the standardized handwriting font from the personalized font library as the displayed handwriting font, thereby improving the aesthetics of the user's handwriting and thus improving the display effect of the user's handwriting.
[0202] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0203] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0204] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.
[0205] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described text display method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0206] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0207] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described text display method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0208] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0209] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the text display method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0210] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0211] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0212] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for displaying text, characterized in that, The method includes: Receive the user's first input; In response to the first input, the input text corresponding to the first input is displayed according to the first personalized font library; wherein, the first personalized font library is determined according to the font of the object to which the user imitates the first font.
2. The method according to claim 1, characterized in that, The method further includes: The font to be copied is determined based on the content of the copy of the object to be copied by the user; The objects to be copied include at least one of the following: strokes, radicals, and characters.
3. The method according to claim 1, characterized in that, The first personalized font library includes at least one of the following: strokes, radicals, and characters.
4. The method according to claim 1, characterized in that, The method further includes: Receive a second input from the user; the second input is used to select a second personalized font library; In response to the second input, the input text is displayed according to the second personalized font library; wherein the second personalized font library is determined based on the font that the user imitates from the object of the first personalized font.
5. The method according to claim 1, characterized in that, The method further includes: Receive a third input from the user; the third input is used to input a text sample in a third font; In response to the third input, a prompt message is displayed, which indicates the missing stroke examples, radical examples, and / or character examples; or, In response to the third input, a third personalized font library is created based on the text sample of the third font.
6. The method according to claim 2, characterized in that, The method further includes: Based on the object of the first font's imitation, the imitation font is optimized. The first personalized font library is created based on the optimized copy font.
7. The method according to claim 1, characterized in that, The step of responding to the first input and displaying the input text corresponding to the first input according to the first personalized font library includes: In response to the first input, and with the display style associated with the first personalized font library, the input text corresponding to the first input is displayed according to the font of the first personalized font library and the display style.
8. A text display device, characterized in that, The text display device includes: a receiving module and a display module; The receiving module is used to receive the user's first input; The display module is configured to respond to the first input received by the receiving module and display the input text corresponding to the first input according to a first personalized font library; wherein, the first personalized font library is determined based on the font of the first font being copied by the user.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the text display method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the text display method as described in any one of claims 1 to 7.