CN110188326B - Rich text generating method, rich text generating device, computer equipment and storage medium - Google Patents

Rich text generating method, rich text generating device, computer equipment and storage medium Download PDF

Info

Publication number
CN110188326B
CN110188326B CN201810153559.6A CN201810153559A CN110188326B CN 110188326 B CN110188326 B CN 110188326B CN 201810153559 A CN201810153559 A CN 201810153559A CN 110188326 B CN110188326 B CN 110188326B
Authority
CN
China
Prior art keywords
text
node
current
preset
parameter information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810153559.6A
Other languages
Chinese (zh)
Other versions
CN110188326A (en
Inventor
朱必灯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Menggu Interactive Network Co ltd
Original Assignee
Shenzhen Menggu Interactive Network Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Menggu Interactive Network Co ltd filed Critical Shenzhen Menggu Interactive Network Co ltd
Priority to CN201810153559.6A priority Critical patent/CN110188326B/en
Publication of CN110188326A publication Critical patent/CN110188326A/en
Application granted granted Critical
Publication of CN110188326B publication Critical patent/CN110188326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a rich text generation method, a rich text generation device, computer equipment and a storage medium. The method comprises the following steps: acquiring a text to be processed, wherein the text to be processed comprises preset symbols, acquiring text parameter information corresponding to the preset symbols, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbols to obtain a common text; generating a corresponding ordinary text node according to the ordinary text, and generating a corresponding specific text node according to the specific text; and setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts. By adopting the method, the efficiency of generating the rich text can be improved.

Description

Rich text generating method, rich text generating device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a rich text generating method, a rich text generating device, a computer device, and a storage medium.
Background
Rich text refers to supporting the adjustment of the size, position, color and the like of specific characters on the basis of common text, highlighting the specific characters, and supporting a drawing and mergence function.
At present, a cocos2D-x (open source mobile 2D game frame) engine supports editing operation of rich text by self-contained UIRIchText, however, parameters of coordinates of nodes need to be set when the rich text is edited, setting the parameters of the coordinates is tedious and inefficient, setting the parameters can be completed through multiple times of debugging, and the efficiency of generating the rich text is low. And the line feed can not be automatically carried out on a large amount of texts and the processing of multiple languages, if the line feed is needed, a line feed symbol is needed to be added at the line feed position of the rich text, the line feed method has very high workload when being realized, high maintenance cost and very low efficiency of generating the rich text.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a rich text generation method, apparatus, computer device, and storage medium that can improve the rich text generation efficiency.
A rich text generating method, the method comprising:
acquiring a text to be processed, wherein the text to be processed contains a preset symbol;
acquiring text parameter information corresponding to a preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text;
generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts;
And setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
In one embodiment, obtaining text to be processed includes:
acquiring an original text, and acquiring specific characters or pictures in the original text;
and replacing the specific text or picture with a preset symbol to obtain the text to be processed.
In one embodiment, the parsing the text to be processed according to the preset symbol to obtain the normal text includes:
reading a text to be processed according to the paragraph sequence;
if the preset symbol is read in the current paragraph, acquiring a text to be processed before the preset symbol as a common text, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue; or alternatively
If the current paragraph does not read the preset symbol, acquiring a common text corresponding to the current paragraph, and sequentially storing the common text into a queue;
and returning to the step of reading the text to be processed according to the paragraph sequence until the text to be processed is read.
In one embodiment, setting the common text node and the specific text node in the preset layout interface according to the preset layout rule to obtain the rich text includes:
Acquiring a current text node, and calculating whether the current text node needs line feed or not, wherein the current text node is a common text node or a specific text node;
if not, acquiring the last text node in the current line of the preset layout interface, and setting the right alignment layout of the current text node by taking the last text node as a dependent node;
if yes, calculating a line feed position, dividing a current text node into a first part of text nodes and a second part of text nodes according to the line feed position, acquiring a last text node and a first text node in a current line of a preset layout interface, performing right-side alignment layout setting by taking the last text node as a dependent node on the first part of text nodes, and performing left-side alignment layout setting by taking the first text node as a dependent node on the next line of the current line of the preset layout interface on the second part of text nodes;
and returning to the step of acquiring the current text node, and calculating whether the current text node needs line feed or not until all the common text nodes and the specific text nodes are set in a preset layout interface to obtain rich text.
In one embodiment, setting the common text node and the specific text node in the preset layout interface according to the preset layout rule to obtain the rich text includes:
Acquiring the size of the current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size of the current text node and the initial position parameter information corresponding to the current text node;
calculating a final coordinate position according to the initial coordinate position and preset fine tuning parameter information, and setting the current text node at the final coordinate position of a preset layout interface;
and returning to the step of acquiring the size of the current text node and the initial position parameter information corresponding to the current text node until the layout of all the common text nodes and the specific text nodes is completed in a preset layout interface, and obtaining the rich text.
In one embodiment, calculating whether the current text node requires a line feed includes:
calculating the length of the current text node and the remaining length in the current line, if the length of the current text node exceeds the remaining length in the current line, line feed is needed, otherwise, line feed is not needed; or alternatively
And calculating the number of characters of the current text node and the number of the remaining allocable characters in the current line, if the number of the characters of the current text node is larger than the number of the remaining allocable characters in the current line, line feed is needed, otherwise, line feed is not needed.
In one embodiment, after setting the ordinary text node and the specific text node in the preset layout interface according to the preset layout rule, the method further includes:
when the specific text node is a dynamic change text node, a handle corresponding to the specific text node is generated, and the dynamic change text node is updated according to the handle.
A rich text generating apparatus, the apparatus comprising:
the text acquisition module is used for acquiring a text to be processed, wherein the text to be processed contains a preset symbol;
the text analysis module is used for acquiring text parameter information corresponding to the preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text;
the node generation module is used for generating corresponding ordinary text nodes according to the ordinary text and generating corresponding specific text nodes according to the specific text;
and the rich text obtaining module is used for setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
A computer device comprising a memory, a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
Acquiring a text to be processed, wherein the text to be processed contains a preset symbol;
acquiring text parameter information corresponding to a preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text;
generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts;
and setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a text to be processed, wherein the text to be processed contains a preset symbol;
acquiring text parameter information corresponding to a preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text;
generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts;
and setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
According to the rich text generation method, the rich text generation device, the computer equipment and the storage medium, the text to be processed is obtained, and the text to be processed contains the preset symbol. And acquiring text parameter information corresponding to the preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text. And generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts. The ordinary text nodes and the specific text nodes are arranged in a preset layout interface according to a preset layout rule to obtain the rich text, coordinate parameters can be obtained without multiple times of manual debugging, the rich text can be obtained without manually adding line feed symbols, and the rich text generation efficiency is improved.
Drawings
FIG. 1 is an application environment diagram of a rich text generation method in one embodiment;
FIG. 2 is a flow diagram of a rich text generation method in one embodiment;
FIG. 3 is a flow diagram of text to be processed in one embodiment;
FIG. 4 is a flow diagram of parsing text to be processed in one embodiment;
FIG. 5 is a flow diagram of obtaining rich text in one embodiment;
FIG. 6 is a schematic flow chart of obtaining rich text in another embodiment;
FIG. 7 is a schematic diagram of rich text generated in one particular embodiment;
FIG. 8 is a block diagram of a rich text generating apparatus in one embodiment;
fig. 9 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The rich text generation method provided by the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 obtains a text to be processed, the text to be processed contains preset symbols, the server 104 obtains text parameter information corresponding to the preset symbols, generates a specific text according to the text parameter information, and analyzes the text to be processed according to the preset symbols to obtain a common text. The server 104 generates a corresponding plain text node from the plain text and a corresponding specific text node from the specific text. The server 104 sets the ordinary text node and the specific text node in a preset layout interface according to a preset layout rule to obtain a rich text, and then the server 104 can transmit the obtained rich text to the terminal 102 through a network, and the terminal 102 receives and displays the rich text. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a rich text generating method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s202, acquiring a text to be processed, wherein the text to be processed contains a preset symbol.
Specifically, the text to be processed is a text obtained by replacing characters or pictures which need to be specially processed in the original text with preset symbols in advance. The preset symbol may be any symbol different from the text or picture to be specially processed, for example, the preset symbol may be "#", etc. And obtaining a text to be processed, wherein the text to be processed contains a preset symbol.
S204, obtaining text parameter information corresponding to the preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text.
The text parameter information is that parameters of characters or pictures which need to be specially processed are set in advance, and the parameters can be specific contents, colors, heights, word size, picture names, picture sizes and the like of the characters or pictures which need to be specially processed. The specific text is a specially processed text or picture to be displayed specifically in the rich text.
Specifically, text parameter information corresponding to a preset symbol in a preset text to be processed is obtained, and a specific text is generated according to the text parameter information. And then analyzing the text to be processed according to the preset symbol, namely reading the text except the preset symbol, and obtaining the common text. For example: the preset symbol is ". Times.and the text parameter information means that the text content corresponding to". Times.is "20", the color is red, and the size of the word size is Song body number 5. The resulting specific text is then "20" (the color of 20 is red and the size of the font is Song body No. 5).
In one embodiment, the text parameter information further includes parameter information such as buttons, selection boxes, etc. that need to be specially processed.
S206, generating corresponding ordinary text nodes according to the ordinary text, and generating corresponding specific text nodes according to the specific text.
The node in the present application refers to each element displayed on the preset layout interface, for example: may be a picture, may be a button, may be a piece of text, etc.
And generating corresponding ordinary text nodes according to the content sequence of the text to be processed and generating corresponding specific text nodes according to the specific text.
And S208, setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
The preset layout rule may be a rule set according to a nine-grid layout characteristic, which refers to setting the position of the current node at nine positions of upper left, middle left, lower left, middle upper middle, middle lower middle, upper right, middle right and lower right of the reference object based on the current reference object. The layout rule may be set by introducing a dependent node, that is, the position of the node may be set by selecting another node as a reference.
Specifically, the ordinary text nodes and the specific text nodes are sequentially arranged in a preset layout interface according to the content sequence of the text to be processed and the preset layout rule, and when all the ordinary text nodes and the specific text nodes are arranged, the rich text is obtained.
In the above embodiment, the text to be processed includes the preset symbol by acquiring the text to be processed. And acquiring text parameter information corresponding to the preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text. And generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts. The ordinary text nodes and the specific text nodes are arranged in a preset layout interface according to a preset layout rule to obtain the rich text, coordinate parameters can be obtained without multiple times of manual debugging, the rich text can be obtained without manually adding line feed symbols, and the rich text generation efficiency is improved.
In one embodiment, as shown in fig. 3, step S202, that is, obtaining text to be processed, includes the steps of:
s302, acquiring an original text, and acquiring specific characters or pictures in the original text.
Specifically, the original text refers to a text to be generated into a rich text, and the text or picture in the original text, which needs to be specially processed when the rich text is generated, is obtained as a specific text or picture, and the specific text or picture can be multiple. For example: the original text is "we have 20 people," where "20" is a specific word.
S304, replacing the specific text or picture with a preset symbol to obtain the text to be processed.
Specifically, all specific characters or pictures in the original text are replaced by preset symbols, so that the text to be processed is obtained.
In the above embodiment, the specific characters or pictures in the original text are replaced by the preset symbols to obtain the text to be processed, so that the characters or pictures can be clearly defined to be processed when the rich text is generated, and the efficiency of generating the rich text is improved.
In one embodiment, as shown in fig. 4, the text to be processed is parsed according to a preset symbol to obtain a common text, which includes the steps of:
S402, reading the text to be processed according to the paragraph sequence.
In particular, the content in the text to be processed is generally formed in the form of paragraphs, and the text to be processed is read according to the paragraph sequence, that is, the text to be processed is read according to the paragraph sequence.
S404, judging whether the current paragraph reads the preset symbol.
Specifically, when the current paragraph is read, it is determined whether the preset symbol position in the current paragraph is read, if the preset symbol position in the current paragraph is read, step S404B is executed, and if the preset symbol is not read in the current paragraph, step S404A is executed.
S404B, acquiring a text to be processed before the preset symbol as a common text, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue.
Specifically, the text content to be processed in front of the preset symbol position in the current paragraph is used as a common text, then a specific text corresponding to the preset symbol position is acquired, then the common text and the specific text are sequentially stored in a queue, sequentially stored in the queue according to the sequence of the text content to be processed, and then the text to be processed in front of the preset symbol position in the current paragraph is continuously read until the current paragraph is read. For example: the current paragraph is "one family most hold" bit member ", when reading" × ", the" one family most hold "is taken as the normal text, the specific text" 30 (color is red, size of word size bit songbody No. 5) "corresponding to" × ", then reading is continued, and the" bit member "is taken as the normal text, and the queue saved at this time is {" one family most hold "," 30"," bit member "}.
S404A, obtaining a common text corresponding to the current paragraph, and sequentially storing the common text into a queue.
Specifically, if the current paragraph does not have the preset symbol, taking the read current paragraph as a common text, and sequentially storing the common text into a queue according to the sequence of the text contents to be processed. For example: the current paragraph is "ordinary member," then "ordinary member" is saved as ordinary text in the queue. If there is { "one family most holding", "30", "bit member" } in the queue at this time, then the resulting queue is { "one family most holding", "30", "bit member", "normal member" }.
S406, judging whether the text to be processed is read completely.
Specifically, whether the text to be processed is read is judged to be completed, that is, whether the text to be processed is all saved in the queue is judged, if the text to be processed is not all saved in the queue, the step S402 is returned to be executed, that is, the next paragraph of the current paragraph in the text to be processed is read. If all the texts to be processed are stored in the queue, analyzing the texts to be processed is completed.
In one embodiment, the resulting plain text and specific text may be saved in an XML (Extensible Markup Language ) format.
In the above embodiment, the text to be processed is read by following the paragraph order; if the preset symbol is read in the current paragraph, acquiring a text to be processed before the preset symbol as a common text, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue; or if the current paragraph does not read the preset symbol, acquiring a common text corresponding to the current paragraph, and sequentially storing the common text into a queue; and returning to the step of reading the text to be processed according to the paragraph sequence until the text to be processed is read. The analysis of the text to be processed is realized, so that the normal text and the specific text are defined, the corresponding nodes are generated conveniently, and the efficiency of generating the rich text is improved.
In one embodiment, as shown in fig. 5, step S208, that is, setting a normal text node and a specific text node in a preset layout interface according to a preset layout rule, obtains rich text, includes the steps of:
s502, acquiring a current text node, wherein the current text node is a common text node or a specific text node.
Specifically, a current text node is obtained, wherein the current text node can be a common text node or a specific text node.
S504, calculating whether the current text node needs line feed or not.
Specifically, it is calculated whether the current text node can be set in the current line, if so, the line feed is not required, step S504A is executed, and if the current text node cannot be set completely in the current line, the line feed is required, step S504B is executed.
S504A, the last text node in the current line of the preset layout interface is obtained, and the current text node is used as a dependent node for right alignment layout setting.
Specifically, the last text node in the current line of the preset layout interface is obtained, and the current text node is set by taking the last text node as a dependent node in a right alignment manner, namely the current text node is set behind the last text node in the current line of the preset layout interface and is aligned with the right side of the last text node.
In one embodiment, if there is no text node in the current line, the current text node is directly set at the leftmost position of the current line of the preset layout interface.
S504B, calculating a line feed position, dividing a current text node into a first part of text nodes and a second part of text nodes according to the line feed position, acquiring a last text node and a first text node in the current line of a preset layout interface, performing right-side alignment layout setting by taking the last text node as a dependent node on the first part of text nodes, and performing left-side alignment layout setting by taking the first text node as a dependent node on the next line of the current line of the preset layout interface on the second part of text nodes.
Wherein the first partial text node is a portion of a current text node to be set in a current line and the second partial text node is a portion of the current text node to be set in a next line of the current line.
Specifically, the line feed position is calculated, that is, the separation position of the current text node is calculated. And separating the current text nodes according to the separation positions to obtain a first part of text nodes and a second part of text nodes. And setting the first part of text nodes in the current line according to the method of the step S504A, namely acquiring the last text node in the current line of the preset layout interface, and setting the right alignment layout of the first part of text nodes by taking the last text node as a dependent node. And then acquiring a first text node in the current line of the preset layout interface, and performing left-side alignment layout setting on the next line of the current line of the preset layout interface by taking the first text node as a dependent node for the second part of text nodes.
In one embodiment, before the second part of text nodes are set to be aligned to the left on the next line of the current line of the preset layout interface by taking the first text node as the dependent node, it is further required to calculate whether the second part of text nodes need to be line-fed. And returning to the step S504B for execution when the second part of text nodes need to be changed in the next line of the current line until the separated second part of text nodes do not need to be changed, and setting the left alignment layout of the second part of text nodes which do not need to be changed in the next line of the current line of the preset layout interface by taking the first text node as the dependent node.
In one embodiment, a preset line feed location is obtained, and the current text node is partitioned according to the preset line feed location. The preset line-feeding position refers to a preset line-feeding position according to different languages, and the line-feeding position can be on a specific text point.
S506, judging whether all the ordinary text nodes and the specific text nodes are set in the preset layout interface, if yes, obtaining rich text, otherwise, returning to the step S502 for executing.
Specifically, if all the normal text nodes and the specific text nodes are set in the preset layout interface, rich text is obtained, otherwise, step S502 is continued to be executed.
In the embodiment, by introducing the layout rule of the dependent node, the coordinate parameters can be obtained without a plurality of times of manual debugging when the rich text is generated, and the rich text can be obtained without manually adding a line feed symbol, so that the rich text generation efficiency is improved.
In one embodiment, as shown in fig. 6, step S208, setting a normal text node and a specific text node in a preset layout interface according to a preset layout rule to obtain rich text, includes the steps of:
s602, acquiring the size of the current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size of the current text node and the initial position parameter information corresponding to the current text node.
The size of the current text node comprises the length, the width and the anchor point of the current text node, and the anchor point refers to which point of the current text node is set to the corresponding coordinate position when one node is set to the position. The initial position parameter information refers to preset nine-grid layout parameter information, and according to the nine-grid layout parameter information, the current text node can be directly set at a specific position, so that specific position coordinate values, for example, (121.5,128.5) are not required to be known.
Specifically, the size of the current text node and the initial position parameter information corresponding to the current text node are obtained, and the initial coordinate position in the preset layout interface is calculated according to the size of the current text node and the nine-grid layout parameter information corresponding to the current text node. For example, the nine-grid layout parameter information is the upper left, the size of the current text node is 5 in width and 10 in length, and the anchor point is the upper left corner. Generally, in the coordinate system of the layout interface, the lower left corner is the origin, and the width 20 and the length 50 of the layout interface are preset. The initial coordinate position obtained is 20 wide and 0 long.
In one embodiment, when layout setting is performed, the size of the current text node is obtained, the coordinate system of the current text node is obtained, and the coordinate system of the dependent node or the parent node is obtained, wherein the parent node refers to an upper node of one node. The coordinate system of the front node is converted into a coordinate system of the dependent node or parent node. For example, if the anchor point of the current text node is at (0.5 ) in the current text node coordinate system, the coordinates of the anchor point are converted to the coordinate system of the dependent node or parent node. The anchor point has different coordinates in different coordinate systems, and coordinate system conversion is carried out to obtain the coordinates of the anchor point in the coordinate system of the dependent node or the father node.
S604, calculating a final coordinate position according to the initial coordinate position and the preset fine tuning parameter information, and setting the current text node at the final coordinate position of the preset layout interface.
The preset fine tuning parameter information comprises step parameter information and offset parameter information, wherein the step parameter information can move the distance of the current node by how many steps of the size of the current node, and the offset parameter information refers to how much distance is moved up, down, left and right in a preset layout interface.
Specifically, a final coordinate position is calculated according to the initial coordinate position and the preset fine tuning parameter information, and then the current text node is set at the final coordinate position of the preset layout interface.
S606, judging whether the layout of all the ordinary text nodes and the specific text nodes is completed in a preset layout interface, if yes, obtaining rich text, otherwise, returning to the step S602 for execution.
Specifically, if all the normal text nodes and the specific text nodes are set in the preset layout interface, rich text is obtained, otherwise, step S602 is continued.
In the above embodiment, the initial coordinate position is calculated according to the size of the current text node and the initial position parameter information corresponding to the current text node, the final coordinate position is calculated according to the initial coordinate position and the preset fine adjustment parameter information, the current text node is set at the final coordinate position of the preset layout interface, and if all the ordinary text nodes and the specific text nodes are set in the preset layout interface, the rich text is obtained. The coordinate parameters can be obtained without manual debugging for many times when the rich text is generated, and the rich text can be obtained without manually adding line feed symbols, so that the rich text generation efficiency is improved.
In one embodiment, calculating whether the current text node requires a line wrap includes:
and calculating the length of the current text node and the remaining length in the current line, if the length of the current text node exceeds the remaining length in the current line, line feed is needed, otherwise, line feed is not needed.
Specifically, the length of the current text node and the length of the current text node which can be allocated and is remained in the current line are calculated, if the length of the current text node exceeds the remained length in the current line, line feed is needed, otherwise, line feed is not needed.
In one embodiment, calculating whether the current text node requires a line wrap includes:
and calculating the number of characters of the current text node and the number of the remaining allocable characters in the current line, if the number of the characters of the current text node is larger than the number of the remaining allocable characters in the current line, line feed is needed, otherwise, line feed is not needed.
Specifically, when only the condition that the font sizes of one language or multiple languages are consistent is processed, the number of characters of the current text node and the number of the remaining allocatable characters in the current line are calculated, if the number of the characters of the current text node is larger than the number of the remaining allocatable characters in the current line, line feed is needed, otherwise, line feed is not needed.
In the above embodiment, by calculating the length or the number of characters of the current text node and the corresponding remaining allocable length or the number of characters in the current line, if the length of the current text node exceeds the remaining length in the current line or the number of characters of the current text node is greater than the remaining allocable number of characters in the current line, line feed is required, otherwise, line feed is not required, so that no line feed symbol is required to be manually added, and the efficiency of generating rich text is improved.
In one embodiment, after step S208, that is, after the ordinary text node and the specific text node are set in the preset layout interface according to the preset layout rule, the method further includes the steps of:
when the specific text node is a dynamic change text node, a handle corresponding to the specific text node is generated, and the dynamic change text node is updated according to the handle.
Specifically, a dynamically changing text node refers to a node that needs to be refreshed dynamically, such as: dynamically changing text nodes are time-varying parameters. At this time, a handle corresponding to the specific text node is generated, and the dynamically changed text node is updated according to the handle.
In the above embodiment, when the specific text node is a dynamic text node, a handle corresponding to the specific text node is generated, and the dynamic text node is updated according to the handle, so that the generated rich text can meet different requirements.
In a specific embodiment, where there are many activities or functions played within a game, in order for the player to understand the play and rules of the corresponding function, an interface associated with the help document needs to be presented. Help documents are often text with a relatively long width, and when it is desired to highlight the important text in the long width, some highlighting needs to be performed on some text fonts or colors, or pictures are inserted into a large number of characters to facilitate understanding of players, so that a flexible rich text is needed to deal with the situation. Firstly, characters or pictures and the like needing special treatment in an original text are replaced by preset symbols, and a text to be treated is obtained. And acquiring text parameter information corresponding to each replaced preset symbol, and setting parameters to be displayed, such as specific content, color, height, word size, picture name and the like, corresponding to the preset symbol in the text parameter information. Analyzing the text to be processed and the text parameter information, reading the text to be processed according to paragraph sequence, cutting the text to be processed before the preset symbol when the preset symbol is read, storing the text to be processed in a queue, acquiring the text parameter information corresponding to the preset symbol according to the word sequence of different languages, acquiring a specific text according to the text parameter information, storing the specific text in the queue of the text to be processed just before the preset symbol, and analogizing the text in sequence until the whole text is split and stored in the queue. And generating nodes in turn according to the queue, and calculating whether the length of the current node needs to be cut or not, or acquiring a preset line feed cutting position, for example, when the rich text language is Thai, the preset line feed cutting position is needed. If no clipping is needed, the node is arranged in a right alignment mode by taking the last node in the current row as a dependent node, and if the line is needed to be fed, the part needing to be fed is arranged in a left lower alignment mode by taking the first node in the current row as the dependent node. And so on until all the nodes are laid out and set, and obtaining the rich text. For example: the rich text to be generated may be rich text as shown in fig. 7, where the dotted box is not labeled with a plain text node, and the dotted box is labeled with a specific text node such as: 30 identified by reference numeral 702, 1 identified by reference numeral 704, 2 identified by reference numeral 706 and 10 identified by reference numeral 708. The color of the fonts identified by all the labels is red. It should be noted that the generated rich text does not have a dotted box, and the dotted box is provided for convenience of description.
It should be understood that, although the steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 8, there is provided a rich text generating apparatus 800 including: a text acquisition module 802, a text parsing module 804, a node generation module 806, and a rich text obtaining module 808, wherein:
a text obtaining module 802, configured to obtain a text to be processed, where the text to be processed includes a preset symbol;
the text parsing module 804 is configured to obtain text parameter information corresponding to a preset symbol, generate a specific text according to the text parameter information, and parse a text to be processed according to the preset symbol to obtain a common text;
The node generating module 806 is configured to generate a corresponding plain text node according to the plain text, and generate a corresponding specific text node according to the specific text;
and the rich text obtaining module 808 is configured to set the normal text node and the specific text node in a preset layout interface according to a preset layout rule to obtain a rich text.
In the above embodiment, the text to be processed is obtained by the text obtaining module 802, the text to be processed is parsed by the text parsing module 804 to obtain the normal text, and the text parameter information is obtained to obtain the specific text. The node generating module 806 generates the corresponding nodes according to the common text and the specific text, and finally the rich text obtaining module 808 sets the common text node and the specific text node in a preset layout interface according to a preset layout rule to obtain the rich text, so that node coordinate parameters can be obtained without multiple times of manual debugging, the rich text can be obtained without manually adding line-feed symbols, and the rich text generating efficiency is improved.
In one embodiment, text acquisition module 802 includes:
the original text acquisition module is used for acquiring an original text and acquiring specific characters or pictures in the original text;
And the replacing module is used for replacing the specific text or picture with a preset symbol to obtain the text to be processed.
In one embodiment, text parsing module 804 includes:
the reading module is used for reading the text to be processed according to the paragraph sequence;
the text storage module is used for acquiring a text to be processed before the preset symbol as a common text when the preset symbol is read in the current paragraph, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue; or alternatively
The common text storage module is used for acquiring a common text corresponding to the current paragraph and sequentially storing the common text into the queue if the current paragraph does not read the preset symbol;
and the reading completion module is used for returning to the step of reading the text to be processed according to the paragraph sequence until the text to be processed is read.
In one embodiment, the rich text obtaining module 808 includes:
the line feed judging module is used for acquiring a current text node, calculating whether the current text node needs line feed or not, wherein the current text node is a common text node or a specific text node;
the line-feed-free layout setting module is used for acquiring the last text node in the current line of the preset layout interface if not, and carrying out right alignment layout setting on the current text node by taking the last text node as a dependent node;
The line feed layout setting module is used for calculating a line feed position if the line feed position is yes, dividing the current text node into a first part of text nodes and a second part of text nodes according to the line feed position, acquiring a last text node and a first text node in the current line of the preset layout interface, performing right alignment layout setting by taking the last text node as a dependent node on the first part of text nodes, and performing left alignment layout setting by taking the first text node as a dependent node on the next line of the current line of the preset layout interface;
the rich text obtaining module is used for returning to obtain the current text node, calculating whether the current text node needs to be line-fed or not until all the common text nodes and the specific text nodes are set in a preset layout interface, and obtaining rich text.
In one embodiment, the rich text obtaining module 808 includes:
the initial coordinate calculation module is used for acquiring the size of the current text node and the initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size of the current text node and the initial position parameter information corresponding to the current text node;
The final coordinate calculation module is used for calculating a final coordinate position according to the initial coordinate position and the preset fine adjustment parameter information, and setting the current text node at the final coordinate position of the preset layout interface;
and the rich text generation module is used for returning to the step of acquiring the size of the current text node and the initial position parameter information corresponding to the current text node until the layout of all the common text nodes and the specific text nodes is completed in the preset layout interface, and obtaining the rich text.
In one embodiment, the line feed determination module includes:
the length calculation module is used for calculating the length of the current text node and the remaining length in the current line, if the length of the current text node exceeds the remaining length in the current line, line feed is needed, otherwise, line feed is not needed; or alternatively
The character number calculation module is used for calculating the current text node character number and the residual allocable character number in the current line, if the current text node character number is larger than the residual allocable character number in the current line, line feed is needed, otherwise, line feed is not needed.
In one embodiment, the rich text generating apparatus 800 further includes:
and the dynamic change text node updating module is used for generating a handle corresponding to the specific text node when the specific text node is the dynamic change text node, and updating the dynamic change text node according to the handle.
For specific limitations of the rich text generating apparatus, reference may be made to the above limitation of the rich text generating method, and no further description is given here. The respective modules in the above-described rich text generating apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server or a terminal, and the internal structure of the computer device may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a rich text generating method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by persons skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of: acquiring a text to be processed, wherein the text to be processed contains a preset symbol; acquiring text parameter information corresponding to a preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text; generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts; and setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring an original text, and acquiring specific characters or pictures in the original text; and replacing the specific text or picture with a preset symbol to obtain the text to be processed.
In one embodiment, the processor when executing the computer program further performs the steps of: reading a text to be processed according to the paragraph sequence; if the preset symbol is read in the current paragraph, acquiring a text to be processed before the preset symbol as a common text, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue; or if the current paragraph does not read the preset symbol, acquiring a common text corresponding to the current paragraph, and sequentially storing the common text into a queue; and returning to the step of reading the text to be processed according to the paragraph sequence until the text to be processed is read.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a current text node, and calculating whether the current text node needs line feed or not, wherein the current text node is a common text node or a specific text node; if not, acquiring the last text node in the current line of the preset layout interface, and setting the right alignment layout of the current text node by taking the last text node as a dependent node; if yes, calculating a line feed position, dividing a current text node into a first part of text nodes and a second part of text nodes according to the line feed position, acquiring a last text node and a first text node in a current line of a preset layout interface, performing right-side alignment layout setting by taking the last text node as a dependent node on the first part of text nodes, and performing left-side alignment layout setting by taking the first text node as a dependent node on the next line of the current line of the preset layout interface on the second part of text nodes; and returning to the step of acquiring the current text node, and calculating whether the current text node needs line feed or not until all the common text nodes and the specific text nodes are set in a preset layout interface to obtain rich text.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring the size of the current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size of the current text node and the initial position parameter information corresponding to the current text node; calculating a final coordinate position according to the initial coordinate position and preset fine tuning parameter information, and setting the current text node at the final coordinate position of a preset layout interface; and returning to the step of acquiring the size of the current text node and the initial position parameter information corresponding to the current text node until the layout of all the common text nodes and the specific text nodes is completed in a preset layout interface, and obtaining the rich text.
In one embodiment, the processor when executing the computer program further performs the steps of: calculating the length of the current text node and the remaining length in the current line, if the length of the current text node exceeds the remaining length in the current line, line feed is needed, otherwise, line feed is not needed; or calculating the current text node character number and the number of the residual allocable characters in the current line, if the current text node character number is larger than the number of the residual allocable characters in the current line, line feed is needed, otherwise, line feed is not needed.
In one embodiment, the processor when executing the computer program further performs the steps of: when the specific text node is a dynamic change text node, a handle corresponding to the specific text node is generated, and the dynamic change text node is updated according to the handle.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a text to be processed, wherein the text to be processed contains a preset symbol; acquiring text parameter information corresponding to a preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text; generating corresponding ordinary text nodes according to the ordinary texts, and generating corresponding specific text nodes according to the specific texts; and setting the common text nodes and the specific text nodes in a preset layout interface according to a preset layout rule to obtain rich texts.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring an original text, and acquiring specific characters or pictures in the original text; and replacing the specific text or picture with a preset symbol to obtain the text to be processed.
In one embodiment, the computer program when executed by the processor further performs the steps of: reading a text to be processed according to the paragraph sequence; if the preset symbol is read in the current paragraph, acquiring a text to be processed before the preset symbol as a common text, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue; or if the current paragraph does not read the preset symbol, acquiring a common text corresponding to the current paragraph, and sequentially storing the common text into a queue; and returning to the step of reading the text to be processed according to the paragraph sequence until the text to be processed is read.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a current text node, and calculating whether the current text node needs line feed or not, wherein the current text node is a common text node or a specific text node; if not, acquiring the last text node in the current line of the preset layout interface, and setting the right alignment layout of the current text node by taking the last text node as a dependent node; if yes, calculating a line feed position, dividing a current text node into a first part of text nodes and a second part of text nodes according to the line feed position, acquiring a last text node and a first text node in a current line of a preset layout interface, performing right-side alignment layout setting by taking the last text node as a dependent node on the first part of text nodes, and performing left-side alignment layout setting by taking the first text node as a dependent node on the next line of the current line of the preset layout interface on the second part of text nodes; and returning to the step of acquiring the current text node, and calculating whether the current text node needs line feed or not until all the common text nodes and the specific text nodes are set in a preset layout interface to obtain rich text.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the size of the current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size of the current text node and the initial position parameter information corresponding to the current text node; calculating a final coordinate position according to the initial coordinate position and preset fine tuning parameter information, and setting the current text node at the final coordinate position of a preset layout interface; and returning to the step of acquiring the size of the current text node and the initial position parameter information corresponding to the current text node until the layout of all the common text nodes and the specific text nodes is completed in a preset layout interface, and obtaining the rich text.
In one embodiment, the computer program when executed by the processor further performs the steps of: calculating the length of the current text node and the remaining length in the current line, if the length of the current text node exceeds the remaining length in the current line, line feed is needed, otherwise, line feed is not needed; or calculating the current text node character number and the number of the residual allocable characters in the current line, if the current text node character number is larger than the number of the residual allocable characters in the current line, line feed is needed, otherwise, line feed is not needed.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the specific text node is a dynamic change text node, a handle corresponding to the specific text node is generated, and the dynamic change text node is updated according to the handle.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A rich text generating method, the method comprising:
acquiring a text to be processed, wherein the text to be processed comprises a preset symbol;
acquiring text parameter information corresponding to the preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text;
generating a corresponding ordinary text node according to the ordinary text, and generating a corresponding specific text node according to the specific text;
Setting the common text node and the specific text node in a preset layout interface according to a preset layout rule to obtain rich text, wherein the method comprises the following steps: acquiring the size of a current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size and the initial position parameter information, wherein the size comprises the length, the width and an anchor point of the current text node, the anchor point is used for setting the node to the corresponding coordinate position, the initial position parameter information is preset nine-grid layout parameter information, and the nine-grid layout parameter information is used for setting the current text node at a specific position; calculating a final coordinate position according to the initial coordinate position and preset fine tuning parameter information, setting the current text node at the final coordinate position of the preset layout interface, wherein the preset fine tuning parameter information comprises step parameter information and offset parameter information, the step parameter information refers to the step distance of the size of the movable current node, and the offset parameter information refers to the movable distance in the preset layout interface; the current text node is the ordinary text node or the specific text node; the anchor point has different coordinates in different coordinate systems, the coordinate system of the current text node is obtained by obtaining the size of the current text node, the coordinate system of the current text node is converted into the coordinate system of a dependent node or a father node, the coordinate of the anchor point in the coordinate system of the dependent node or the father node is obtained, and the father node refers to the upper node of one node.
2. The method of claim 1, wherein the obtaining text to be processed comprises:
acquiring an original text, and acquiring specific characters or pictures in the original text;
and replacing the specific text or the picture with a preset symbol to obtain a text to be processed.
3. The method according to claim 1, wherein the parsing the text to be processed according to the preset symbol to obtain a normal text includes:
reading the text to be processed according to paragraph sequence;
if a preset symbol is read in the current paragraph, acquiring a text to be processed before the preset symbol as a common text, acquiring a specific text corresponding to the preset symbol, and sequentially storing the common text and the specific text into a queue; or alternatively
If the current paragraph does not read the preset symbol, acquiring a common text corresponding to the current paragraph, and sequentially storing the common text into a queue;
and returning to the step of reading the text to be processed according to the paragraph sequence until the text to be processed is read.
4. The method according to claim 1, wherein the setting the normal text node and the specific text node in a preset layout interface according to a preset layout rule to obtain rich text includes:
Acquiring the current text node, and calculating whether the current text node needs line feed, wherein the current text node is the common text node or the specific text node;
if not, acquiring the last text node in the current line of the preset layout interface, and performing right alignment layout setting by taking the last text node as a dependent node;
if yes, calculating a line feed position, dividing the current text node into a first part of text nodes and a second part of text nodes according to the line feed position, acquiring a last text node and a first text node in a current line of a preset layout interface, performing right alignment layout setting by taking the last text node as a dependent node on the first part of text nodes, and performing left alignment layout setting by taking the first text node as a dependent node on a next line of the current line of the preset layout interface on the second part of text nodes;
and returning to the step of acquiring the current text node, and calculating whether the current text node needs line feed or not until all the common text nodes and the specific text nodes are set in a preset layout interface to obtain rich text.
5. The method according to claim 1, wherein the setting the normal text node and the specific text node in a preset layout interface according to a preset layout rule to obtain rich text includes:
acquiring the size of the current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size of the current text node and the initial position parameter information corresponding to the current text node;
calculating a final coordinate position according to the initial coordinate position and preset fine tuning parameter information, and setting the current text node at a preset layout interface final coordinate position;
and returning to the step of acquiring the size of the current text node and the initial position parameter information corresponding to the current text node until the layout of all the common text nodes and the specific text nodes is completed in a preset layout interface, and obtaining rich text.
6. A method according to claim 3, wherein said calculating whether the current text node requires a line wrap comprises:
calculating the length of a current text node and the remaining length in a current line, if the length of the current text node exceeds the remaining length in the current line, line feed is needed, otherwise, line feed is not needed; or alternatively
And calculating the current text node character number and the number of the residual allocable characters in the current line, if the current text node character number is larger than the number of the residual allocable characters in the current line, line feed is needed, otherwise, line feed is not needed.
7. The method according to claim 1, further comprising, after said setting the ordinary text node and the specific text node in a preset layout interface according to a preset layout rule, obtaining rich text:
and when the specific text node is a dynamic change text node, generating a handle corresponding to the specific text node, and updating the dynamic change text node according to the handle.
8. A rich text generating apparatus, the apparatus comprising:
the text acquisition module is used for acquiring a text to be processed, wherein the text to be processed comprises a preset symbol;
the text analysis module is used for acquiring text parameter information corresponding to the preset symbol, generating a specific text according to the text parameter information, and analyzing the text to be processed according to the preset symbol to obtain a common text;
the node generation module is used for generating corresponding ordinary text nodes according to the ordinary text and generating corresponding specific text nodes according to the specific text;
The rich text obtaining module is configured to set the common text node and the specific text node in a preset layout interface according to a preset layout rule, and obtain a rich text, including: acquiring the size of a current text node and initial position parameter information corresponding to the current text node, and calculating an initial coordinate position according to the size and the initial position parameter information, wherein the size comprises the length, the width and an anchor point of the current text node, the anchor point is used for setting the node to the corresponding coordinate position, the initial position parameter information is preset nine-grid layout parameter information, and the nine-grid layout parameter information is used for setting the current text node at a specific position; calculating a final coordinate position according to the initial coordinate position and preset fine tuning parameter information, setting the current text node at the final coordinate position of the preset layout interface, wherein the preset fine tuning parameter information comprises step parameter information and offset parameter information, the step parameter information refers to the step distance of the size of the movable current node, and the offset parameter information refers to the movable distance in the preset layout interface; the current text node is the ordinary text node or the specific text node; the anchor point has different coordinates in different coordinate systems, the coordinate system of the current text node is obtained by obtaining the size of the current text node, the coordinate system of the current text node is converted into the coordinate system of a dependent node or a father node, the coordinate of the anchor point in the coordinate system of the dependent node or the father node is obtained, and the father node refers to the upper node of one node.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN201810153559.6A 2018-02-22 2018-02-22 Rich text generating method, rich text generating device, computer equipment and storage medium Active CN110188326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810153559.6A CN110188326B (en) 2018-02-22 2018-02-22 Rich text generating method, rich text generating device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810153559.6A CN110188326B (en) 2018-02-22 2018-02-22 Rich text generating method, rich text generating device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110188326A CN110188326A (en) 2019-08-30
CN110188326B true CN110188326B (en) 2023-08-11

Family

ID=67704598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810153559.6A Active CN110188326B (en) 2018-02-22 2018-02-22 Rich text generating method, rich text generating device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110188326B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11853688B2 (en) * 2022-03-04 2023-12-26 Adobe Inc. Automatic detection and removal of typesetting errors in electronic documents

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001084253A (en) * 1999-09-10 2001-03-30 Dream Technologies Kk Device and method for preparing inter-document link
US6381620B1 (en) * 1997-12-10 2002-04-30 Matsushita Electric Industrial Co., Ltd. Rich text medium displaying method and picture information providing system using calculated average reformatting time for multimedia objects
CN102799592A (en) * 2011-05-26 2012-11-28 腾讯科技(深圳)有限公司 Parsing method and system of rich text document
CN103530407A (en) * 2013-10-25 2014-01-22 中国农业银行股份有限公司 Method and device for generating rich text document
CN104462029A (en) * 2013-09-18 2015-03-25 北京新媒传信科技有限公司 Method and system for rich text display in intelligent terminal
CN106547560A (en) * 2016-11-01 2017-03-29 福建星网锐捷通讯股份有限公司 Text based on Android system and other component mixing method and devices
CN106776552A (en) * 2016-12-06 2017-05-31 掌阅科技股份有限公司 File identification method, device, server and computer-readable storage medium
WO2018000655A1 (en) * 2016-06-28 2018-01-04 乐视控股(北京)有限公司 Rich text editing method, apparatus, mobile terminal and electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8321919B2 (en) * 2007-09-05 2012-11-27 Oracle International Corp. Framework for delegating roles in human resources ERP systems

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6381620B1 (en) * 1997-12-10 2002-04-30 Matsushita Electric Industrial Co., Ltd. Rich text medium displaying method and picture information providing system using calculated average reformatting time for multimedia objects
JP2001084253A (en) * 1999-09-10 2001-03-30 Dream Technologies Kk Device and method for preparing inter-document link
CN102799592A (en) * 2011-05-26 2012-11-28 腾讯科技(深圳)有限公司 Parsing method and system of rich text document
CN104462029A (en) * 2013-09-18 2015-03-25 北京新媒传信科技有限公司 Method and system for rich text display in intelligent terminal
CN103530407A (en) * 2013-10-25 2014-01-22 中国农业银行股份有限公司 Method and device for generating rich text document
WO2018000655A1 (en) * 2016-06-28 2018-01-04 乐视控股(北京)有限公司 Rich text editing method, apparatus, mobile terminal and electronic device
CN106547560A (en) * 2016-11-01 2017-03-29 福建星网锐捷通讯股份有限公司 Text based on Android system and other component mixing method and devices
CN106776552A (en) * 2016-12-06 2017-05-31 掌阅科技股份有限公司 File identification method, device, server and computer-readable storage medium

Also Published As

Publication number Publication date
CN110188326A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
US9111007B2 (en) Adaptive rendering of a webpage on an electronic display device
US9880978B2 (en) System and method for selective control of zoom adjustments in an electronic publication
US9817794B2 (en) Responsive rendering of data sets
US20120017172A1 (en) Display-agnostic user interface for mobile devices
CN104516867A (en) Table reordering method and table reordering system
US20170293592A1 (en) Dynamically formatting scalable vector graphics
CN111291533B (en) Sentence segment to be displayed display method and device, computer equipment and storage medium
CN104915186B (en) A kind of method and apparatus making the page
CN114818618B (en) Document editing method and system based on signature encryption and medium
CN110738035A (en) document template generation method and device
CN113283228A (en) Document generation method and device, electronic equipment and storage medium
US9886426B1 (en) Methods and apparatus for generating an efficient SVG file
CN105956133B (en) Method and device for displaying file on intelligent terminal
CN106776994B (en) Application method and system of engineering symbols in engineering report forms and web pages
CN110188326B (en) Rich text generating method, rich text generating device, computer equipment and storage medium
CN112417826B (en) PDF online editing method and device, electronic equipment and readable storage medium
CN111597151A (en) File generation method and device, computer equipment and storage medium
US11030388B2 (en) Live text glyph modifications
CN111062194A (en) Document processing method and device, computer equipment and readable storage medium
CN116110065A (en) Method, device, computer equipment and storage medium for generating question card data
KR20200001342A (en) Web electric document editing apparatus for rendering object and operating method thereof
KR102300444B1 (en) Document editing device to check whether the font applied to the document is a supported font and operating method thereof
CN114118029A (en) Image processing method, device, equipment and storage medium
CN112068826B (en) Text input control method, system, electronic device and storage medium
JP4770285B2 (en) Image processing apparatus and control program therefor

Legal Events

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