A layout method for wrapping graphics, computer equipment, and computer-readable storage medium

By using before and after, two cached graphics containers in streaming documents to process the position of the swing graphics, the problem that the swing graphics affects the early paragraph layout effect is solved, and a more accurate and controllable graphic layout is achieved.

CN114492302BActive Publication Date: 2024-11-19YOZOSOFT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111654729.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-11-19
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In streaming documents, the anchor points of the sloping figure are usually located in the third section, resulting in late impact on the layout effects of the first and second sections, and difficult to effectively deal with, affecting the overall layout effect.

Method used

By creating two cached graphics containers before and after, each storing the graphic wrapping graphics in the paragraph, putting them into the corresponding container according to the graphics position, and clearing and copying the content during the typography process to ensure that the graphic location is correctly calculated and typified. , prevent the layout effect of the previous paragraph.

Benefits of technology

It realizes the timely identification and processing of the sloping graphics during the layout process, preventing them from affecting the layout effect of the previous paragraph, simplifying operations and improving the controllability of the layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492302B_ABST
    Figure CN114492302B_ABST
Patent Text Reader

Abstract

The present invention provides a typesetting method for wrapping graphics, comprising the following steps: S1, starting from the first character in the file, sequentially obtaining the content of each word, graphic, image and table in the file; S2, creating a container after for caching all graphics, and creating a spare container before for caching graphics; S3, clearing after, putting the content of before into after, and starting typesetting for the current column; S4, taking out the wrapping graphics in the paragraph, calculating the graphic position, putting the graphics at the back of the paragraph into after, and putting the graphics at the front of the paragraph into before, if there is a graphic in before, executing step S3; S5, performing line typesetting, after completing typesetting of all lines in the paragraph, repeating steps S3 and S4 to typeset the next paragraph until the end of the column. The present invention has the advantages of being simple and easy to implement, and convenient to operate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of computers, and in particular to a typesetting method for wrapping graphics. Background Art

[0002] The display effect of streaming files will change in different software and hardware environments. For example, the display effect of the same Word document will be different in different versions of Office software or on computers with different resolutions. As WP is a general office software, it is widely used in various industries. The content and size of files that need to be edited vary greatly depending on the business. Graphics and pictures are widely used in documents as explanations, so the position of pictures and text wrapping are crucial.

[0003] Wrap graphics will affect the layout of the document. Usually, the anchor point of the wrap graphic is in the paragraph where the graphic is located, and the graphic affects the layout of the paragraph and subsequent paragraphs. The anchor point of the wrap graphic is in the third paragraph, and the paragraphs involved in the wrap are the first and second paragraphs. For example, in the layout of a flowing document, the anchor point of the rectangle is at the beginning of the third paragraph. During the layout of the first and second paragraphs, the rectangle with the anchor point in the third paragraph cannot be obtained. It is not until the third paragraph is layout that it is discovered that the wrap graphic has affected the layout of the first and second paragraphs.

[0004] Therefore, it is necessary to provide a new technical solution. Summary of the invention

[0005] In order to solve the technical problems existing in the prior art, the present invention discloses a typesetting method for wrapping graphics, and the specific technical solution is as follows:

[0006] The present invention provides a typesetting method for a wrapping pattern, comprising the following steps:

[0007] S1, starting from the first character in the file, obtain the content of each word, graphic, image and table in the file;

[0008] S2, create a container for caching all graphics after, and create a spare container for caching graphics before;

[0009] S3, clear after, put the content of before into after, and start typesetting the current column;

[0010] S4, taking out the wrapping graphics in the paragraph, calculating the graphic positions, putting the graphics after the paragraph into after, and the graphics before the paragraph into before. If there are graphics in before, executing step S3;

[0011] S5, perform line layout. After all lines of this paragraph are layouted, repeat steps S3 and S4 to layout the next paragraph until the end of this column.

[0012] Furthermore, the file is read from the storage device, and the setting values ​​related to the pages, columns, headers and footers, footnotes and endnotes, paragraphs and lines stored in the file and related to the typesetting are obtained, and the effective height and width of each position are calculated and stored in the defined data structure.

[0013] Furthermore, the page, column, header, footer, footnote, endnote, paragraph and line typesetters are started respectively, and typeset after waiting for data input.

