Text processing method, device and equipment and computer readable storage medium

文档序号:1296843 发布日期:2020-08-07 浏览:8次 中文

阅读说明:本技术 文本处理方法、装置、设备及计算机可读存储介质 (Text processing method, device and equipment and computer readable storage medium ) 是由 李清鹏 于 2020-02-27 设计创作,主要内容包括:本申请提供一种文本处理方法、装置、设备及计算机可读存储介质,该方法包括:接收终端设备发送的文本处理请求,并获取所述文本处理请求中的字体标识符对应的字体文件;从所述文本处理请求中获取目标文本,并从所述字体文件中获取所述目标文本对应的字体文字集,其中,所述目标文本为待更新字体的文本;根据所述字体文字集,更新所述目标文本中的每个文字的字体,并将更新后的目标文本发送至所述终端设备。本申请涉及数据处理,有效降低了终端设备加载字体文件的耗时,能够快速的更新文本的字体,提高用户体验。(The application provides a text processing method, a text processing device, text processing equipment and a computer readable storage medium, wherein the method comprises the following steps: receiving a text processing request sent by a terminal device, and acquiring a font file corresponding to a font identifier in the text processing request; acquiring a target text from the text processing request, and acquiring a font character set corresponding to the target text from the font file, wherein the target text is a text of a font to be updated; and updating the font of each character in the target text according to the font character set, and sending the updated target text to the terminal equipment. The method and the device for processing the font files have the advantages that time consumed by loading the font files by the terminal device is effectively reduced, the fonts of the text can be rapidly updated, and user experience is improved.)

1. A method of text processing, comprising:

receiving a text processing request sent by a terminal device, and acquiring a font file corresponding to a font identifier in the text processing request;

acquiring a target text from the text processing request, and acquiring a font character set corresponding to the target text from the font file, wherein the target text is a text of a font to be updated;

and updating the font of each character in the target text according to the font character set, and sending the updated target text to the terminal equipment.

2. The method according to claim 1, wherein before obtaining the font file corresponding to the font identifier in the text processing request, the method further comprises:

determining whether the text processing request carries a font identifier;

if the text processing request does not carry the font identifier, acquiring a user identifier from the text processing request, and acquiring a font identifier set corresponding to the user identifier;

and selecting a font identifier from the font identifier set as a target font identifier according to the attribute information of each font identifier in the font identifier set, and acquiring a font file corresponding to the target font identifier.

3. The method of claim 2, wherein selecting a font identifier from the font identifier set as the target font identifier based on the attribute information of each font identifier in the font identifier set comprises:

determining the priority corresponding to each font identifier according to the attribute information of each font identifier in the font identifier set;

selecting the highest priority font identifier from the set of font identifiers as a target font identifier.

4. The method according to claim 1, wherein the obtaining of the font file corresponding to the font identifier in the text processing request comprises:

and acquiring the font file corresponding to the font identifier in the text processing request from the memory.

5. The method according to any one of claims 1 to 4, wherein the obtaining a font character set corresponding to the target text from the font file comprises:

splitting the target text into single characters to obtain a character set of the target text;

obtaining font characters corresponding to each character in the character set from the font file;

and taking the font character corresponding to each character in the character set as the font character set corresponding to the target text.

6. The method of claim 5, wherein the splitting the target text into individual words to obtain a word set of the target text comprises:

splitting the target text into single characters to obtain a candidate character set of the target text;

and processing repeated characters in the candidate character set to obtain a character set of the target text, wherein the characters in the character set are not repeated.

7. The text processing method of any one of claims 1 to 4, wherein updating the font of each word in the target text according to the font word set comprises:

obtaining font characters corresponding to each character in the target text from the font character set;

and replacing each character in the target text with the font character corresponding to each character so as to update the font of each character in the target text.

8. A text processing apparatus, characterized in that the text processing apparatus comprises:

the receiving module is used for receiving a text processing request sent by the terminal equipment;

the obtaining module is used for obtaining a font file corresponding to the font identifier in the text processing request;

the obtaining module is further configured to obtain a target text from the text processing request, and obtain a font character set corresponding to the target text from the font file, where the target text is a text of a font to be updated;

the font updating module is used for updating the font of each character in the target text according to the font character set;

and the sending module is used for sending the updated target text to the terminal equipment.

9. A computer arrangement, characterized in that the computer arrangement comprises a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, carries out the steps of the text processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, carries out the steps of the text processing method according to any one of claims 1 to 7.

