Text information rendering method, device, electronic device and storage medium
By obtaining a second font file that supports characters not supported by the current font file, the problem that the font file cannot support all characters is solved, and the rendering of all characters is realized, improving the rendering effect and user experience of text information.
Patent Information
- Application Number
- CN202111143113.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-09-28
AI Technical Summary
In the prior art, font files cannot support all characters, resulting in poor rendering of text information and reducing user experience.
By obtaining a second font file that supports characters not supported by the current font file, and displaying the rendering results in the display interface, the characters supported by the first font file are rendered and the characters not supported by the second font file are rendered.
It realizes rendering of all characters, enriches the rendering method of text information, and improves the rendering effect and user experience.
Smart Images

Figure CN113887167B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a text information rendering method, device, electronic device and storage medium. Background Art
[0002] With the popularization of electronic devices and the development of science and technology, multimedia social networking has been sought after by the public. Users can share multimedia information (videos or images) created and edited by themselves with others through the Internet. In the process of editing multimedia information, some text information can be edited in the content of the multimedia information. The edited text information can convey the creator's ideas to the people who view the multimedia information more clearly and intuitively.
[0003] When editing text information in the content of multimedia information, the text information can be rendered through the font file corresponding to the selected font style. However, due to volume issues, the font file cannot contain the dot matrix data of all characters, that is, it cannot support all characters. For example, when the text information includes characters in an uncommon language, if the character dot matrix of the current font file does not contain the character, the rendering of the character is not supported, that is, the character cannot be rendered, which will cause the rendering effect of the text information to deteriorate, thereby reducing the user experience. Summary of the invention
[0004] The present disclosure provides a text information rendering method, device, electronic device and storage medium to at least solve the problem of poor rendering effect of text information in the related art. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a text information rendering method is provided, comprising:
[0006] Obtaining text information to be rendered, and when the text information to be rendered includes a first character not supported by the current first font file and / or a second character supported by the current first font file, displaying a first rendering result in a display interface, and not performing a rendering operation on the first character in the first rendering result; the method further comprises:
[0007] Acquire a second font file that supports the first character;
[0008] A second rendering result is displayed, where the second rendering result includes the first character rendered by using the second font file and / or the second character rendered by using the first font file.
[0009] In a possible implementation, the acquiring the second font file supporting the first character includes:
[0010] In the case where there is at least one third font file supporting the first character locally, displaying first prompt information, wherein the first prompt information includes an identifier of each of the third font files;
[0011] In response to an operation for selecting an identifier from the first prompt information, the third font file corresponding to the selected identifier is used as the second font file.
[0012] In a possible implementation, the acquiring the second font file supporting the first character further includes:
[0013] In the case that there is no third font file supporting the first character locally, sending a font file acquisition instruction to a server, wherein the font file acquisition instruction includes the first character, so that the server acquires download link information corresponding to at least one second font file supporting the first character in response to the font file acquisition instruction;
[0014] After receiving the feedback information sent by the server, displaying the download link information corresponding to each of the second font files according to the feedback information;
[0015] In response to an operation for selecting the download link information, a corresponding second font file is acquired according to the selected download link information.
[0016] In a possible implementation, the sending of a font file acquisition instruction to a server includes:
[0017] Displaying a second prompt message for triggering downloading of a second font file;
[0018] In response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to a server according to the first character.
[0019] In a possible implementation manner, after displaying the second rendering result, the method further includes:
[0020] If it is determined that the second font file supports the second character, displaying third prompt information for triggering font file switching;
[0021] In response to the operation for triggering the third prompt information, a third rendering result is displayed, wherein the third rendering result includes the text information to be rendered after being rendered using the second font file.
[0022] According to a second aspect of an embodiment of the present disclosure, a text information rendering device is provided, including:
[0023] A first display unit is configured to obtain information to be rendered, and when the text information to be rendered includes a first character that is not supported by the current first font file and / or a second character that is supported by the current first font file, display a first rendering result in a display interface, and no rendering operation is performed on the first character in the first rendering result;
[0024] The device further comprises:
[0025] An acquiring unit is configured to acquire a second font file supporting the first character;
[0026] The second display unit is configured to display a second rendering result, where the second rendering result includes the first character rendered by using the second font file and / or the second character rendered by using the first font file.
[0027] In a possible implementation, the acquiring unit includes:
[0028] A first display subunit is configured to display first prompt information when there is at least one third font file supporting the first character locally, wherein the first prompt information includes an identifier of each of the third font files;
[0029] The first selecting subunit is configured to execute, in response to an operation for selecting an identifier from the first prompt information, the third font file corresponding to the selected identifier as the second font file.
[0030] In a possible implementation, the acquiring unit further includes:
[0031] a sending subunit, configured to execute, when there is no third font file supporting the first character locally, sending a font file acquisition instruction to a server, wherein the font file acquisition instruction includes the first character, so that the server acquires download link information corresponding to at least one second font file supporting the first character in response to the font file acquisition instruction;
[0032] a receiving subunit, configured to receive feedback information sent by the server and then display download link information corresponding to each second font file according to the feedback information;
[0033] The second selecting subunit is configured to execute an operation in response to selecting the download link information, and obtain a corresponding second font file according to the selected download link information.
[0034] In a possible implementation manner, the sending subunit is further configured to execute:
[0035] Displaying a second prompt message for triggering downloading of a second font file;
[0036] In response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to a server according to the first character.
[0037] In a possible implementation manner, the device further includes:
[0038] A second display unit is configured to display third prompt information for triggering font file switching when it is determined that the second font file supports the second character;
[0039] The third display unit is configured to execute a third rendering result in response to the operation for triggering the third prompt information, wherein the third rendering result includes the text information to be rendered after being rendered by using the second font file.
[0040] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0041] processor;
[0042] a memory for storing instructions executable by the processor;
[0043] Wherein, the processor is configured to execute the instructions to implement any of the aforementioned text information rendering methods.
[0044] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the text information rendering method as described in any one of the above items.
[0045] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, wherein the computer program product includes instructions, and when the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the text information rendering method as described in any one of the above items.
[0046] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0047] The text information rendering method, device, electronic device and storage medium provided by the embodiments of the present disclosure, when the acquired text information to be rendered includes a first character that is not supported by the current first font file and / or a second character that is supported by the current first font file, a first rendering result is displayed in a display interface, and no rendering operation is performed on the first character in the first rendering result. . A second font file that supports the first character is acquired, and a second rendering result is displayed, the second rendering result including the first character rendered by the second font file and / or the second character rendered by the first font file. Based on the text information rendering method, device, electronic device and storage medium provided by the embodiments of the present disclosure, when the current first font file does not support rendering of the first character, the first character can be rendered by acquiring a second font file that can render the first character, thereby enriching the rendering method of the text information, improving the rendering effect of the text information, and improving the user experience.
[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0050] Figure 1 The present invention is a diagram showing an application environment of a text information rendering method according to an exemplary embodiment.
[0051] Figure 2 The present invention is a flowchart of a text information rendering method according to an exemplary embodiment.
[0052] Figure 3a and Figure 3b It is a schematic diagram of a display interface according to an exemplary embodiment.
[0053] Figure 4 The present invention is a flowchart of a text information rendering method according to an exemplary embodiment.
[0054] Figure 5 It is a schematic diagram of a display interface according to an exemplary embodiment.
[0055] Figure 6 The present invention is a flowchart of a text information rendering method according to an exemplary embodiment.
[0056] Figure 7 It is a schematic diagram of a display interface according to an exemplary embodiment.
[0057] Figure 8 The present invention is a flowchart of a text information rendering method according to an exemplary embodiment.
[0058] Fig. 9 It is a schematic diagram of a display interface according to an exemplary embodiment.
[0059] Fig.10 The present invention is a flowchart of a text information rendering method according to an exemplary embodiment.
[0060] Fig.11 It is a schematic diagram of a display interface according to an exemplary embodiment.
[0061] Fig.12 It is a schematic diagram of a display interface according to an exemplary embodiment.
[0062] Fig.13 It is a schematic diagram of a text information rendering method according to an exemplary embodiment.
[0063] Fig.14 The invention is a block diagram of a text information rendering device according to an exemplary embodiment.
[0064] Fig.15 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0065] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0066] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0067] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0068] The text information rendering method provided by the present disclosure can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 interacts with the server 104 through the network. The terminal 102 locally stores multiple font files for font rendering of text information. After obtaining the text information to be rendered, the terminal 102 determines whether the currently selected first font file supports rendering the text information to be rendered. When the text information to be rendered includes a first character that is not supported by the first font file, and the terminal 102 does not have a second font file that supports rendering the first character locally, data can be interacted with the server 104 through the network to obtain the second font file that supports rendering the first character from the server 104, and then after the first font file and the second font file are used to render the text information to be rendered, the rendering result is displayed on the display interface of the terminal 102. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be an independent server or a server cluster composed of multiple servers.
[0069] Figure 2 is a flowchart of a text information rendering method according to an exemplary embodiment. Figure 2 As shown, the text information rendering method is used in a terminal and includes the following steps.
[0070] In step 202, text information to be rendered is obtained. When the text information to be rendered includes a first character not supported by the current first font file and / or a second character supported by the current first font file, a first rendering result is displayed in a display interface, and no rendering operation is performed on the first character in the first rendering result.
[0071] In the disclosed embodiment, the text information to be rendered is the text information input by the user to be displayed in the multimedia content, wherein the text information to be rendered is composed of at least one character. Taking the video editing scene as an example, the subtitle content input by the user in the video content can be determined as the text information to be rendered.
[0072] The first font file may be a font file used for font rendering of the text information to be rendered. After the user inputs the text information to be rendered in the text box, the user may determine the first font file used for rendering the text information to be rendered from multiple font files; or, after the user inputs the text information to be rendered, the user may determine the first font file used for rendering the text information to be rendered from multiple font files; or, the first font file may be a font file preset by the system for rendering the text information to be rendered. The embodiment of the present disclosure does not specifically limit the method for determining the first font file.
[0073] Reference Figure 3a As shown, after the user loads multimedia information into the terminal, the display interface of the terminal may include an add text control, which is used to trigger the terminal to display a text input box. The terminal can display a text input box in the display interface in response to the user's triggering operation on the add text control. The user can enter the text information to be rendered through the text input box, for example: Figure 3a The text information to be rendered entered in the Chinese text input box is "Come on, fighting, in August too."
[0074] It should be noted that the above-mentioned use of the text input box to input the text information to be rendered is only an example of obtaining the text information to be rendered in the embodiment of the present disclosure, and is not a limitation on the method of obtaining the text information to be rendered. In fact, the terminal can also respond to the user's voice input and obtain the text information to be rendered according to the voice information input by the user. The embodiment of the present disclosure does not specifically limit the method of obtaining the text information to be rendered.
[0075] After the terminal obtains the text information to be rendered, it can determine whether the first font file supports rendering of all characters of the text information to be rendered. Exemplarily, each character in the text information to be rendered can be searched from the character dot matrix of the first font file. If the corresponding character is found, it can be determined that the first font file supports rendering of the character; if the corresponding character is not found, it can be determined that the first font file does not support rendering of the character.
[0076] If the first font file supports rendering of all characters of the text information to be rendered, the text information to be rendered can be rendered using the first font file, and the rendering result can be displayed in the display interface of the terminal, and all characters in the text information to be rendered in the rendering result are rendered using the first font file; or, if the text information to be rendered includes a first character that is not supported by the text information to be rendered, the text information to be rendered is rendered using the first font file, and in the first rendering result obtained and displayed, the rendering operation is not performed on the first character, and if the first font file also includes a second character other than the first character, the second character is rendered using the first font file in the first rendering result.
[0077] Reference Figure 3aAs shown, the first font file is the font file corresponding to "Nuomi font", and the text information to be rendered includes "Come on, fighting in August", wherein the first font file does not support rendering of "fighting", so the first character includes: "fighting", and the second character includes: "August", "month", "also", "to", "add", "oil", "," In the first rendering result displayed on the terminal, "fighting" is not rendered, and "Come on, fighting in August" is rendered as "Nuomi font" using the first font file.
[0078] It should be noted that, in the embodiment of the present disclosure, step 202 may be executed or not executed, and the embodiment of the present disclosure does not make any specific limitation on this.
[0079] In step 204, a second font file supporting the first character is obtained.
[0080] In the embodiment of the present disclosure, when the text information to be rendered includes a first character that is not supported by a first font file, a second font file supporting the first character can be obtained locally or from a server based on the first character, and the second font file can support rendering of the first character.
[0081] In step 206, a second rendering result is displayed, where the second rendering result includes the first character rendered by using the second font file and / or the second character rendered by using the first font file.
[0082] In the disclosed embodiment, after obtaining the second font file, the terminal can use the first font file as the selected main font file and the second font file as the backup font file. That is, for characters that the first font file supports rendering, the first font file is used to render them. For characters that the first font file does not support rendering, it is determined whether the second font file supports rendering. If it does, the second font file is used to render the characters.
[0083] For example, after obtaining a second font file that supports a first character, the terminal can render the first character according to the second font file, and render the first character into a font effect corresponding to the second font file. When the second character is included in the text information to be rendered, the terminal still uses the first font file to render the second character, and renders the second character into a font effect corresponding to the first font file, to obtain a second rendering result, and display the second rendering result in the display interface.
[0084] For example, refer to Figure 3bAs shown, the first font file is the font file corresponding to "Nuomi Style", the second font file is the font file corresponding to "Chen Sentian Style", and the text information to be rendered includes "Come on, fighting in August", and the second font file is used to render the first character "fighting", and the first font file is used to render the second character (including: "August", "month", "also", "to", "add", "oil", ",") to obtain the second rendering result and display the second rendering result in the display interface of the terminal. Among them, in the second rendering result displayed by the terminal, "fighting" is rendered as "Chen Sentian Style" using the second font file, and "Come on, fighting in August," is rendered as "Nuomi Style" using the first font file.
[0085] The text information rendering method provided by the embodiment of the present disclosure, when there is a first character in the text information to be rendered that is not supported by the current first font file, obtains a second font file that supports the first character, and displays a second rendering result in the display interface according to the second font file, the second rendering result including the first character rendered by the second font file and / or the second character rendered by the first font file. Based on the text information rendering method provided by the embodiment of the present disclosure, when the current first font file does not support the rendering of the first character, the first character can be rendered by obtaining a second font file that can render the first character, thereby enriching the rendering method of the text information, improving the rendering effect of the text information, and improving the user experience.
[0086] In an exemplary embodiment, if Figure 4 As shown, in step S204, obtaining the second font file supporting the first character can be specifically implemented by the following steps:
[0087] In step 402, when there is at least one third font file supporting the first character locally, first prompt information is displayed, and the first prompt information includes an identifier of each third font file;
[0088] In step 404, in response to an operation for selecting an identifier from the first prompt information, a third font file corresponding to the selected identifier is used as a second font file.
[0089] In an embodiment of the present disclosure, when the text information to be rendered includes a first character that is not supported by the first font file, a third font file that supports the first character can be obtained from multiple font files stored locally in the terminal. Exemplarily, the first character can be searched from the character dot matrix of each font file stored locally in the terminal, and the font files in which the first character is found are respectively used as third font files. If there are third font files that support the first character, the identifiers of each third font file can be obtained. For any third font file, the identifier of the third font file can be used to uniquely identify the third font file. For example, the identifier can be a font effect name corresponding to the third font file, or the identifier can be an icon corresponding to the third font file, and the icon can include a font effect name rendered using the third font file.
[0090] After obtaining the identifiers of the third font files, first prompt information can be generated according to the identifiers of the third font files, and the first prompt information can include the identifiers of the third font files. The first prompt information can be displayed in a floating layer or pop-up window in the display interface of the terminal.
[0091] The user selects the third font file for rendering the first character according to the first prompt information, and selects the identifier of the third font file from the first prompt information by clicking, touching, etc. In response to the operation for selecting the identifier from the first prompt information, the terminal can determine that the third font file corresponding to the selected identifier is the second font file for rendering the first character.
[0092] Reference Figure 5 As shown, the first prompt information includes the identifier of each third font file ( Figure 5 The first character is rendered by the second font file. For example, the second rendering result can be obtained by referring to the third font file corresponding to the third font file of the first character. Figure 3b shown.
[0093] The text information rendering method provided by the embodiment of the present disclosure can obtain a third font file that can render the first character locally when the current first font file does not support rendering of the first character, and determine the second font file from the third font file in response to the user's selection, and render the first character through the second font file to obtain a second rendering result, which not only enriches the rendering method of text information, but also improves the rendering effect and rendering efficiency of the text information, thereby improving the user experience.
[0094] In an exemplary embodiment, if Figure 6 As shown, in step S204, obtaining the second font file supporting the first character can also be implemented by the following steps:
[0095] In step 602, when there is no third font file supporting the first character locally, a font file acquisition instruction is sent to a server, the font file acquisition instruction including the first character, so that the server acquires download link information corresponding to at least one second font file supporting the first character in response to the font file acquisition instruction;
[0096] In step 604, after receiving the feedback information sent by the server, the download link information corresponding to each second font file is displayed according to the feedback information;
[0097] In step 606, in response to the operation for selecting the download link information, the corresponding second font file is acquired according to the selected download link information.
[0098] In an embodiment of the present disclosure, when the terminal does not have a third font file supporting a first character locally, the terminal may generate a font file acquisition instruction based on the first character, and the font file acquisition instruction may include the first character to instruct the server to acquire a second font file supporting the first character.
[0099] The terminal may send a font file acquisition instruction to the server. After receiving the font file acquisition instruction, the server may acquire the first character from the font file acquisition instruction and search for a second font file that supports the first character from the font library. In the case where the server finds multiple second font files, the download link information of each second font file may be acquired, and feedback information for the font file acquisition instruction may be generated based on the download link information of each second font file. The feedback information may include the download link information of each second font file, or may also include the identifier of each second font file.
[0100] After the terminal receives the feedback information sent by the server, it can obtain the download link information of each second font file from the feedback information, and display the download link information of each second font file in a floating layer or pop-up window in the display interface of the terminal (or it can also obtain the identifier of the second font file from the feedback information and display it in the display interface).
[0101] The user can select the download link information of the second font file used to render the first character by clicking, touching, etc. In response to the selection operation, the terminal can download the corresponding second font file according to the selected download link information, and after the download is completed, use the downloaded second font file to render the first character to obtain a second rendering result.
[0102] Reference Figure 7 As shown, the terminal can display the download link information of each second font file in the display interface according to the feedback information (assuming that the terminal has not locally downloaded the "Wan Tong Ti", "You Ran Ti", and "Chen Sen Tian Ti" that support the first character, the download link information of the second font file includes "Wan Tong Ti Link", "You Ran Ti Link", and "Chen Sen Tian Ti Link"). The user selects the download link information "Chen Sen Tian Ti Link" corresponding to "Chen Sen Tian Ti" from the download link information of each second font file. The terminal can download the second font file corresponding to "Chen Sen Tian Ti" in response to the user's selection operation on "Chen Sen Tian Ti Link". After the download is complete, the first character can be rendered using the second font file to obtain a second rendering result. Exemplarily, the second rendering result refers to Figure 3b shown.
[0103] The text information rendering method provided by the embodiment of the present disclosure can download the second font file from the server to render the first character when the current first font file does not support rendering the first character and the terminal does not have a third font file for rendering the first character locally. This not only enriches the rendering methods of text information, improves the rendering effect and rendering efficiency of text information, and improves the user experience; and when downloading the second font file from the server, by selecting to download the second font file according to the user's preferences from the download link information of multiple second font files fed back by the server, the personalized needs of the user can be met and the resource occupancy rate can be reduced.
[0104] It should be noted that, when the server only obtains one second font file that supports the first character, the second font file can be sent directly to the terminal. After the terminal receives the second font file, the second font file can be used to render the first character to obtain a second rendering result; or, when the server obtains multiple second font files that support the first character, the server can directly send all or a preset number of second font files to the terminal. When the terminal receives multiple second font files sent by the server, the identifier of each second font file is displayed in the display interface for user selection, and in response to the operation of selecting an identifier from the identifiers of multiple second font files, the second font file corresponding to the selected identifier is used to render the first character to obtain a second rendering result.
[0105] In an exemplary embodiment, if Figure 8 As shown, in the above step 602, sending a font file acquisition instruction to the server can be specifically implemented by the following steps:
[0106] In step 802, a second prompt message for triggering downloading of a second font file is displayed;
[0107] In step 804, in response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to the server according to the first character.
[0108] In the embodiment of the present disclosure, when there is a first character that is not supported by the first font file, second prompt information can be displayed in a pop-up window or floating layer in the display interface, and the second prompt information can be used to trigger the download of the second font file.
[0109] The user may trigger the second prompt information accordingly to instruct the terminal to download the second font file supporting the rendering of the first character from the server. In response to the user triggering the second prompt information, the terminal may generate a font file acquisition instruction according to the first character, and then send the font file acquisition instruction to the server, so as to download the second font file supporting the rendering of the first character from the server according to the font file acquisition instruction.
[0110] For example, refer to Fig. 9 As shown, the second prompt information may include: prompt information "The current font file cannot fully render the subtitle content of the subtitle, and a new font file needs to be downloaded. Do you want to download?", a confirmation download control, and a cancel download control. The user can trigger the confirmation download control by clicking, touching, etc. to instruct the terminal to download a new font file. In response to the user's triggering operation on the confirmation download control, the terminal generates a font file acquisition instruction according to the first character, and sends the font file acquisition instruction to the server, so that the server can respond to the font file acquisition instruction and acquire a second font file that supports the first character.
[0111] Alternatively, if the user believes that not rendering the first character does not affect the overall effect, the download cancellation control can be triggered by single-clicking, touching, etc. The terminal can cancel the display of the second prompt information and maintain the display of the first rendering result in response to the user's triggering operation on the download cancellation control.
[0112] The text information rendering method provided by the embodiment of the present disclosure can prompt the user to download the second font file from the server through the second prompt information displayed on the display interface when the current first font file does not support rendering of the first character and the terminal does not locally have a third font file for rendering the first character, so as to render the first character through the second font file, thereby enriching the rendering method of text information, improving the rendering effect and rendering efficiency of text information, and improving the user experience.
[0113] In an exemplary embodiment, if Fig.10 As shown, in step 206, after displaying the second rendering result, the method may further include:
[0114] In step 1002, when it is determined that the second font file supports the second character, third prompt information for triggering font file switching is displayed;
[0115] In step 1004, in response to the operation for triggering the third prompt information, a third rendering result is displayed, where the third rendering result includes the text information to be rendered after being rendered using the second font file.
[0116] In the disclosed embodiment, after obtaining the second font file and rendering the first character according to the second font file to obtain the second rendering result, it can be determined whether the text information to be rendered includes the second character. If the text information to be rendered includes the second character, it can be determined whether the second font file supports rendering the second character in the text information to be rendered. If it is determined that the second font file supports rendering the second character, that is, if it is determined that the second font file supports rendering all characters in the text information to be rendered, a third prompt information can be displayed in the display interface, and the third prompt information can be used to trigger switching of the current font file.
[0117] When the user believes that the second font file is used to render the text information to be rendered as a whole, the rendering effect is better, and the third prompt information can be triggered accordingly to instruct the terminal to switch the currently selected font file from the first font file to the second font file. In response to the user's triggering of the third prompt information, the terminal can switch the currently selected font file from the first font file to the second font file, that is, switch the second font file to the main font file and the first font file to the backup font file. The second font file is used to render the text information to be rendered to obtain a third rendering result, and the third rendering result is displayed in the display interface. In the third rendering result, the characters in the text information to be rendered are all rendered using the second font file.
[0118] For example, refer to Fig.11As shown in the figure, the second font file is the font file corresponding to "Chen Sentian Font". This second font file supports the rendering of all characters in "Come on in August, fighting", and then the third prompt message can be displayed on the display interface. The third prompt message may include: the prompt message "Do you want to switch the font file?", a confirmation switch control, and a cancellation switch control. The user can trigger the confirmation switch control by clicking, touching, etc. to instruct the terminal to switch the currently selected font file from the first font file corresponding to "Nuomi Font" to the second font file corresponding to "Chen Sentian Font". In response to the user's trigger operation on the confirmation switch control, the terminal switches the currently selected font file from the first font file corresponding to "Nuomi Font" to the second font file corresponding to "Chen Sentian Font", renders the information to be rendered according to this second font file, obtains the third rendering result, and displays this third rendering result in the display interface. As Fig.12 shown, in the third rendering result, "Come on in August, fighting" is rendered as "Chen Sentian Font".
[0119] Alternatively, when the user believes that not rendering the text information to be rendered (the second rendering result) as a whole does not affect the overall effect, the user can trigger the cancellation switch control by clicking, touching, etc. The terminal can respond to the user's trigger operation on this cancellation switch control, cancel the display of the third prompt message, and maintain the display of the second rendering result.
[0120] Alternatively, when it is determined that the text information to be rendered does not include the second character, the second rendering result can be directly displayed, and the text information to be rendered in the second rendering result is rendered using the second font file.
[0121] The text information rendering method provided by the embodiments of the present disclosure, when the second font file supports the rendering of all characters of the text information to be rendered, can prompt the user to switch the font file to the second font file through the third prompt message displayed on the display interface, so as to perform overall rendering of the text information to be rendered using the second font file, enriching the rendering method of the text information, improving the rendering effect and efficiency of the text information, and improving the user experience.
[0122] To enable those skilled in the art to better understand the embodiments of the present disclosure, the following will illustrate the embodiments of the present disclosure through specific examples.
[0123] Referring to Fig.13 as shown in the figure, the embodiments of the present disclosure include:
[0124] In step 1302, after selecting the first font file for character rendering, obtain the text information to be rendered;
[0125] In step 1304, if there is a first character in the text information to be rendered that is not supported by the first font file, the text information to be rendered is rendered using the first font file, and a first rendering result is obtained and displayed on the display interface, in which the first character in the first rendering result is not rendered, and second characters other than the first character are rendered using the first font file;
[0126] In step 1306, it is determined whether there is a third font file that supports rendering the first character from the font files stored locally in the terminal. If there is a third font file, step 1308 is executed; otherwise, step 1312 is executed.
[0127] In step 1308, if the third font files exist, first prompt information is displayed in the display interface, and the first prompt information includes the identifiers of the third font files;
[0128] In step 1310, in response to an operation for selecting a logo from the first prompt information, after the third font file corresponding to the selected logo is used as the second font file, step 1318 is executed;
[0129] In step 1312, if the third font file does not exist, a second prompt message is displayed in the display interface, where the second prompt message is used to prompt the user to download a second font file that supports the first character;
[0130] In step 1314, in response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to the server, the font file acquisition instruction includes the first character, so that the server acquires a second font file that supports rendering the first character in response to the font file acquisition instruction, and feeds back download link information of each second font file to the terminal;
[0131] In step 1316, in response to the feedback information sent by the server, the download link information of each second font file is displayed on the display interface, and in response to the operation for selecting any download link information, the corresponding second font file is downloaded according to the selected download link information;
[0132] In step 1318, the second character is rendered using the first font file and the first character is rendered using the second font file to obtain a second rendering result, and the second rendering result is displayed in the display interface;
[0133] In step 1320, when it is determined that the second font file can support rendering of all characters of the text information to be rendered, third prompt information is displayed in the display interface, and the third prompt information can be used to trigger font file switching;
[0134] In step 1322, in response to the user's triggering operation on the third prompt information, the currently selected font file is switched from the first font file to the second font file, and the text information to be rendered is rendered using the second font file to obtain a third rendering result, in which the characters in the text information to be rendered are all rendered using the second font file.
[0135] It should be understood that although Figure 1-Figure 13 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 13 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0136] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.
[0137] Fig.14 is a block diagram of a text information rendering device according to an exemplary embodiment. Fig.14 The device includes a first display unit 1402 , an acquisition unit 1404 and a second display unit 1406 .
[0138] The first display unit 1402 is configured to obtain information to be rendered, and when the text information to be rendered includes a first character that is not supported by the current first font file and / or a second character that is supported by the current first font file, display a first rendering result in the display interface, and do not perform a rendering operation on the first character in the first rendering result;
[0139] An acquiring unit 1404 is configured to execute acquiring a second font file supporting the first character;
[0140] The second display unit 1406 is configured to display a second rendering result, where the second rendering result includes the first character rendered by using the second font file and / or the second character rendered by using the first font file.
[0141] It should be noted that the first display unit 1402 may be executed or may not be executed, and this embodiment of the present disclosure does not specifically limit this.
[0142] The text information rendering device provided by the embodiment of the present disclosure obtains a second font file that supports the first character when there is a first character in the text information to be rendered that is not supported by the current first font file, and displays a second rendering result in the display interface according to the second font file, wherein the second rendering result includes the first character rendered by the second font file and / or the second character rendered by the first font file. Based on the text information rendering device provided by the embodiment of the present disclosure, when the current first font file does not support rendering of the first character, the first character can be rendered by obtaining a second font file that can render the first character, thereby enriching the rendering method of the text information, improving the rendering effect of the text information, and improving the user experience.
[0143] In an exemplary embodiment, the acquiring unit 1404 may include:
[0144] A first display subunit is configured to display first prompt information when there is at least one third font file supporting the first character locally, wherein the first prompt information includes an identifier of each of the third font files;
[0145] The first selecting subunit is configured to execute, in response to an operation for selecting an identifier from the first prompt information, the third font file corresponding to the selected identifier as the second font file.
[0146] In an exemplary embodiment, the acquiring unit 1404 may further include:
[0147] a sending subunit, configured to execute, when there is no third font file supporting the first character locally, sending a font file acquisition instruction to a server, wherein the font file acquisition instruction includes the first character, so that the server acquires download link information corresponding to at least one second font file supporting the first character in response to the font file acquisition instruction;
[0148] a receiving subunit, configured to receive feedback information sent by the server and then display download link information corresponding to each second font file according to the feedback information;
[0149] The second selecting subunit is configured to execute an operation in response to selecting the download link information, and obtain a corresponding second font file according to the selected download link information.
[0150] In an exemplary embodiment, the sending subunit may also be configured to execute:
[0151] Displaying, according to the first character, second prompt information for triggering downloading of a second font file;
[0152] In response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to a server according to the first character.
[0153] In an exemplary embodiment, the above device may further include:
[0154] A second display unit is configured to display third prompt information for triggering font file switching when it is determined that the second font file supports the second character;
[0155] The third display unit is configured to execute a third rendering result in response to the operation for triggering the third prompt information, wherein the third rendering result includes the text information to be rendered after being rendered by using the second font file.
[0156] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0157] Fig.15 1 is a block diagram of an electronic device 1500 for a text information rendering method according to an exemplary embodiment. For example, the electronic device 1500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0158] Reference Fig.15 , the electronic device 1500 may include one or more of the following components: a processing component 1502 , a memory 1504 , a power component 1506 , a multimedia component 1508 , an audio component 1510 , an input / output (I / O) interface 1512 , a sensor component 1514 , and a communication component 1516 .
[0159] The processing component 1502 generally controls the overall operation of the electronic device 1500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1502 may include one or more processors 1520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1502 may include one or more modules to facilitate the interaction between the processing component 1502 and other components. For example, the processing component 1502 may include a multimedia module to facilitate the interaction between the multimedia component 1508 and the processing component 1502.
[0160] The memory 1504 is configured to store various types of data to support operations on the electronic device 1500. Examples of such data include instructions for any application or method operating on the electronic device 1500, contact data, phone book data, messages, pictures, videos, etc. The memory 1504 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, optical disk, or graphene memory.
[0161] The power supply component 1506 provides power to the various components of the electronic device 1500. The power supply component 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1500.
[0162] The multimedia component 1508 includes a screen that provides an output interface between the electronic device 1500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1508 includes a front camera and / or a rear camera. When the electronic device 1500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0163] The audio component 1510 is configured to output and / or input audio signals. For example, the audio component 1510 includes a microphone (MIC), and when the electronic device 1500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1504 or sent via the communication component 1516. In some embodiments, the audio component 1510 also includes a speaker for outputting an audio signal.
[0164] I / O interface 1512 provides an interface between processing component 1502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0165] The sensor assembly 1514 includes one or more sensors for providing various aspects of status assessment for the electronic device 1500. For example, the sensor assembly 1514 can detect the open / closed state of the electronic device 1500, the relative positioning of components, such as the display and keypad of the electronic device 1500, and the sensor assembly 1514 can also detect changes in the position of the electronic device 1500 or components of the electronic device 1500, the presence or absence of user contact with the electronic device 1500, the orientation or acceleration / deceleration of the device 1500, and the temperature change of the electronic device 1500. The sensor assembly 1514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0166] The communication component 1516 is configured to facilitate wired or wireless communication between the electronic device 1500 and other devices. The electronic device 1500 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 1516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0167] In an exemplary embodiment, the electronic device 1500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0168] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1504 including instructions, and the above instructions can be executed by the processor 1520 of the electronic device 1500 to perform the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0169] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions. The instructions can be executed by the processor 1520 of the electronic device 1500 to complete the above method.
[0170] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments, which will not be described one by one here.
[0171] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0172] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A text information rendering method, comprising: Acquire text information to be rendered, and when the text information to be rendered includes a first character that is not supported by the current first font file and / or a second character that is supported by the current first font file, display a first rendering result in a display interface, and do not perform a rendering operation on the first character in the first rendering result; Characterized in that the method further comprises: Acquire a second font file that supports the first character; Displaying a second rendering result, where the second rendering result includes the first character rendered by using the second font file and / or the second character rendered by using the first font file; If it is determined that the second font file supports the second character, displaying third prompt information for triggering font file switching; In response to the operation used to trigger the third prompt information, the second font file is switched to a main font file, the first font file is switched to a backup font file, and a third rendering result is displayed, wherein the third rendering result includes the text information to be rendered after being rendered using the second font file, wherein the backup font file is used to render characters not supported by the main font file.
2. The method according to claim 1, characterized in that The obtaining of a second font file supporting the first character comprises: In the case where there is at least one third font file supporting the first character locally, displaying first prompt information, wherein the first prompt information includes an identifier of each of the third font files; In response to an operation for selecting an identifier from the first prompt information, the third font file corresponding to the selected identifier is used as the second font file.
3. The method according to claim 2, characterized in that The step of acquiring a second font file supporting the first character further includes: In the case that there is no third font file supporting the first character locally, sending a font file acquisition instruction to a server, wherein the font file acquisition instruction includes the first character, so that the server acquires download link information corresponding to at least one second font file supporting the first character in response to the font file acquisition instruction; After receiving the feedback information sent by the server, displaying the download link information corresponding to each of the second font files according to the feedback information; In response to an operation for selecting the download link information, a corresponding second font file is acquired according to the selected download link information.
4. The method according to claim 3, characterized in that The step of sending a font file acquisition instruction to the server includes: Displaying a second prompt message for triggering downloading of a second font file; In response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to a server according to the first character.
5. A text information rendering device, comprising: A first display unit is configured to obtain text information to be rendered, and when the text information to be rendered includes a first character that is not supported by the current first font file and / or a second character that is supported by the current first font file, display a first rendering result in a display interface, and no rendering operation is performed on the first character in the first rendering result; Characterized in that the device further comprises: An acquiring unit is configured to acquire a second font file supporting the first character; A second display unit is configured to display a second rendering result, wherein the second rendering result includes the first character rendered by using the second font file and / or the second character rendered by using the first font file; A second display unit is configured to display third prompt information for triggering font file switching when it is determined that the second font file supports the second character; The third display unit is configured to execute an operation in response to triggering the third prompt information, switch the second font file to a main font file, switch the first font file to a backup font file, and display a third rendering result, wherein the third rendering result includes the text information to be rendered after being rendered using the second font file, wherein the backup font file is used to render characters not supported by the main font file.
6. The device according to claim 5, characterized in that The acquisition unit comprises: A first display subunit is configured to display first prompt information when there is at least one third font file supporting the first character locally, wherein the first prompt information includes an identifier of each of the third font files; The first selecting subunit is configured to execute, in response to an operation for selecting an identifier from the first prompt information, the third font file corresponding to the selected identifier as the second font file.
7. The device according to claim 6, characterized in that The acquisition unit further includes: a sending subunit, configured to execute, when there is no third font file supporting the first character locally, sending a font file acquisition instruction to a server, wherein the font file acquisition instruction includes the first character, so that the server acquires download link information corresponding to at least one second font file supporting the first character in response to the font file acquisition instruction; a receiving subunit, configured to receive feedback information sent by the server and then display download link information corresponding to each second font file according to the feedback information; The second selecting subunit is configured to execute an operation in response to selecting the download link information, and obtain a corresponding second font file according to the selected download link information.
8. The device according to claim 7, characterized in that The sending subunit is further configured to execute: Displaying a second prompt message for triggering downloading of a second font file; In response to the operation for triggering the second prompt information, a font file acquisition instruction is sent to a server according to the first character.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the text information rendering method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the text information rendering method according to any one of claims 1 to 4.
11. A computer program product, comprising instructions, characterized in that: When the instruction is executed by a processor of an electronic device, the electronic device is enabled to execute the text information rendering method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Serving font files in varying formats based on user agent type
CN102063483A
Using Character Classes for Font Selection
US20160196676A1
Techniques for text rendering using font patching
US20200380068A1