CN109145272A - Text rendering and layout method, device, equipment and storage medium - Google Patents

Text rendering and layout method, device, equipment and storage medium Download PDF

Info

Publication number
CN109145272A
CN109145272A CN201810846808.XA CN201810846808A CN109145272A CN 109145272 A CN109145272 A CN 109145272A CN 201810846808 A CN201810846808 A CN 201810846808A CN 109145272 A CN109145272 A CN 109145272A
Authority
CN
China
Prior art keywords
text
target
edit object
edit
operating area
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.)
Granted
Application number
CN201810846808.XA
Other languages
Chinese (zh)
Other versions
CN109145272B (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201810846808.XA priority Critical patent/CN109145272B/en
Publication of CN109145272A publication Critical patent/CN109145272A/en
Application granted granted Critical
Publication of CN109145272B publication Critical patent/CN109145272B/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/166Editing, e.g. inserting or deleting

Abstract

The embodiment of the invention discloses a kind of rendering of text and layout method, device, equipment and storage mediums, this method comprises: obtaining the action type for the edit operation that text box receives, wherein, the action type includes at least one of: input operation, paste operation, delete operation and modification property operations;Determine target text and to operating area, wherein, the target text and it is described to operating area according to the associated text of the action type, the corresponding edit object of the edit operation and the edit object determine, the target text is located in the text box, in the text box field that text box formation is located to operating area;The target text is rendered, and the target text is laid out and is shown described to operating area.When only having part text to be edited in text box, avoids and repeat to render and/or be laid out the problems such as bring is time-consuming caused by the full text in text box is rendered and/or is laid out.

Description

Text rendering and layout method, device, equipment and storage medium
Technical field
The present invention relates to text rendering and topology field more particularly to a kind of text rendering and layout method, device, Equipment and storage medium.
Background technique
Text box typically refers to a kind of movable and adjustable text or graphical container, uses text box, Ke Yi Several character blocks are placed on one page, or arrange text by the direction different from other texts in document.
In the implementation of the present invention, at least there are the following problems in the prior art for inventor's discovery.Existing intelligence is flat The text in text box in plate when having the edit operation for text every time, can all trigger text to be edited in text box The paragraph at place is repainted, if the edit operation influences other paragraphs, it may also be desirable to carry out other paragraphs It repaints.When the characters in a fancy style for including when longer by the paragraph where editor's text or in the paragraph is more, it may make At the time-consuming problem of rendering.
Summary of the invention
The embodiment of the present invention provides a kind of rendering of text and layout method, device, equipment and storage medium, when in text box When only part text is edited, avoids and repeat wash with watercolours caused by the full text in text box is rendered and/or is laid out The problems such as dye and/or time-consuming layout bring.
In a first aspect, the embodiment of the invention provides a kind of rendering of text and layout methods, this method comprises:
Obtain the action type of edit operation that text box receives, wherein the action type include it is following at least it One: input operation, paste operation, delete operation and modification property operations;
Determine target text and to operating area, wherein the target text and it is described to operating area according to the behaviour The associated text for making type, the corresponding edit object of the edit operation and the edit object is determining, the target text In the text box, in the text box field that text box formation is located to operating area;
The target text is rendered, and the target text is laid out and is shown described to operating area.
Second aspect, the embodiment of the invention also provides a kind of renderings of text and placement device, the device to include:
Module is obtained, for obtaining the action type for the edit operation that text box receives, wherein the action type packet Include at least one of: input operation, paste operation, delete operation and modification property operations;
Determining module, for determining target text and to operating area, wherein the target text and described to operating space Domain is determining according to the associated text of the action type, the corresponding edit object of the edit operation and the edit object, The target text is located in the text box, in the text box field that text box formation is located to operating area;
Rendering and layout modules are laid out described for rendering the target text, and by the target text wait operate Region is shown.
The third aspect the embodiment of the invention also provides a kind of computer equipment, including memory, processor and is stored in On memory and the computer program that can run on a processor, the processor are realized when executing described program as the present invention is real Apply any the text rendering and layout method in example.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer Program realizes text rendering and layout method as described in any in the embodiment of the present invention when program is executed by processor.
In the embodiment of the present invention, the action type for the edit operation that text box receives is obtained, wherein the action type Including at least one of: input operation, paste operation, delete operation and modification property operations;Determine target text and wait grasp Make region, wherein the target text and it is described to operating area according to the action type, the corresponding volume of the edit operation The associated text for collecting object and the edit object determines that the target text is located in the text box, described wait operate Region is located in the text box field of text box formation;The target text is rendered, and target text layout is existed It is described to be shown to operating area.For input operation and paste operation, it is determined that the target text and target for needing to render Text need be laid out extremely to operating area, avoid the repetition to other texts of no edit operation rendering and/or layout;Needle To delete operation, determine target text and to operating area, for the text before deleted text without rendering and/or Layout;The target text for needing to render is determined and wait grasp for different types of modification property operations for modification property operations Make region, to unrelated text without rendering and/or being laid out.Saved display equipment has part text to be compiled in text box The resource during display after volume, improves the response speed for text box edit operation.When in text box only have part When text is edited, avoids and repeat rendering and/or cloth caused by the full text in text box is rendered and/or is laid out The problems such as office's bring is time-consuming.
Detailed description of the invention
Fig. 1 a is the flow chart of one of the embodiment of the present invention one text rendering and layout method;
Fig. 1 b is a kind of input operation being applicable in the embodiment of the present invention one or the transformation schematic diagram of paste operation;
Fig. 1 c is the transformation schematic diagram of another input operation or paste operation that are applicable in the embodiment of the present invention one;
Fig. 2 is the flow chart of one of the embodiment of the present invention two text rendering and layout method;
Fig. 3 is the flow chart of one of the embodiment of the present invention three text rendering and layout method;
Fig. 4 is the flow chart of one of the embodiment of the present invention four text rendering and layout method;
Fig. 5 is the structural schematic diagram of one of the embodiment of the present invention five text rendering and placement device;
Fig. 6 is the structural schematic diagram of one of the embodiment of the present invention six computer equipment.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
In text-processing, general frame is related to the parts such as document management, rendering management and layout management, each section Function is different.Specifically, document management function can be realized by document management component, rendering management function can pass through rendering Component realizes that place function can be realized by layout component.Wherein, document management component, render component and layout component are equal It, specifically can be real by writing the code with corresponding function for the software module with set-up function of developer's exploitation It is existing.Specifically, the function of document management component includes management paragraph, management row or management character etc., the function of render component is The character that Crop or rendering are specified, the function of layout component refer to specified text layout to specified area Domain.
The equipment that text rendering provided in this embodiment and layout method can be rendered and are laid out by text executes, the text The equipment of rendering and layout can realize that the equipment of text rendering and layout can be by way of software and/or hardware Two or more physical entities are constituted, and are also possible to a physical entity and are constituted.The equipment of text rendering and layout can be Computer, mobile phone, plate, projector or interactive intelligent tablet computer etc..In embodiment, using interactive intelligent tablet computer as text rendering and cloth Office equipment for be described, wherein interactive intelligent tablet computer can be by touch technology to be shown in display plate on Content is manipulated and is realized the integration apparatus of man-machine interactive operation, be integrated with projector, electronic whiteboard, curtain, sound equipment, One or more functions such as television set and video conference terminal.
Embodiment one
Fig. 1 a is the flow chart of a kind of text rendering and layout method that the embodiment of the present invention one provides, and the present embodiment can fit For the part text situation to be edited in text box, this method can render cloth by text provided in an embodiment of the present invention Exchange device executes, and the mode which can be used software and/or hardware is realized, which can be integrated in text rendering and layout Equipment in.With reference to Fig. 1 a, this method can specifically include following steps:
S110, obtain the action type of edit operation that text box receives, wherein the action type include with down toward It is one of few: input operation, paste operation, delete operation and modification property operations.
Specifically, text box receives the edit operation of user's input, the corresponding action type of edit operation includes input behaviour At least one of work, paste operation, delete operation and modification property operations, optionally, the mode of user's input editing operation It can be through peripheral hardware input or touch input etc., wherein peripheral hardware may include keyboard or mouse etc..Specifically, input operation It can be and input the text that user wishes insertion in text box by keyboard, paste operation can be the text for replicating other sources This carries out insertion stickup, can also be the text that the text for replicating other sources chooses the needs in replacement current text frame to be replaced This.
In actual application process, paste operation can be user and replicate the text in other sources, and be affixed to User wishes the position being inserted into text box, other sources can be text existing for other text boxes or other forms etc.. Delete operation is to delete the undesirable text of user, and concrete implementation mode can be keyboard and delete or shear text.It repairs Change property operations and refer to and modifies to the attribute of text, illustratively, the attribute of text includes word attribute and paragraph properties, Middle word attribute refers to font type, font size, color, overstriking, inclination, underscore, subscript, subscript or characters in a fancy style etc., paragraph properties Refer to spacing etc. after horizontal alignment, vertical alignment, retraction, bullets, line space or section leading portion.Optionally, text box receives To the type of edit operation can be obtained by document management component.
S120, determine target text and to operating area, wherein the target text and it is described to operating area according to institute The associated text for stating action type, the corresponding edit object of the edit operation and the edit object is determining, the target Text is located in the text box, in the text box field that text box formation is located to operating area.
Specifically, being determined according to the associated text of action type, the corresponding edit object of edit operation and edit object Target text and to operating area.In a specific example, if edit operation is delete operation, edit operation is corresponding Edit object refers to the content of text that needs are deleted, and the associated text of edit object refers to complete after edit object in text box The text after edit object in portion's text or text frame, where edit object in paragraph.Illustratively, target text In text box, it is located in the text box field of text box formation to operating area, text filed the referring to of text box formation The region that each frame of text box surrounds.Target text refer to when detecting edit operation need render and/or be laid out Text refers to the region being laid out target text in text box extremely to operating area.Optionally, to the operation packet of operating area Include rendering and/or layout.Optionally, it determines target text and can be obtained by document management component to operating area.
S130, the rendering target text, and the target text is laid out and is shown described to operating area.
Wherein, it can be region shared by a character to operating area, area shared by certain several character in a paragraph Region shared by domain or at least one paragraph.Target text is rendered, and the target text after rendering is laid out wait grasp Make region, to show to target text.Optionally, rendering the target text can be realized by render component, by mesh Mark text layout show and can be realized by layout component to operating area described.
In the embodiment of the present invention, the action type for the edit operation that text box receives is obtained, wherein the action type Including at least one of: input operation, paste operation, delete operation and modification property operations;Determine target text and wait grasp Make region, wherein the target text and it is described to operating area according to the action type, the corresponding volume of the edit operation The associated text for collecting object and the edit object determines that the target text is located in the text box, described wait operate Region is located in the text box field of text box formation;The target text is rendered, and target text layout is existed It is described to be shown to operating area.When only having part text to be edited in text box, avoid the whole in text box Text is rendered and/or repeats to render and/or be laid out the problems such as bring is time-consuming caused by being laid out.
Embodiment two
Fig. 2 is the flow chart of a kind of text rendering and layout method provided by Embodiment 2 of the present invention, and the present embodiment is upper On the basis of stating embodiment, to " determining target text and to operating area, wherein the target text and described to operating space Domain is determined according to the associated text of the action type, the corresponding edit object of the edit operation and the edit object " It is optimized.With reference to Fig. 2, this method can specifically include following steps:
S210, obtain the action type of edit operation that text box receives, wherein the action type include with down toward It is one of few: input operation, paste operation, delete operation and modification property operations.
If S220, the action type are input operation or paste operation, it is determined that the input operation or paste operation Corresponding first edit object.
Specifically, determining input operation or viscous when the action type of edit operation is input operation or paste operation Patch operates corresponding first edit object.In a specific example, Fig. 1 b shows a kind of input operation or paste operation Transformation schematic diagram, the text box with reference to shown in Fig. 1 b, the distribution form of the original text in text frame are as follows: the first row 12324214, the second row 21421442, the third line 214, the input operation detected is that (can also be will replicate input character 5 The character 5 come is pasted), then character 5 is the first edit object.The action type of first edit object can be input behaviour Make, that is, user is inputted by keyboard, can also be paste operation, user is from the other positions of the document or other documents It is pasted after duplication in text frame.
S230, relative target position of first edit object in the text box is determined.
Optionally, relative target position of first edit object in text box is determined by document management component, one In a specific example, with reference to Fig. 1 b, target relative position of the character 5 in text frame refers to that character 5 is apart from the paragraph The distance of first character (character 1 of the first row), illustratively, which can be indicated with character number, that is, first Relative target position of the edit object character 5 in text box is that the first character 1 of the first row in the paragraph is 19 At a character.
S240, target text is determined according to the relative target position.
Specifically, relative target position is classified according to difference of the relative target position in text box, for example, phase Number of characters with the first character interval of some paragraph text can be to target position, or certain with having in some paragraph The number of characters being spaced between the character of special sign, wherein the character of special sign can be characters in a fancy style, overstriking font or Font etc. with underscore.Illustratively, relative target position is different, it is determined that target text is different, such as target text It can be and be input to the text of text box by inputting operation, can also be the text pasted by paste operation and affiliated Associated text after the text of stickup.
S250, actual target locations are determined according to the relative target position, and determined according to the actual target locations It is described to operating area, wherein the actual target locations include reality of first edit object in the text box Position.
Specifically, determining actual target locations according to relative target position, wherein actual target locations include the first editor Actual target locations of the object in text box, for example, actual target locations refer to coordinate of the corresponding character in display screen. Illustratively, determining that the mode of actual target locations can be, each character in paragraph corresponds to an actual target locations, It is determined by the relationship of relative target position and actual target locations, for example, the realistic objective position of the first character in paragraph Setting is A, and relative target position is that can then determine reality at 19 characters of first character of the first row in the paragraph Target position B, and then determined according to actual target locations B to operating area.In a specific example, it is to operating area Region in text box corresponding to actual target locations B.
S260, the rendering target text, and the target text is laid out and is shown described to operating area.
Optionally, if according to the relative target position determine target text include: the relative target position be section tail, Then determine that first edit object is target text.Wherein it is determined that whether relative target position is a section tail, that is, in the section In falling, without other texts after the first edit object, then determine that the first edit object is target text by document management component. With reference to Fig. 1 b, character 5 inputs or is pasted onto a section tail, thereafter without other characters, then in the specific example, and the first edit object Character 5 is target text.
Based on the above technical solution, the feelings for edit object in section tail are illustrated with a specific example Condition.Firstly, having detected character input, then subjected section of character that needs to input can be searched by document management component It falls, determines relative target position whether in section tail.Secondly, starting render component renders character 5, and word is determined by layout component Symbol 5 needs the position (to operating area) being laid out, and is laid out character 5, and other characters are motionless.
Optionally, if according to the relative target position determine target text include: the relative target position be section in, Then determine the associated text of first edit object and first edit object as target text, wherein described The associated text of one edit object includes the text after the relative target position.
Wherein, Fig. 1 c shows a kind of transformation schematic diagram for inputting operation or paste operation, the text with reference to shown in Fig. 1 c Frame, the distribution form of the original text in text frame are as follows: the first row 123242142, the second row 142144221, the third line 4, inspection The input operation measured is input character 5 (can also be and paste character 5) after the 4th character 1 of the second row, then word Symbol 5 is the first edit object.Determine that relative target position is that then can determine first by document management component in section as a result, The associated text of edit object 5 and the first edit object 5 is as target text, optionally, the association of the first edit object 5 Text includes the text after relative target position, and in figure 1 c, the associated text of the first edit object 5 includes 442214.Really Text before not including relative target position in fixed target text provides condition not repeat to render and/or be laid out.
Based on the above technical solution, illustrated with a specific example for feelings of the edit object in section Condition.Firstly, having detected character input, then subjected section of character that needs to input can be searched by document management component It falls, determines relative target position whether in section.Secondly, starting character rendering component renders character 5, and true by layout component Determine to operating area, by the character layout after character 5 and character 5 to operating area.Illustratively, it can also calculate defeated Whether there is the amplification of line number after entering character 5, if so, then integrally deviating paragraph later, does not have to change single character Offset.
In the embodiment of the present invention, if the action type is input operation or paste operation, it is determined that the input operation Or corresponding first edit object of paste operation;Determine relative target position of first edit object in the text box It sets;Target text is determined according to the relative target position;Actual target locations, and root are determined according to the relative target position It is determined according to the actual target locations described to operating area, wherein the actual target locations include first editor couple As the physical location in the text box.For input operation and paste operation, it is determined that need the mesh for rendering and/or being laid out Mark text and target text need to be laid out extremely to operating area, avoid to the repetition rendering of other unrelated texts and/or cloth Office, improves the response speed to edit operation.
Embodiment three
Fig. 3 is the flow chart of a kind of text rendering and layout method that the embodiment of the present invention three provides, and the present embodiment is upper On the basis of stating embodiment, to " determining target text and to operating area, wherein the target text and described to operating space Domain is determined according to the associated text of the action type, the corresponding edit object of the edit operation and the edit object " It is optimized.With reference to Fig. 3, this method can specifically include following steps:
S310, obtain the action type of edit operation that text box receives, wherein the action type include with down toward It is one of few: input operation, paste operation, delete operation and modification property operations.
If S320, the action type are delete operation, it is determined that the corresponding third edit object of the delete operation.
Specifically, determining that action type is delete operation, it is determined that the corresponding third edit object of delete operation, wherein Third edit object refers to deleted text.It should be noted that in delete operation, because not new target text produces It is raw, it is therefore not necessary to Rendering operations, the directly text after the deleted text of layout.Without rendering, edit operation is improved Response speed.
S330, determine the associated text of the third edit object as target text, wherein the third edit object Associated text include text after third edit object position.
Wherein it is determined that the text after third edit object position is as associated text, and by third edit object Associated text as target text.
S340, using the region after third edit object position as to operating area.
Specifically, the region after determining position described in third edit object is used as to operating area.For example, third editor After object is deleted, then the text after third edit object position needs the region for being laid out, and being laid out again again For to operating area.
S350, the rendering target text, and the target text is laid out and is shown described to operating area.
In the embodiment of the present invention, if the action type is delete operation, it is determined that the corresponding third of the delete operation Edit object;Determine the associated text of the third edit object as target text, wherein the pass of the third edit object Connection text includes the text after third edit object position;After third edit object position Region is used as to operating area.For delete operation, target text is determined and to operating area, before the text of deletion Text has been saved during showing that equipment shows that the text in edited text box is shown without rendering and/or being laid out Resource improves the response speed of edit operation.
Example IV
Fig. 4 is the flow chart of a kind of text rendering and layout method that the embodiment of the present invention four provides, and the present embodiment is upper On the basis of stating embodiment, to " determining target text and to operating area, wherein the target text and described to operating space Domain is determined according to the associated text of the action type, the corresponding edit object of the edit operation and the edit object " It is optimized.With reference to Fig. 4, this method can specifically include following steps:
S410, obtain the action type of edit operation that text box receives, wherein the action type include with down toward It is one of few: input operation, paste operation, delete operation and modification property operations.
If S420, the action type are modification property operations, it is determined that the modification type of the modification property operations.
Wherein it is determined that determining the action type of modification property operations when action type is modification property operations.It is exemplary , the corresponding modification type of word attribute usually may include modification font color, overstriking, inclination, subscript, subscript, characters in a fancy style, word Body type and font size etc.;The corresponding modification type of paragraph properties usually may include horizontal alignment, vertical alignment, retraction, in the ranks Away from spacing and bullets etc. after, section leading portion.
S430, according to it is described modification type, the corresponding edit object of the edit operation and the edit object pass Connection text determines target text and to operating area.
Specifically, being determined according to the associated text of modification type, the corresponding edit object of edit operation and edit object Target text and to operating area.
S440, the rendering target text, and the target text is laid out and is shown described to operating area.
In the embodiment of the present invention, if the action type is modification property operations, it is determined that the modification property operations Modify type;According to the association text of the modification type, the corresponding edit object of the edit operation and the edit object This determination target text and to operating area.For modification property operations, for different types of modification property operations, determining is needed It the target text to be rendered and is improved to unrelated text without rendering and/or being laid out to edit operation to operating area Response speed.
Optionally, according to the modification type, the corresponding edit object of the edit operation and the edit object Associated text determines target text and to operating area, comprising:
If the modification type is the first modification type, it is determined that the association of the edit object and the edit object Text is target text, determine the region after the edit object position and the edit object position be to Operating area;
If the modification type is the second modification type, it is determined that the edit object is target text, determines the volume Collecting object position is to operating area.
Wherein, the first modification type includes spacing, project after horizontal alignment, vertical alignment, retraction, line space, section leading portion Symbol, font type and font size etc. optionally for the first modification type, determine edit object institute by document management component It is target text in the associated text of position and the edit object, in a specific example, target text be can be Need to adjust the text and its associated text of line space, wherein associated text can be need to adjust line space text it Text afterwards, it is determined that the region after position and the position where the text of needs adjustment line space is to operating space Domain.
In addition, the second modification type includes modifying font color, overstriking, inclination, subscript, subscript and characters in a fancy style etc., for Second modification type determines that edit object is target text.In a specific example, target text refers to by the word of overstriking Body determines that by the font of overstriking be edit object, and the region by the font place pair of overstriking is to operating area.
Based on the above technical solution, between after horizontal alignment, vertical alignment, retraction, line space and section leading portion It operates away from equal, only target text is laid out, without rendering;And the operation such as modify bullets, it needs to render and is laid out mesh Mark text.
It should be noted that the default conditions of text box are the adaptive states of width in Intelligent flat, it is specific at one Example in, user click text frame in some setting position, the adaptive state of its width can be adjusted, by it It is adjusted to width stationary state.Under normal conditions, width stationary state is common use state, and width stationary state is can be with Realize the state that enters a new line automatically, and the adaptive text box of width refers to, the text of input remain a line carry out it is defeated Enter, can not enter a new line automatically.Text box in above-described embodiment is the fixed text box of width, and the feelings adaptive for width Condition, the width of text box can be accomplished to expand automatically, if not entering a new line manually, when which only has a line, input or deletion, Disposition is similar with the fixed input condition of width, and this will not be repeated here.
It based on the above technical solution, further include choosing the behaviour for replacing specified text in input operation and paste operation Make, can also specifically realize in the following way, whether the preferential text for comparing selected areas and the length of replacement text are consistent (can not have to consider whether attribute is consistent here) only needs rendering replacement text and is laid out to it if length is consistent, He is not altered;If length is inconsistent, in addition to rendering replace text other than, replace text except other characters be also required into Row is laid out again.
Embodiment five
Fig. 5 is the structural schematic diagram of a kind of text rendering and placement device that the embodiment of the present invention five provides, which can It is integrated in the equipment of text rendering and layout, which is adapted for carrying out a kind of text rendering that the embodiment of the present invention is supplied to And layout method.As shown in figure 5, the device can specifically include:
Module 510 is obtained, for obtaining the action type for the edit operation that text box receives, wherein the operation class Type includes at least one of: input operation, paste operation, delete operation and modification property operations;
Determining module 520, for determining target text and to operating area, wherein the target text and described wait grasp The associated text for making region according to the action type, the corresponding edit object of the edit operation and the edit object is true Fixed, the target text is located in the text box, the text box field that text box formation is located to operating area In;
Rendering and layout modules 530 are laid out described for rendering the target text, and by the target text wait grasp It is shown as region.
Further, determining module 520 includes:
Edit object determines submodule, described in determining when the action type is input operation or paste operation Input operation or corresponding first edit object of paste operation;
Relative target position determination module, for determining relative target of first edit object in the text box Position;
Target text determines submodule, for determining target text according to the relative target position;
Submodule is determined to operating area, for determining actual target locations according to the relative target position, and according to The actual target locations determine described to operating area, wherein the actual target locations include first edit object Physical location in the text box.
Further, the target text determines that submodule is specifically used for:
If the relative target position is section tail, it is determined that first edit object is target text.
Further, the target text determines that submodule is specifically used for:
If the relative target position is in section, it is determined that first edit object and first edit object Associated text is as target text, wherein after the associated text of first edit object includes the relative target position Text.
Further, determining module 520 is specifically used for:
If the action type is delete operation, it is determined that the corresponding third edit object of the delete operation;
Determine the associated text of the third edit object as target text, wherein the pass of the third edit object Connection text includes the text after third edit object position;
Using the region after third edit object position as to operating area.
Further, determining module 520 includes:
Type determination module is modified, for determining that the modification belongs to when the action type is modification property operations Property operation modification type;
Target text and submodule is determined to operating area, for according to the modification type, edit operation correspondence Edit object and the associated text of the edit object determine target text and to operating area.
Further, the target text and determine that submodule is specifically used for operating area:
When the modification type is the first modification type, the association of the edit object and the edit object is determined Text is target text, determine the region after the edit object position and the edit object position be to Operating area;
When the modification type is the second modification type, determines that the edit object is target text, determine the volume Collecting object position is to operating area.
The text that any embodiment of that present invention provides can be performed in text rendering provided in an embodiment of the present invention and placement device Rendering and layout method, have the corresponding functional module of execution method and beneficial effect.
Embodiment six
Fig. 6 is a kind of structural schematic diagram for computer equipment that the embodiment of the present invention six provides.Fig. 6, which is shown, to be suitable for being used to Realize the block diagram of the exemplary computer device 12 of embodiment of the present invention.The computer equipment 12 that Fig. 6 is shown is only one Example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in fig. 6, computer equipment 12 is showed in the form of universal computing device.The component of computer equipment 12 can be with Including but not limited to: one or more processor or processing unit 16, system storage 28 connect different system components The bus 18 of (including system storage 28 and processing unit 16).
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller, Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts For example, these architectures include but is not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC) Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Computer equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be by The usable medium that computer equipment 12 accesses, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary access Memory (RAM) 30 and/or cache memory 32.Computer equipment 12 may further include it is other it is removable/can not Mobile, volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for reading and writing not Movably, non-volatile magnetic media (Fig. 6 do not show, commonly referred to as " hard disk drive ").It, can be with although being not shown in Fig. 6 The disc driver for reading and writing to removable non-volatile magnetic disk (such as " floppy disk ") is provided, and non-volatile to moving The CD drive of CD (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driving Device can be connected by one or more data media interfaces with bus 18.System storage 28 may include at least one journey Sequence product, the program product have one group of (for example, at least one) program module, these program modules are configured to perform this hair The function of bright each embodiment.
Program/utility 40 with one group of (at least one) program module 42 can store and store in such as system In device 28, such program module 42 includes --- but being not limited to --- operating system, one or more application program, other It may include the realization of network environment in program module and program data, each of these examples or certain combination.Journey Sequence module 42 usually executes function and/or method in embodiment described in the invention.
Computer equipment 12 can also be with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 Deng) communication, can also be enabled a user to one or more equipment interact with the computer equipment 12 communicate, and/or with make The computer equipment 12 any equipment (such as network interface card, the modulatedemodulate that can be communicated with one or more of the other calculating equipment Adjust device etc.) communication.This communication can be carried out by input/output (I/O) interface 22.Also, computer equipment 12 may be used also To pass through network adapter 20 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public network Network, such as internet) communication.As shown, network adapter 20 is logical by other modules of bus 18 and computer equipment 12 Letter.It should be understood that other hardware and/or software module, packet can be used in conjunction with computer equipment 12 although being not shown in Fig. 6 It includes but is not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, magnetic tape drive Device and data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application and Data processing, such as realize the rendering of text provided by the embodiment of the present invention and layout method:
That is, the processing unit is realized when executing described program: obtaining the operation for the edit operation that text box receives Type, wherein the action type includes at least one of: input operation, paste operation, delete operation and modification attribute behaviour Make;Determine target text and to operating area, wherein the target text and it is described to operating area according to the operation class The associated text of type, the corresponding edit object of the edit operation and the edit object determines that the target text is located at In the text box, in the text box field that text box formation is located to operating area;The target text is rendered, And the target text is laid out and is shown described to operating area.
Embodiment seven
The embodiment of the present invention seven provides a kind of computer readable storage medium, is stored thereon with computer program, the journey The text rendering provided such as all inventive embodiments of the application and layout method are provided when sequence is executed by processor:
That is, realization when the program is executed by processor: the action type for the edit operation that text box receives is obtained, In, the action type includes at least one of input operation, paste operation, delete operation and modification property operations;It determines Target text and to operating area, wherein the target text and it is described to operating area according to the action type, the volume The associated text for collecting the corresponding edit object of operation and the edit object is determining, the target text is located at the text In frame, in the text box field that text box formation is located to operating area;The target text is rendered, and will be described Target text layout is shown described to operating area.
It can be using any combination of one or more computer-readable media.Computer-readable medium can be calculating Machine readable signal medium or computer readable storage medium.Computer readable storage medium for example can be --- but it is unlimited In system, device or the device of --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or any above combination.It calculates The more specific example (non exhaustive list) of machine readable storage medium storing program for executing includes: electrical connection with one or more conducting wires, just Taking formula computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In this document, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including --- but It is not limited to --- electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be Any computer-readable medium other than computer readable storage medium, which can send, propagate or Transmission is for by the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited In --- wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++, It further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion Divide and partially executes or executed on a remote computer or server completely on the remote computer on the user computer.? Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including local area network (LAN) or Wide area network (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as mentioned using Internet service It is connected for quotient by internet).
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (16)