Technical Field

The present application relates to the field of data processing technologies, and in particular, to a text processing method, apparatus, device, and computer readable storage medium.

Background

As the demand for personalization of page display by users of terminal devices increases, the types of fonts used for displaying characters also increase. For business reasons, the terminal device needs to display a section of text in a display page with different types of fonts, but how to quickly process display updating of the fonts causes frequent headache for developers and business personnel.

In the conventional method, the types of fonts carried by system software installed in the terminal device are not many, and when a user wants to display text with other types of fonts, the font file needs to be reloaded. Under the condition that the network environment of the terminal device is poor, due to the fact that the data volume of the font file to be loaded is large, the time for loading the font file is often long, the font of the text cannot be updated quickly based on the font file, and user experience is poor.

Therefore, how to update the font of the text quickly is a problem to be solved urgently at present.

Disclosure of Invention

The present application mainly aims to provide a text processing method, apparatus, device and computer readable storage medium, aiming to quickly update the font of a text.

In a first aspect, the present application provides a text processing method, including:

receiving a text processing request sent by a terminal device, and acquiring a font file corresponding to a font identifier in the text processing request;

acquiring a target text from the text processing request, and acquiring a font character set corresponding to the target text from the font file, wherein the target text is a text of a font to be updated;

and updating the font of each character in the target text according to the font character set, and sending the updated target text to the terminal equipment.

In a second aspect, the present application further provides a text processing apparatus, including:

the receiving module is used for receiving a text processing request sent by the terminal equipment;

the obtaining module is used for obtaining a font file corresponding to the font identifier in the text processing request;

the obtaining module is further configured to obtain a target text from the text processing request, and obtain a font character set corresponding to the target text from the font file, where the target text is a text of a font to be updated;

the font updating module is used for updating the font of each character in the target text according to the font character set;

and the sending module is used for sending the updated target text to the terminal equipment.

In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the text processing method as described above.

In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the text processing method as described above.

The application provides a text processing method, a text processing device and a computer readable storage medium, when a terminal device needs to update the font of a text, the text and the font identifier are uploaded to a server, the server obtains a font file corresponding to the font identifier, obtains a font character set corresponding to the text from the font file, updates the font of each character in the text according to the font character set, and sends the updated text to the terminal device, the whole process does not need to send the font file with larger data volume to the terminal device, the network bandwidth is saved, the time consumed for loading the font file by the terminal device is effectively reduced, the font of the characters in the text can be quickly updated, and the user experience is greatly improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic flowchart of a text processing method according to an embodiment of the present application;

fig. 2 is a schematic view of a scene for implementing the text processing method provided in this embodiment;

fig. 3 is a schematic flowchart of another text processing method according to an embodiment of the present application;

FIG. 4 is a flow diagram illustrating sub-steps of the text processing method of FIG. 3;

FIG. 5 is a schematic block diagram of a text processing apparatus according to an embodiment of the present application;

FIG. 6 is a schematic block diagram of another text processing apparatus provided in an embodiment of the present application;

fig. 7 is a block diagram schematically illustrating a structure of a computer device according to an embodiment of the present application.

The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation. In addition, although the division of the functional blocks is made in the device diagram, in some cases, it may be divided in blocks different from those in the device diagram.

The embodiment of the application provides a text processing method and device, computer equipment and a computer readable storage medium. Wherein, the text processing method can be applied to a server.

Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.

Referring to fig. 1, fig. 1 is a flowchart illustrating a text processing method according to an embodiment of the present disclosure.

As shown in fig. 1, the text processing method includes steps S101 to S103.

Step S101, receiving a text processing request sent by a terminal device, and acquiring a font file corresponding to a font identifier in the text processing request.

When the user makes a decision to change the font of the text displayed on the terminal device for a different purpose, a text processing request may be issued to the server via the terminal device, and the font of the text is updated by the server based on the text processing request.

The triggering mode of the text processing request is specifically as follows: the method comprises the steps that the terminal equipment displays a font selection page, a popup window or a menu bar, wherein names corresponding to a plurality of fonts, such as a Song script and a regular script, are displayed in the font selection page, the popup window or the menu bar; the method comprises the steps of obtaining a font identifier corresponding to a font selected by a user based on a font selection page, a popup window or a menu bar, generating a text processing request carrying the font identifier, and sending the text processing request to a server. In addition, in the process that the terminal device sends the text processing request to the server, the server receives the text processing request sent by the terminal device in real time or at preset time intervals. It should be noted that the preset time may be set based on actual situations, and the present application is not limited to this.