[0014] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0015] S1, starting from the first character in the file, obtain the content of each word, graphic, image and table in the file;

[0016] S2, create a container for caching all graphics after, and create a spare container for caching graphics before;

[0017] S3, clear after, put the content of before into after, and start typesetting the current column;

[0018] S4, taking out the wrapping graphics in the paragraph, calculating the graphic positions, putting the graphics after the paragraph into after, and the graphics before the paragraph into before. If there are graphics in before, executing step S3;

[0019] S5, perform line layout. After all lines of this paragraph are layouted, repeat steps S3 and S4 to layout the next paragraph until the end of this column.

[0020] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0021] S1, starting from the first character in the file, obtain the content of each word, graphic, image and table in the file;

[0022] S2, create a container for caching all graphics after, and create a spare container for caching graphics before;

[0023] S3, clear after, put the content of before into after, and start typesetting the current column;

[0024] S4, taking out the wrapping graphics in the paragraph, calculating the graphic positions, putting the graphics after the paragraph into after, and the graphics before the paragraph into before. If there are graphics in before, executing step S3;

[0025] S5, perform line layout. After all lines of this paragraph are layouted, repeat steps S3 and S4 to layout the next paragraph until the end of this column.

[0026] The present invention has the following beneficial effects:

[0027] 1. The layout method of the winding pattern provided by the present invention is simple and easy to operate.

[0028] 2. The layout method of the wrapping pattern provided by the present invention prevents the wrapping pattern from affecting the layout effect of the paragraph before the anchor point.

[0029] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 It is a flow chart of a typesetting method for wrapping graphics provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0032] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0033] In the description of the present invention, it should be understood that the terms "upper", "lower", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In the description of the present invention, "plurality" means two or more, unless otherwise clearly and specifically defined.

[0034] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0035] The present invention provides a layout method for wrapping a graphic, referring to Figure 1 , including the following steps:

[0036] S1, starting from the first character in the file, obtain the content of each word, graphic, image and table in the file;

[0037] S2, create a container for caching all graphics after, and create a spare container for caching graphics before;

[0038] S3, clear after, put the content of before into after, and start typesetting the current column;

[0039] S4, taking out the wrapping graphics in the paragraph, calculating the graphic positions, putting the graphics after the paragraph into after, and the graphics before the paragraph into before. If there are graphics in before, executing step S3;

[0040] S5, perform line layout. After all lines of this paragraph are layouted, repeat steps S3 and S4 to layout the next paragraph until the end of this column.

[0041] Read files from storage devices, obtain the page, column, header, footer, footnote, paragraph, and line settings stored in the file, calculate the effective height and width of each position, and store them in the defined data structure. Start the page, column, header, footer, footnote, paragraph, and line typesetters respectively, and wait for data input before typeset.

[0042] The present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method embodiment when executing the computer program.

[0043] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiment are implemented.

[0044] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.

[0045] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify and vary the above embodiments within the scope of the present invention.

Claims

1. A layout method for wrapping graphics, characterized in that: The steps include: S1, starting from the first character in the file, obtain the content of each text, graphic, image and table in the file; S2, create a container to cache all graphics after, and create a spare container to cache graphics before; S3, clear the container after, put the content of the container before into the container after, and start typesetting the current column; S4, taking out the wrapping graphics in the paragraph, calculating the graphic position, putting the graphics located after the paragraph into the container after, and the graphics located before the paragraph into the container before. If there is a graphic in the container before, executing step S3; S5, perform line layout. After all lines of this paragraph are layouted, repeat steps S3 and S4 to layout the next paragraph until the end of this column.

2. The method for typesetting a winding pattern according to claim 1, characterized in that: Read the file from the storage device, obtain the page, column, header, footer, footnote, paragraph and line settings related to the typesetting stored in the file, calculate the effective height and width of each position, and store them in the defined data structure.

3. The layout method of a winding pattern according to claim 2, characterized in that: Start the page, column, header, footer, footnote, endnote, paragraph and line layout machines respectively, and wait for data to be input before layout.

4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method and system for accurately positioning page object

    CN103034624A

  • Automatic page type setting method

    CN105045776A

  • Dynamic typesetting

    US10769348B1