1. a kind of text rendering and layout method characterized by comprising
Obtain the action type for the edit operation that text box receives, wherein the action type includes at least one of: defeated Enter operation, paste operation, delete operation and modification property operations;
Determine target text and to operating area, wherein the target text and it is described to operating area according to the operation class The associated text of type, the corresponding edit object of the edit operation and the edit object determines that the target text is located at In the text box, in the text box field that text box formation is located to operating area;
The target text is rendered, and the target text is laid out and is shown described to operating area.
2. the method according to claim 1, wherein determining target text and to operating area, wherein the mesh Mark text and it is described to operating area according to the action type, the corresponding edit object of the edit operation and the editor The associated text of object determines, comprising:
If the action type is input operation or paste operation, it is determined that the input operation or paste operation corresponding first Edit object;
Determine relative target position of first edit object in the text box;
Target text is determined according to the relative target position;
Actual target locations are determined according to the relative target position, and determining described wait operate according to the actual target locations Region, wherein the actual target locations include physical location of first edit object in the text box.
3. according to the method described in claim 2, it is characterized in that, determining target text packet according to the relative target position It includes:
If the relative target position is section tail, it is determined that first edit object is target text.
4. according to the method described in claim 2, it is characterized in that, determining target text packet according to the relative target position It includes:
If the relative target position is in section, it is determined that the association of first edit object and first edit object Text is as target text, wherein the associated text of first edit object includes the text after the relative target position This.
5. the method according to claim 1, wherein determining target text and to operating area, wherein the mesh Mark text and it is described to operating area according to the action type, the corresponding edit object of the edit operation and the editor The associated text of object determines, comprising:
If the action type is delete operation, it is determined that the corresponding third edit object of the delete operation;
Determine the associated text of the third edit object as target text, wherein the association text of the third edit object This includes the text after third edit object position;
Using the region after third edit object position as to operating area.
6. the method according to claim 1, wherein determining target text and to operating area, wherein the mesh Mark text and it is described to operating area according to the action type, the corresponding edit object of the edit operation and the editor The associated text of object determines, comprising:
If the action type is modification property operations, it is determined that the modification type of the modification property operations;
It is determined according to the associated text of the modification type, the corresponding edit object of the edit operation and the edit object Target text and to operating area.
7. according to the method described in claim 6, it is characterized in that, corresponding according to the modification type, the edit operation The associated text of edit object and the edit object determines target text and to operating area, comprising:
If the modification type is the first modification type, it is determined that the associated text of the edit object and the edit object For target text, determine that the region after the edit object position and the edit object position is wait operate Region;
If the modification type is the second modification type, it is determined that the edit object is target text, determines the editor couple As position is to operating area.
8. a kind of text rendering and placement device characterized by comprising
Obtain module, for obtaining the action type for the edit operation that text box receives, wherein the action type include with It is at least one lower: input operation, paste operation, delete operation and modification property operations;
Determining module, for determining target text and to operating area, wherein the target text and described to operating area root It is determined according to the associated text of the action type, the corresponding edit object of the edit operation and the edit object, it is described Target text is located in the text box, in the text box field that text box formation is located to operating area;
Rendering and layout modules are laid out described for rendering the target text, and by the target text to operating area It is shown.
9. device according to claim 8, which is characterized in that the determining module includes:
Edit object determines submodule, for determining the input when the action type is input operation or paste operation Operation or corresponding first edit object of paste operation;
Relative target position determination submodule, for determining relative target position of first edit object in the text box It sets;
Target text determines submodule, for determining target text according to the relative target position;
Submodule is determined to operating area, for determining actual target locations according to the relative target position, and according to described Actual target locations determine described to operating area, wherein the actual target locations include first edit object in institute State the physical location in text box.
10. device according to claim 9, which is characterized in that the target text determines that submodule is specifically used for:
If the relative target position is section tail, it is determined that first edit object is target text.
11. device according to claim 9, which is characterized in that the target text determines that submodule is specifically used for:
If the relative target position is in section, it is determined that the association of first edit object and first edit object Text is as target text, wherein the associated text of first edit object includes the text after the relative target position This.
12. device according to claim 8, which is characterized in that the determining module is specifically used for:
If the action type is delete operation, it is determined that the corresponding third edit object of the delete operation;
Determine the associated text of the third edit object as target text, wherein the association text of the third edit object This includes the text after third edit object position;
Using the region after third edit object position as to operating area.
13. device according to claim 8, which is characterized in that the determining module includes:
Type determination module is modified, for determining the modification attribute behaviour when the action type is modification property operations The modification type of work;
Target text and submodule is determined to operating area, for according to the modification type, the corresponding volume of the edit operation The associated text for collecting object and the edit object determines target text and to operating area.
14. device according to claim 13, which is characterized in that the target text and determine submodule to operating area It is specifically used for:
When the modification type is the first modification type, the associated text of the edit object and the edit object is determined For target text, determine that the region after the edit object position and the edit object position is wait operate Region;
When the modification type is the second modification type, determines that the edit object is target text, determine the editor couple As position is to operating area.
15. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, which is characterized in that the processor realizes the side as described in any in claim 1-7 when executing described program Method.
16. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The method as described in any in claim 1-7 is realized when execution.
CN201810846808.XA 2018-07-27 2018-07-27 Text rendering and layout method, device, equipment and storage medium Active CN109145272B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810846808.XA CN109145272B (en) 2018-07-27 2018-07-27 Text rendering and layout method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810846808.XA CN109145272B (en) 2018-07-27 2018-07-27 Text rendering and layout method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109145272A true CN109145272A (en) 2019-01-04
CN109145272B CN109145272B (en) 2022-09-16