In an embodiment, the terminal device is provided with a control for triggering a text processing request, when a touch operation of a user on the control is detected, the terminal device selects any one font identifier from a local font identifier set, generates a text processing request carrying the font identifier, and sends the text processing request to the server. Alternatively, a text processing request without a font identifier may be directly generated, and then the server may randomly select the font identifier. This is not a limitation of the present application.

After receiving the text processing request, the server may obtain a font file corresponding to the font identifier in the text processing request, where the font file is a file containing a certain type of font characters, for example, a black-body font file is a file containing black-body characters. It should be noted that the server stores font files corresponding to different types of fonts, where the font files include a chinese font and a foreign font, and the present application is not limited to this specifically.

In an embodiment, the font file is obtained in a specific manner: when a text processing request sent by a terminal device is received, determining whether a font identifier exists in the text processing request; and if the font identifier exists in the text processing request, acquiring a font file corresponding to the font identifier. The font identifier is used for identifying the font file, the font identifiers of different font files are different, and after judgment of the server, if the font identifier exists in the text processing request, the server can quickly find the font file corresponding to the font identifier, so that the obtaining speed of the font file is effectively improved.

Further, the specific way of obtaining the font file corresponding to the font identifier is as follows: and determining whether the font file corresponding to the font identifier is loaded to the memory, and if the font file corresponding to the font identifier is loaded to the memory, the server acquires the font file corresponding to the font identifier in the text processing request from the memory. Because the font file corresponding to the font identifier is loaded to the memory, the font file corresponding to the font identifier can be quickly acquired from the memory, and the acquisition speed of the font file is further improved.

Step S102, obtaining a target text from the text processing request, and obtaining a font character set corresponding to the target text from the font file, wherein the target text is a text of a font to be updated.

After the server acquires the corresponding font file based on the text processing request, the font character set corresponding to the target text can be determined according to the target text carried in the text processing request. The target text is a text of a font to be updated and is formed by combining a plurality of independent characters, and the font character set comprises font characters corresponding to each character in the target text.

Illustratively, a user sends a text processing request of 'how many flowers fall' of 'sons body' on a terminal device, a target text carried by the text processing request is 'how many flowers fall', a server acquires a corresponding sons body font file, and determines and correspondingly acquires a font character set from the sons body font file according to the target text, wherein the font character set is [ flowers, fall, know, more and less ].

In an embodiment, the manner of obtaining the font character set corresponding to the target text from the font file specifically includes: splitting the target text into single characters to obtain a character set of the target text; obtaining font characters corresponding to each character in a character set from a font file; and taking the font character corresponding to each character in the character set as the font character set corresponding to the target text.

For example, the target text is "hello, i'm, and jia good" of a regular script, the single character after the split is "hello", "good", "big", "home", and "good", the character set of the target text is [ hello, i, good, big, home, good ], and the font is a regular script. If the font file corresponding to the font identifier is the font file corresponding to the song body, the characters of the song body are acquired from the font file corresponding to the song body, so that the font character set [ you, good, I, good, big, family, good ] corresponding to the target text is obtained, and the font is the song body.

In one embodiment, the target text is split into single characters to obtain a candidate character set of the target text; and processing repeated characters in the candidate character set to obtain a character set of the target text, wherein the characters in the character set are not repeated. Repeated characters in the character set are deleted, the capacity of the character set of the fonts is reduced, and the uploading speed of the text and the updating speed of the fonts can be further increased.

For example, if the target text is "hello, i's good, big family's good" of a regular script, the single character after the splitting is "you", "good", "i", "good", "big", "family" and "good", the character set is [ you, good, i, good, big, family, good ], and the font is a regular script, the character set of the target text after the past reprocessing is [ you, good, i, big, family ], and if the obtained font file is a font file corresponding to the song style, the corresponding song style character [ you, good, i, big, family ] is obtained from the font file corresponding to the song style, thereby obtaining the font character set [ you, good, i, big, family ] corresponding to the song style, and the font is the song style.

And step S103, updating the font of each character in the target text according to the font character set, and sending the updated target text to the terminal equipment.

