Disclosure of Invention
In order to solve the technical problems in the prior art, the invention provides a method for quickly typesetting in parallel by grading and partitioning in file processing software, and typesetting and displaying the edited and changed file contents with minimum time consumption.
According to one aspect of the present invention, there is provided a quick typesetting method in text processing, comprising:
Dividing a display area for effectively typesetting file contents into a plurality of grades, setting area attributes in the display area, and setting an effective typesetting range of the display area according to the area attributes;
setting a setting affecting typesetting range and a display position according to the region attribute, and calculating an effective typesetting range of the display region, wherein the effective typesetting range comprises an effective height and an effective width;
Defining a data structure of a display area, and recording the effective height value and the effective width value of the display area in the data structure;
The typesetting result is based on a physical unit, and when the typesetting result is displayed, the physical unit of the typesetting result is converted into a logical unit of screen display according to the visual range of the screen;
typesetting is divided into global typesetting and local typesetting for typesetting.
Further, the display area includes a page, a column, a header, a footer, a tail note, a paragraph, and a line, wherein the page includes a header, a column, a footer, the column includes a paragraph, a line, a footer, and a tail note, the footer includes a paragraph and a line, the tail note includes a paragraph and a line, the header includes a paragraph and a line, the footer includes a paragraph and a line, and the paragraph includes a line.
Further, the global typesetting is the typesetting from the first page to the end of the whole file;
The typesetting method of the global typesetting comprises the following steps:
According to different display areas, correspondingly dividing the typesetting of the file content into page typesetting, column typesetting, header typesetting, footer typesetting, tail-note typesetting, paragraph typesetting and line typesetting, wherein different typesetting areas are mutually independent typesetting, and a plurality of independent typesetting areas are used for typesetting simultaneously in parallel;
The typesetting areas comprise different main body contents, and typesetting modes and typesetting rules of the typesetting areas are different;
The typesetting result of the typesetting area is participated in typesetting of the previous typesetting area as a whole;
The typesetting area performs typesetting or segmentation in the effective typesetting range according to the corresponding typesetting rule;
and after the typesetting file content reaches the range of the visual window of the screen, all the parallel typesetting is transferred to the background for processing, and meanwhile, the file can be edited and modified.
Further, when the typesetting area is divided, the limitation of the upper-level typesetting area is fed back to the typesetting area, and the typesetting area is divided according to the limitation of the upper-level typesetting area.
Furthermore, the page layout mainly lays out columns, headers and footers, the header layout and the footer layout mainly lay out paragraphs, the column layout mainly lays out paragraphs, charts, graphs, tables, footnotes and footnotes, the footnotes layout and the footnotes layout mainly lay out paragraphs, the paragraph layout mainly lays out lines, and the line layout mainly lays out characters, embedded graphs and charts.
Further, the local typesetting is the typesetting of the contents of the file part;
the local typesetting method comprises the following steps:
Positioning the editing and modifying line according to the specific content of the editing and modifying, and typesetting the line again;
Judging whether the effective typesetting range of the re-edited modified content is consistent with the effective typesetting range of the content before editing modification, if not, feeding back the change of the re-edited modified content to the upper display area, wherein the upper display area performs re-typesetting in the effective typesetting range of the upper display area,
Judging whether the effective typesetting range of the upper-level display area is changed, if so, continuing to feed back to the upper level of the upper-level display area, and so on, and feeding back to the upper-level display area by the upper level until finally feeding back to the whole page area, and finishing the whole page area typesetting again, and finishing the whole typesetting;
And after the typesetting file content reaches the screen visual window range, all subsequent typesetting is transferred to the background for processing, and meanwhile, the file can be edited and modified.
Further, in the step of "judging whether the effective typesetting range of the re-edited modified content is consistent with the effective typesetting range of the content before editing modification", if so, the editing modification is ended.
Further, in the step of "judging whether the effective typesetting range of the upper display area is changed", if the effective typesetting range of the upper display area is not changed, the typesetting is ended.
According to another aspect of the invention, the invention provides a rapid typesetting device in word processing, which comprises a processor and a memory, wherein program instructions are stored in the memory, and the program instructions are executed by the processor to realize a rapid typesetting method in word processing. The quick typesetting method in the text processing comprises the steps of dividing a display area of effective typesetting of file contents into a plurality of grades, setting area attributes in the display area, setting an effective typesetting range of the display area according to the area attributes, setting a typesetting range and a display position according to the area attributes, calculating the effective typesetting range of the display area, wherein the effective typesetting range comprises an effective height and an effective width, defining a data structure of the display area, recording the effective height value and the effective width value of the display area in the data structure, and simultaneously defining a data structure of typesetting results of the display area to store the typesetting results, wherein the typesetting results are recorded on a physical unit basis, and when the typesetting results are displayed, the physical unit of the typesetting results is converted into a logical unit of screen display according to a visual range of a screen, and typesetting is divided into global typesetting and local typesetting.
According to yet another aspect of the present invention, there is provided a computer-readable medium having stored therein program instructions that are executed to implement a quick layout method in text processing. The quick typesetting method in the text processing comprises the steps of dividing a display area of effective typesetting of file contents into a plurality of grades, setting area attributes in the display area, setting an effective typesetting range of the display area according to the area attributes, setting a typesetting range and a display position according to the area attributes, calculating the effective typesetting range of the display area, wherein the effective typesetting range comprises an effective height and an effective width, defining a data structure of the display area, recording the effective height value and the effective width value of the display area in the data structure, and simultaneously defining a data structure of typesetting results of the display area to store the typesetting results, wherein the typesetting results are recorded on a physical unit basis, and when the typesetting results are displayed, the physical unit of the typesetting results is converted into a logical unit of screen display according to a visual range of a screen, and typesetting is divided into global typesetting and local typesetting.
The rapid typesetting method, the rapid typesetting device and the computer readable medium in the word processing have the following beneficial effects:
(1) According to the rapid typesetting method, the rapid typesetting device and the computer readable medium in the word processing, the areas where the file contents are located are subjected to partition grading, and the different display areas are independently typeset, so that the office efficiency of a user is improved;
(2) According to the rapid typesetting method, the rapid typesetting device and the computer readable medium in the word processing, different display areas are typeset in parallel, so that typesetters of the different display areas work to the greatest extent, the performance of the device is fully utilized, and the rapid response can be achieved when the content of a large file is opened or edited and changed.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Embodiments of the present invention will be described in detail below, and technical solutions in the embodiments of the present invention will be clearly and completely described, and it is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In one embodiment, referring to fig. 1, fig. 1 is a schematic diagram illustrating a positional relationship of a display area of an embodiment of a quick typesetting method in text processing according to the present invention. As shown in fig. 1, the invention relates to a quick typesetting method in text processing, which specifically comprises the following steps:
dividing a display area of effective typesetting in file content into pages, columns, headers, footers, paragraphs and lines, setting area attributes in the display area, and setting an effective typesetting range of the display area according to the area attributes;
in an example, the presentation area includes a page, a column, a header, a footer, a paragraph and a line, wherein the page includes a header, a column, a footer, the column includes a paragraph, a line, a footer and a footer, the footer includes a paragraph and a line, the header includes a paragraph and a line, and the footer includes a paragraph and a line;
In an example, the program instructions of the quick layout method in word processing are word processing software.
The method comprises the steps of respectively setting the influence typesetting ranges and the display positions of different display areas according to area attributes, wherein the setting comprises page setting, column setting, header setting, footer setting and paragraph setting, the effective typesetting range of the display areas is calculated based on a physical unit, the effective typesetting range comprises an effective height and an effective width, and the effective typesetting range of the display areas comprises an effective typesetting range of page typesetting, an effective typesetting range of column typesetting, an effective typesetting range of header typesetting, an effective typesetting range of footer typesetting and an effective typesetting range of paragraph typesetting.
Defining a data structure of a display area in a memory, and recording the effective height value and the effective width value of the display area in the data structure for subsequent typesetting;
and when the typesetting result is displayed on the basis of the physical unit, converting the physical unit of the typesetting result into a logical unit of screen display according to the visual range of the screen.
Dividing typesetting into global typesetting and local typesetting according to the influence range of file content change;
the global typesetting refers to typesetting from the first page to the end of the whole file;
reading files from storage equipment such as a disk, performing attribute setting on the content of the full-selected files, changing page attribute setting, changing column setting and changing header and footer setting, wherein the adjustment of the conditions causes the whole file typesetting to be changed;
In an example, the full-select file content performs attribute settings such as setting full-text font size, changes page attribute settings such as setting page size, horizontal and/or vertical rows, and changes column settings such as setting number of columns.
The local typesetting refers to typesetting of part of the content of the file;
the local typesetting condition comprises editing and modifying part of file content, adding or deleting graphic charts, and the adjustment of the conditions causes the typesetting of part of display areas to be changed;
In an example, editing modifies the file portion content such as changing the partial character font size, adding text, and/or deleting text, etc.
The processing mode of the global typesetting is as follows:
according to different display areas, the typesetting of the file content is correspondingly divided into page typesetting, column typesetting, header typesetting, footer typesetting, tail header typesetting, paragraph typesetting and line typesetting, wherein the relation contained in different typesetting areas is the same as that contained in the corresponding display areas, the different typesetting areas are mutually independent typesetting, and a plurality of independent typesetting areas are used for typesetting simultaneously and parallelly;
the page layout mainly lays out columns, headers and footers, the header layout mainly lays out paragraphs, charts, graphs, tables, footers and footers, the footers layout mainly lays out paragraphs and the footers, the paragraph layout mainly lays out lines, and the line layout mainly lays out characters, embedded graphs and charts.
In other embodiments, the typesetting area is divided in the effective typesetting range according to the corresponding typesetting rules;
In another embodiment, when the typesetting area is divided, the limitation of the typesetting area of the upper level is fed back to the typesetting area, and the typesetting of the typesetting area is divided according to the feedback limitation.
The grading and partitioning method of global typesetting enables parallel independent typesetting among different typesetting areas, corrects typesetting results in real time according to feedback of the typesetting area of the last level, greatly quickens typesetting speed of documents and improves office efficiency.
The typesetting result of the typesetting area is participated in typesetting of the previous typesetting area as a whole;
and simultaneously, the file can be edited and modified without waiting for finishing the complete typesetting of the whole file so as to improve the user experience of a user.
The processing mode of the local typesetting is as follows:
Positioning the editing and modifying line according to the specific content of the editing and modifying, and typesetting the line again;
Judging whether the effective typesetting range of the re-editing modified content is consistent with the effective typesetting range of the content before editing modification, if not, feeding back the change of the re-editing modified content to a previous display area, wherein the previous display area performs re-typesetting in the effective typesetting range of the previous display area, in other embodiments, judging whether the effective typesetting range of the re-editing modified content is consistent with the effective typesetting range of the content before editing modification, and if so, ending the editing modification;
Judging whether the effective typesetting range of the upper-stage display area changes, if so, continuing to feed back to the upper stage of the upper-stage display area, and in other embodiments, judging whether the effective typesetting range of the upper-stage display area changes, and if not, ending typesetting.
And the like, feeding back the first-level display area to the upper-level display area until the feedback is finally fed back to the whole page area, and ending the whole typesetting when the whole page area is rearranged;
And after the typesetting file content reaches the screen visual window range, all subsequent typesetting is transferred to the background for processing, and meanwhile, the file can be edited and modified.
In the preferred embodiment, taking open files as an example, all typesetting is performed:
Referring to fig. 2, fig. 2 is a flow chart illustrating an embodiment of global typesetting of the quick typesetting method in text processing according to the present invention. As shown in fig. 2, a file is read in from a storage device such as a disk, setting values of display areas such as pages, columns, header footers, footnotes, paragraphs, lines and the like in the file are obtained, effective heights and effective widths, namely effective typesetting ranges, are calculated respectively, the effective heights and the effective widths are stored in defined data structures, a page typesetter, a column typesetter, a header typesetter, a footer typesetter, a paragraph typesetter and a line typesetter are started respectively, data input is waited,
In other embodiments, for the paragraph typesetter and the line typesetter, the display areas of the columns, the headers, the footers and the like respectively start the corresponding paragraph typesetter and the line typesetter and typeset independently and parallelly, namely, the paragraph typesetter is divided into the paragraph typesetter of the columns, the paragraph typesetter of the headers, the paragraph typesetter of the footers and the paragraph typesetter of the footers, and the line typesetter of the footers is divided into the line typesetter of the columns, the line typesetter of the headers, the line typesetter of the footers and the line typesetter of the footers.
Sequentially obtaining file contents from a first character in a file, wherein the file contents comprise characters, graphics, images and tables, and the file contents are typeset by a corresponding line typesetter waiting for data input;
The line typesetter performs typesetting in the effective typesetting range of the lines according to the attribute of the lines related to typesetting, which are set by the file content, and the typesetting rule of the corresponding lines;
in an example, the attributes of the lines in the file content comprise font size, font style, alignment mode and character spacing, and the typesetting rules of the corresponding lines comprise a character height calculation rule and a character position calculation rule;
finishing typesetting of the current line, and delivering the typesetting result of the current line to a paragraph typesetting device which corresponds to the current line and waits for data input to carry out paragraph typesetting, wherein the typesetting result of the line comprises the typesetting width of the line, the typesetting height of the line and the starting position of the line in a paragraph;
the line typesetter continues to acquire the content of the next line for typesetting treatment, and the process is circulated until all lines in the file are typeset;
preferably, when the paragraph typesetter feeds back to the line typesetter to request the line to be typeset again, the line typesetter interrupts the ongoing typesetting, and preferably processes the line re-typesetting task fed back by the paragraph typesetter.
After receiving the typesetting result input by the corresponding line, the paragraph typesetter performs typesetting on the input line as a whole in the effective typesetting range of the paragraph according to the typesetting rule of the corresponding paragraph and the attributes related to typesetting set in the paragraph;
Preferably, the paragraph typesetter changes the attribute of the lines according to the paragraph rules, for example, the effective height of the lines is changed by the fixed line spacing of the paragraph rules, and then the effective height is fed back to the corresponding lines, and the line typesetter performs typesetting on the corresponding lines again;
in an example, the typesetting-related attributes set in the paragraphs include line spacing, alignment and indentation, and the typesetting rules of the corresponding paragraphs include solitary control and grid alignment, for example;
After all lines in the paragraph are typeset, the typesetting result corresponding to the paragraph is transmitted to the upper level typesetter of the paragraph waiting for data input to typeset, the upper level typesetter of the paragraph is divided into columns, headers, footers and footers according to the difference of the display areas of the paragraphs, and the upper level typesetter of the paragraph is correspondingly divided into a column typesetter, a header typesetter, a footer typesetter and a footer typesetter;
In other embodiments, after the typesetting of the paragraph reaches the cutting limit of the paragraph, the typesetting result corresponding to the paragraph is sent to the former stage typesetter of the paragraph waiting for data input to typeset, and the steps are circulated until all paragraphs in the former stage area of the paragraph are typeset;
preferably, when the upper level region typesetter of the paragraph feeds back to the paragraph typesetter to request the paragraph to be typeset again, the paragraph typesetter interrupts the ongoing typesetting and preferentially processes the paragraph re-typesetting task fed back by the upper level region typesetter of the paragraph.
After receiving a corresponding paragraph typesetting input result, the upper-level region typesetter of the paragraph sets according to typesetting attributes corresponding to the upper-level region of the paragraph, combines typesetting rules of the upper-level region of the paragraph, and typesets the input paragraph as a whole in the effective typesetting range of the upper-level region of the paragraph;
preferably, in the typesetting process of the upper level region of the paragraph, the upper level region typesetter of the paragraph changes the attribute value of the paragraph, such as the effective high-width value of the paragraph, according to the typesetting rule of the upper level region of the paragraph, and then feeds back the effective high-width value of the paragraph to the corresponding paragraph, and the paragraph typesetter performs typesetting on the corresponding paragraph again;
in an example, the typesetting attribute setting corresponding to the upper-level region of the paragraph includes a paragraph front distance and a paragraph back distance, and the typesetting rule of the upper-level region of the paragraph includes pre-paragraph paging and non-paragraph paging.
After all the paragraphs in the upper-level region of the paragraph are typeset, the typesetting result of the upper-level region of the paragraph is transmitted to a page typesetter waiting for data input to typeset, and the steps are circulated until the upper-level region of all the paragraphs in the page region is typeset;
In other embodiments, after the typesetting of the upper level region of the paragraph reaches the effective typesetting limit of the upper level region of the paragraph, the typesetting result of the upper level region of the paragraph is sent to the page typesetter waiting for data input to perform typesetting, and the above steps are circulated until all the upper level regions of the paragraph in the page region are typeset.
In another embodiment, the upper level region of the paragraph is a footnote or a tail note, all the paragraphs in the upper level region of the paragraph are typeset, the typesetting result of the upper level region of the paragraph is sent to the column typesetter waiting for data input to be typeset, and the steps are circulated until the typesetting of the upper level region of all the paragraphs in the column region is completed, preferably, after the typesetting of the upper level region of the paragraph reaches the effective typesetting limit of the upper level region of the paragraph, the typesetting result of the upper level region of the paragraph is sent to the column typesetter waiting for data input to be typeset, and the steps are circulated until the typesetting of the upper level region of all the paragraphs in the column region is completed.
After the page typesetting device receives the typesetting result input by the corresponding subarea, the subarea comprises columns, headers and footers, and correspondingly, the subarea typesetting device comprises column typesetting devices, header typesetting devices and footers, according to the setting of page typesetting attributes and combining page typesetting rules, the input subarea is typeset as a whole in the effective typesetting range of a page, in the page typesetting process, the page typesetting device modifies the typesetting attributes of the subarea according to the relevant attributes of the page and feeds the typesetting attributes of the modified subarea back to the subarea typesetting devices, and the subarea typesetting devices carry out typesetting on the subareas in the page area again;
In an example, the setting of the page typesetting attribute includes a header, a footer, a column position, a page break and a section break, the page typesetting rule includes continuous section, column break and odd-even page difference, and the typesetting attribute of the column includes a page break and a page break.
Judging whether the current page exceeds the screen visual range according to the screen visual range after finishing typesetting of the current page, if so, all typesetters are completely shifted to the background for typesetting, and simultaneously, the page starts to accept editing modification,
In another embodiment, if the current page does not exceed the screen visual range, the next page is continued to be typeset until the typeset page exceeds the screen visual range, and in other embodiments, if the current page does not exceed the screen visual range, the next page is continued to be typeset until the whole file typeset is ended.
In another preferred embodiment, the partial typesetting is performed taking the input characters in the paragraphs as an example:
With continued reference to fig. 3, fig. 3 is a flow chart illustrating an embodiment of a partial layout of a quick layout method in text processing according to the present invention. As shown in fig. 3, after a line character is changed, a line typesetter locates the line where the input character is located, obtains modified content, modified layout information and pre-modification typesetting information of the line, and rearranges the modified content of the line from the first character of the line, if the effective typesetting range after the rearrangement of the line is consistent with the effective typesetting range before the rearrangement, the typesetting is ended;
In another embodiment, if the effective typesetting range after the re-typesetting is inconsistent with the effective typesetting range before the re-typesetting, inputting the typesetting result of the line to a paragraph typesetter waiting for data input to typeset;
meanwhile, if the line typesetting result affects the subsequent line, the line typesetting device continues typesetting of the subsequent line, and the like until the line typesetting device typesets;
In another embodiment, if the paragraph typesetting result changes the effective typesetting range of the paragraphs and/or the effective typesetting range of the subsequent paragraphs, the paragraph typesetting result is input to the former-stage typesetter waiting for data input for typesetting, and the paragraph typesetter continues typesetting until the paragraph typesetter typesetting ends;
In another embodiment, if the typesetting result of each stage of display area causes the change of the current stage of display area or other display areas of the associated positions, the typesetting result of the current stage of display area is input to the typesetter of the previous stage waiting for data input of the current stage for typesetting until the final page one-stage typesetting is completed;
After each level of typesetting device typesets outside the demonstration scope of the screen display, if the typesetting is not finished, all typesetting devices are all transferred to the background for typesetting until the typesetting of the whole influence range is finished.
According to another aspect of the present invention, the present invention provides a device for rapid typesetting in text processing, including a processor and a memory, wherein program instructions are stored in the memory;
The program instructions are executed by the processor to implement a quick layout method in text processing.
According to yet another aspect of the present invention, there is provided a computer-readable medium having stored therein program instructions that are executed to implement a quick layout method in text processing.
The quick typesetting method in the word processing has the advantages that:
(1) According to the rapid typesetting method, the rapid typesetting device and the computer readable medium in the word processing, the areas where the file contents are located are subjected to partition grading, and the different display areas are independently typeset, so that the office efficiency of a user is improved;
(2) According to the rapid typesetting method, the rapid typesetting device and the computer readable medium in the word processing, different display areas are typeset in parallel, so that typesetters of the different display areas work to the greatest extent, the performance of the device is fully utilized, and the rapid response can be achieved when the content of a large file is opened or edited and changed.
In this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a list of elements is included, and may include other elements not expressly listed.
In this document, terms such as front, rear, upper, lower, etc. are defined with respect to the positions of the components in the drawings and with respect to each other, for clarity and convenience in expressing the technical solution. It should be understood that the use of such orientation terms should not limit the scope of the claimed application.
The embodiments described above and features of the embodiments herein may be combined with each other without conflict.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications and alternatives to the above embodiments may be made by those skilled in the art within the scope of the invention.