Family

ID=64799060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810846808.XA Active CN109145272B (en) 2018-07-27 2018-07-27 Text rendering and layout method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109145272B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705234A (en) * 2019-09-05 2020-01-17 电信科学技术第十研究所有限公司 Self-adaptive typesetting and paging method and device for system form
CN110990747A (en) * 2019-12-17 2020-04-10 北京思维造物信息科技股份有限公司 Image generation method, device, equipment and storage medium
CN111460770A (en) * 2020-03-30 2020-07-28 广州视源电子科技股份有限公司 Method, device, equipment and storage medium for synchronizing element attributes in document
CN112685995A (en) * 2019-10-18 2021-04-20 北京国双科技有限公司 Text underlining processing method and device
CN113238686A (en) * 2021-04-20 2021-08-10 维沃移动通信(杭州)有限公司 Document processing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015722A1 (en) * 2003-06-13 2005-01-20 Niyogi Shanku S. Web page rendering mechanism using external programmatic themes
CN101968887A (en) * 2010-09-08 2011-02-09 东莞电子科技大学电子信息工程研究院 Local rendering method for rich media scene
CN102663002A (en) * 2012-03-16 2012-09-12 掌中帷幄(北京)科技有限公司 Method and system for structured-document rendering
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device
CN107766117A (en) * 2017-11-16 2018-03-06 山东浪潮通软信息科技有限公司 A kind of method and device of showing interface
CN108279964A (en) * 2018-01-19 2018-07-13 广州视源电子科技股份有限公司 The implementation method and device that text control, mask for copy editor render

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015722A1 (en) * 2003-06-13 2005-01-20 Niyogi Shanku S. Web page rendering mechanism using external programmatic themes
CN101968887A (en) * 2010-09-08 2011-02-09 东莞电子科技大学电子信息工程研究院 Local rendering method for rich media scene
CN102663002A (en) * 2012-03-16 2012-09-12 掌中帷幄(北京)科技有限公司 Method and system for structured-document rendering
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device
CN107766117A (en) * 2017-11-16 2018-03-06 山东浪潮通软信息科技有限公司 A kind of method and device of showing interface
CN108279964A (en) * 2018-01-19 2018-07-13 广州视源电子科技股份有限公司 The implementation method and device that text control, mask for copy editor render

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705234A (en) * 2019-09-05 2020-01-17 电信科学技术第十研究所有限公司 Self-adaptive typesetting and paging method and device for system form
CN112685995A (en) * 2019-10-18 2021-04-20 北京国双科技有限公司 Text underlining processing method and device
CN110990747A (en) * 2019-12-17 2020-04-10 北京思维造物信息科技股份有限公司 Image generation method, device, equipment and storage medium
CN111460770A (en) * 2020-03-30 2020-07-28 广州视源电子科技股份有限公司 Method, device, equipment and storage medium for synchronizing element attributes in document
CN111460770B (en) * 2020-03-30 2024-03-08 广州视源电子科技股份有限公司 Method, device, equipment and storage medium for synchronizing element attributes in document
CN113238686A (en) * 2021-04-20 2021-08-10 维沃移动通信(杭州)有限公司 Document processing method and device and electronic equipment
CN113238686B (en) * 2021-04-20 2023-11-03 维沃移动通信(杭州)有限公司 Document processing method and device and electronic equipment