After the font character set is obtained from the font file, the server updates the font of each character in the target text based on the font character set, and sends the updated target text to the terminal equipment so that the updated target text can be displayed by the terminal equipment. For example, the target text sent by the terminal device is "hello, i's good, and jia good" of the regular script, the font character set generated by the server is a set including "you", "i", "good", "big", and "home", the "hello, i's good, and jia good" of the regular script is updated to "hello, i's good, and jia good" of the song script, and the updated "hello, i's good, and jia good" of the song script is sent to the terminal device for the terminal device to display.

Referring to fig. 2, fig. 2 is a schematic view of a scene for implementing the text processing method according to the embodiment.

As shown in fig. 2, a user sends a text processing request to a server on a terminal device to request font updating, the server obtains a corresponding font file based on the text processing request, determines a font character set corresponding to a target text based on the font file, returns the font character set to the terminal device, performs font updating based on the font character set by the terminal device, and displays the updated target text.

In the text processing method provided by the embodiment, when the terminal device needs to update the font of the text, the text and the font identifier are uploaded to the server, the server obtains the font file corresponding to the font identifier, obtains the font character set corresponding to the text from the font file, updates the font of each character in the text according to the font character set, and sends the updated text to the terminal device.

Referring to fig. 3, fig. 3 is a flowchart illustrating another text processing method according to an embodiment of the present disclosure.

As shown in fig. 3, the text processing method includes steps S201 to S205.

Step S201, receiving a text processing request sent by a terminal device, and determining whether the text processing request carries a font identifier.

When a server receives a text processing request sent by a terminal device, the text processing request is analyzed to determine whether the text processing request carries a font identifier, if the text processing request carries the font identifier, a font file corresponding to the font identifier can be directly obtained, and if the text processing request does not carry the font identifier, the font identifier needs to be determined first, and then the font file corresponding to the determined font identifier needs to be obtained, wherein the font identifier is used for identifying the font file, and the font identifiers of different font files are different.

Step S202, if the font identifier is not carried in the text processing request, acquiring a user identifier from the text processing request, and acquiring a font identifier set corresponding to the user identifier.

When the text processing request carries a font identifier, the server acquires the user identifier after acquiring the font file through the font identifier, and writes the acquired font identifier of the font file into a font identifier set corresponding to the user identifier to update the font identifier set.

If the font identifier is not carried in the text processing request, the server acquires a user identifier carried in the text processing request, and can acquire a font identifier set corresponding to the user identifier through the user identifier, wherein the user identifier is used for uniquely identifying a user, and the font identifier set comprises at least one font identifier.

Step S203, selecting a font identifier from the font identifier set as a target font identifier according to the attribute information of each font identifier in the font identifier set, and acquiring a font file corresponding to the target font identifier.

After obtaining the font identifier set, the server may obtain attribute information for each font identifier in the font identifier set, selecting one font identifier from the font identifier set as a target font identifier based on the attribute information of each font identifier, and acquiring a font file corresponding to the target font identifier, wherein, the attribute information includes a priority label of the font identifier and/or a history loading frequency of the font file corresponding to the font identifier, it should be noted that different priority labels represent different priorities, the higher the priority, the more the font file corresponding to the font identifier is used, the lower the priority is, the less the font file corresponding to the font identifier is used, and the historical loading times are the times that the font file corresponding to the font identifier has been loaded. It should be noted that the server may also select any one of the font identifiers from the font identifier set as the target font identifier.

In one embodiment, as shown in fig. 4, step S203 includes sub-steps S2031 to S2032.

Step S2031, determining the priority corresponding to each font identifier according to the attribute information of each font identifier in the font identifier set.

Specifically, whether a priority label exists in the attribute information of each font identifier is judged, and if the priority label exists in the attribute information of each font identifier, the priority corresponding to each font identifier can be determined according to the priority label of each font identifier. The higher the priority is, the more the number of times of use of the font file corresponding to the font identifier is represented, and the lower the priority is, the less the number of times of use of the font file corresponding to the font identifier is represented, and the user preference request is for loading the font file corresponding to the font identifier with the higher priority.

Further, if the attribute information does not have the priority label, the server acquires the historical loading times corresponding to each font identifier from the attribute information of each font identifier, and determines the priority corresponding to each font identifier according to the historical loading times corresponding to each font identifier. It should be noted that the higher the history load number is, the higher the priority is, and the lower the history load number is, the lower the priority is.

The determination method of the priority specifically comprises the following steps: and sequencing each font identifier in the font identifier set according to the size sequence of the historical loading times corresponding to each font identifier, acquiring the sequencing number of each font identifier, and taking the sequencing number of each font identifier as the priority of each font identifier. It should be noted that the larger the history loading frequency is, the smaller the ranking number is, and the higher the priority is, and the smaller the history loading frequency is, the larger the ranking number is, and the lower the priority is.

In an embodiment, if the server determines that the attribute information of each font identifier does not have a priority label or a history loading frequency, the server selects one font identifier as the target font identifier in a random selection manner, so that it is ensured that one font identifier can be selected as the target font identifier in any case.

Step S2032 of selecting the font identifier with the highest priority from the font identifier set as a target font identifier.

After the priority corresponding to each font identifier is determined, the target font identifier is determined according to the priority corresponding to each font identifier, namely, the font identifier with the highest priority is selected from the font identifier set to serve as the target font identifier, or the font identifier with the priority greater than or equal to the preset priority is obtained to serve as the candidate font identifier, and any one candidate font identifier is selected to serve as the target font identifier.

Step S204, a target text is obtained from the text processing request, and a font character set corresponding to the target text is obtained from the font file, wherein the target text is a text of a font to be updated.

After the server acquires the corresponding font file based on the text processing request, the font character set corresponding to the target text can be determined according to the target text carried in the text processing request. The target text is a text of a font to be updated and is formed by combining a plurality of independent characters, and the font character set comprises font characters corresponding to each character in the target text.

And S205, updating the font of each character in the target text according to the font character set, and sending the updated target text to the terminal equipment.

And after acquiring the font character set from the font file, the server updates the font of each character in the target text based on the font character set, and sends the updated target text to the terminal equipment so that the terminal equipment can display the updated target text. For example, the target text sent by the terminal device is "hello, i's good, and jia good" of the regular script, the font character set generated by the server is a set including "you", "i", "good", "big", and "home", the "hello, i's good, and jia good" of the regular script is updated to "hello, i's good, and jia good" of the song script, and the updated "hello, i's good, and jia good" of the song script is sent to the terminal device for the terminal device to display.

The font updating mode of each character in the target text specifically comprises the following steps: obtaining font characters corresponding to each character in the target text from the font character set; and replacing each character in the target text with a font character corresponding to each character so as to update the font of each character in the target text. By updating the font of each character in the target text, the terminal equipment can conveniently display the updated target text.

In the text processing method provided by the above embodiment, when the server cannot acquire the font file through the font identifier in the text processing request, the font identifier set corresponding to the user identifier may be acquired according to the user identifier carried in the text processing request, and one font identifier may be selected as the target font identifier according to the attribute information of each font identifier in the font identifier set, so that it is ensured that the user can accurately and quickly request updating of the font, and user experience is improved.

Referring to fig. 5, fig. 5 is a schematic block diagram of a text processing apparatus according to an embodiment of the present disclosure.

As shown in fig. 5, the text processing apparatus 300 includes: a receiving module 301, an obtaining module 302, a font updating module 303 and a sending module 304.

A receiving module 301, configured to receive a text processing request sent by a terminal device.

An obtaining module 302, configured to obtain a font file corresponding to the font identifier in the text processing request.

The obtaining module 302 is further configured to obtain a target text from the text processing request, and obtain a font character set corresponding to the target text from the font file, where the target text is a text of a font to be updated.

And a font updating module 303, configured to update the font of each character in the target text according to the font character set.

A sending module 304, configured to send the updated target text to the terminal device.

In an embodiment, the obtaining module 302 is further configured to:

and acquiring the font file corresponding to the font identifier in the text processing request from the memory.

In an embodiment, the obtaining module 302 is further configured to:

splitting the target text into single characters to obtain a character set of the target text;

obtaining font characters corresponding to each character in the character set from the font file;

and taking the font character corresponding to each character in the character set as the font character set corresponding to the target text.

In an embodiment, the obtaining module 302 is further configured to:

splitting the target text into single characters to obtain a candidate character set of the target text;

and processing repeated characters in the candidate character set to obtain a character set of the target text, wherein the characters in the character set are not repeated.

Referring to fig. 6, fig. 6 is a schematic block diagram of a text processing apparatus according to an embodiment of the present disclosure.

As shown in fig. 6, the text processing apparatus 400 includes: a determining module 401, a first obtaining module 402, a second obtaining module 403, a third obtaining module 404, a font updating module 405 and a sending module 406.