Also Published As

Publication number Publication date
CN109145272B (en) 2022-09-16

Similar Documents

Publication Publication Date Title
CN109145272A (en) Text rendering and layout method, device, equipment and storage medium
JP3027009B2 (en) Design capture system
CN104090979B (en) A kind of page authoring method and device
CN112115678B (en) Information display method and device, storage medium and electronic equipment
CN110851134A (en) Low-code page design device and page design method
JP2011040035A (en) Display input device and computer program
CN107066440A (en) The input control method and system of vertical setting of types text
CN110032700B (en) Information release control method and device, storage medium and electronic equipment
CN109739600A (en) Data processing method, medium, device and calculating equipment
CN104020950A (en) Input method based on touch screen and input device with touch screen
US10528688B1 (en) System and method for schematic-driven generation of input/output models
US20220284377A1 (en) Method and apparatus for task group positioning
CN111881662A (en) Form generation method, device, processing equipment and storage medium
WO2013191482A1 (en) Apparatus and method for generating font using glyph interpolation
CN108763188A (en) A kind of text display method, device, equipment and storage medium
CN112580312A (en) Screen-casting content annotation method, device and system and computer-readable storage medium
CN114118959A (en) Method and device for examining and approving target object, computer storage medium and electronic equipment
CN107491311A (en) Generate method, system and the computer equipment of pagefile
CN112309313B (en) Module controller configuration method, device and system and computer readable storage medium
CN111736815A (en) Test file script modular development tool, system and method
CN106648367A (en) Clicking and reading method and clicking and reading device
WO2018139700A1 (en) Apparatus and method for generating font by means of metafont by using outline font
CN112099770A (en) Template-based webpage generation method, system, equipment and storage medium
JP5125385B2 (en) Verification scenario creation program, recording medium recording the program, verification scenario creation device, and verification scenario creation method
KR20210060808A (en) Document editing device to check whether the font applied to the document is a supported font and operating method thereof

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