The determining module 401 is configured to receive a text processing request sent by a terminal device, and determine whether the text processing request carries a font identifier.

A first obtaining module 402, configured to, if the text processing request does not carry a font identifier, obtain a user identifier from the text processing request, and obtain a font identifier set corresponding to the user identifier.

A second obtaining module 403, configured to select, according to the attribute information of each font identifier in the font identifier set, a font identifier from the font identifier set as a target font identifier, and obtain a font file corresponding to the target font identifier.

A third obtaining module 404, configured to obtain a target text from the text processing request, and obtain a font character set corresponding to the target text from the font file, where the target text is a text of a font to be updated.

A font updating module 405, configured to update the font of each character in the target text according to the font character set.

A sending module 406, configured to send the updated target text to the terminal device.

In one embodiment, as shown in fig. 6, the third obtaining module 404 includes:

the priority determining sub-module 4041 is configured to determine, according to the attribute information of each font identifier in the font identifier set, a priority corresponding to each font identifier.

An identifier determining sub-module 4042, configured to select the font identifier with the highest priority from the font identifier set as the target font identifier.

In an embodiment, the font updating module 405 is further configured to:

obtaining font characters corresponding to each character in the target text from the font character set;

and replacing each character in the target text with the font character corresponding to each character so as to update the font of each character in the target text.

It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and each module and unit described above may refer to the corresponding processes in the foregoing text processing method embodiment, and are not described herein again.

The apparatus provided by the above embodiments may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 7.

Referring to fig. 7, fig. 7 is a schematic block diagram illustrating a structure of a computer device according to an embodiment of the present disclosure. The computer device may be a server.

As shown in fig. 7, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.

The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any of the text processing methods.

The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.

The internal memory provides an environment for running a computer program in the non-volatile storage medium, which when executed by the processor, causes the processor to perform any of the text processing methods.

The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

In one embodiment, the processor is configured to execute a computer program stored in the memory to perform the steps of:

receiving a text processing request sent by a terminal device, and acquiring a font file corresponding to a font identifier in the text processing request;

acquiring a target text from the text processing request, and acquiring a font character set corresponding to the target text from the font file, wherein the target text is a text of a font to be updated;

and updating the font of each character in the target text according to the font character set, and sending the updated target text to the terminal equipment.

In one embodiment, before implementing the obtaining of the font file corresponding to the font identifier in the text processing request, the processor is further configured to implement:

determining whether the text processing request carries a font identifier;

if the text processing request does not carry the font identifier, acquiring a user identifier from the text processing request, and acquiring a font identifier set corresponding to the user identifier;

and selecting a font identifier from the font identifier set as a target font identifier according to the attribute information of each font identifier in the font identifier set, and acquiring a font file corresponding to the target font identifier.

In one embodiment, the processor, when implementing the obtaining of the attribute information according to each font identifier in the font identifier set, is configured to implement:

determining the priority corresponding to each font identifier according to the attribute information of each font identifier in the font identifier set;

selecting the highest priority font identifier from the set of font identifiers as a target font identifier.

In an embodiment, when implementing the obtaining of the font file corresponding to the font identifier in the text processing request, the processor is configured to implement:

and acquiring the font file corresponding to the font identifier in the text processing request from the memory.

In one embodiment, the processor, in implementing obtaining the font character set corresponding to the target text from the font file, is configured to implement:

splitting the target text into single characters to obtain a character set of the target text;

obtaining font characters corresponding to each character in the character set from the font file;

and taking the font character corresponding to each character in the character set as the font character set corresponding to the target text.

In one embodiment, the processor, in implementing the splitting of the target text into single words, obtains a word set of the target text, and is configured to implement:

splitting the target text into single characters to obtain a candidate character set of the target text;

and processing repeated characters in the candidate character set to obtain a character set of the target text, wherein the characters in the character set are not repeated.

In one embodiment, the processor, in implementing the updating the font of each word in the target text according to the font character set, is configured to implement:

obtaining font characters corresponding to each character in the target text from the font character set;

and replacing each character in the target text with the font character corresponding to each character so as to update the font of each character in the target text.

It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the computer device may refer to the corresponding process in the foregoing text processing method embodiment, and details are not described herein again.

Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, where the computer program includes program instructions, and a method implemented when the program instructions are executed may refer to various embodiments of the text processing method of the present application.

The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.

It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.

The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于计算机的字库设计方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!