CN1821994B - A Method of Automatically Separating Text Blocks into Columns According to the Background Grid - Google Patents

A Method of Automatically Separating Text Blocks into Columns According to the Background Grid Download PDF

Info

Publication number
CN1821994B
CN1821994B CN200610066428A CN200610066428A CN1821994B CN 1821994 B CN1821994 B CN 1821994B CN 200610066428 A CN200610066428 A CN 200610066428A CN 200610066428 A CN200610066428 A CN 200610066428A CN 1821994 B CN1821994 B CN 1821994B
Authority
CN
China
Prior art keywords
column
text block
center
edge
text
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.)
Expired - Fee Related
Application number
CN200610066428A
Other languages
Chinese (zh)
Other versions
CN1821994A (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.)
Peking University
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University
Beijing Founder 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 Peking University, Beijing Founder Electronics Co Ltd filed Critical Peking University
Priority to CN200610066428A priority Critical patent/CN1821994B/en
Publication of CN1821994A publication Critical patent/CN1821994A/en
Application granted granted Critical
Publication of CN1821994B publication Critical patent/CN1821994B/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

本发明属于印刷排版领域,具体涉及一种根据版心背景格对文字块进行自动分栏的方法。现有的方法中,排版人员对文字块进行分栏时,按照文字块的宽度进行平均分栏,然后再手工进行调整栏线位置,以使文字块栏线的位置与版心背景格栏线的位置重合,费时费力,准确性不高。本发明所述的方法,首先确定文字块和版心背景格的相对位置;然后据此确定文字块第一栏的起始边和终止边的位置,并确定文字块每一栏的栏宽;最后根据确定的文字块的栏宽进行自动分栏。采用本发明所述的方法,使排版人员在对文字块进行分栏操作时可以实现自动分栏,不必手工调整栏宽,可以实现既准确又快速地在版心背景格的特定位置对文字块进行自动分栏,精确性和效率均大大提高。

Figure 200610066428

The invention belongs to the field of printing and typesetting, and in particular relates to a method for automatically dividing text blocks into columns according to the center background grid. In the existing method, when the typesetting personnel divide the text block into columns, they divide the text blocks into columns evenly according to the width of the text block, and then manually adjust the position of the column line so that the position of the text block column line is the same as that of the center background grid line. The positions overlap, time-consuming and labor-intensive, and the accuracy is not high. The method of the present invention first determines the relative position of the text block and the background frame of the center of the plate; then determines the position of the start side and the end side of the first column of the text block accordingly, and determines the column width of each column of the text block; Finally, automatic column division is performed according to the column width of the determined text block. By adopting the method of the present invention, typesetting personnel can realize automatic column division when performing column division operations on text blocks, without manually adjusting the column width, and can realize accurate and fast alignment of text blocks at a specific position in the background grid of the center of the plate. Carry out automatic column separation, the accuracy and efficiency are greatly improved.

Figure 200610066428

Description

一种根据版心背景格对文字块进行自动分栏的方法 A Method of Automatically Separating Text Blocks into Columns According to the Background Grid

技术领域technical field

本发明属于印刷排版领域,具体涉及一种根据版心背景格对文字块进行自动分栏的方法。The invention belongs to the field of printing and typesetting, and in particular relates to a method for automatically separating text blocks into columns according to the center background grid.

背景技术Background technique

在印刷排版领域中,对文字进行排版是很重要的工作流程,目前,用排版软件进行排版过程中,当进行文字排版处理时,文字块的位置确定之后,常常需要把文字块按照版心背景格栏线的位置进行分栏。In the field of printing and typesetting, text typesetting is a very important workflow. At present, in the typesetting process with typesetting software, when text typesetting is performed, after the position of the text block is determined, it is often necessary to place the text block according to the center background. The position of the grid line divides the column.

目前常见的分栏方法是按照文字块的宽度进行平均分栏,该方法并没有考虑文字块位置、版心背景格等信息,因此通常情况下,分栏后文字块栏线的位置与版心背景格栏线的位置不能完全重合,二者之间存在一些差别,如果需要文字块在版心背景格的特定位置进行分栏的效果,则需要排版人员在分栏之后手动调整栏线位置,使文字块栏线的位置与版心背景格栏线的位置重合。The current common column division method is to divide the columns evenly according to the width of the text block. This method does not consider information such as the position of the text block, the background grid of the center, and so on. The positions of the background grid and column lines cannot be completely overlapped, and there are some differences between the two. If the text block is required to be divided into columns at a specific position in the background grid of the center, the typesetting personnel need to manually adjust the position of the column lines after the column division. Make the position of the column line of the text block coincide with that of the center background grid line.

由上述的描述可见,现有分栏方法的缺点是:需要经过分栏和手动调整栏线两步操作才能达到在版心背景格的特定位置分栏的目的;手动调整栏线位置费时费力,降低了排版效率;手动操作受鼠标移动最小距离的影响,而存在一定误差,这些误差通过手动操作几乎不可消除。It can be seen from the above description that the disadvantages of the existing column division method are: it needs two steps of column division and manual adjustment of the column line to achieve the purpose of column division at a specific position in the background grid of the center of the plate; manually adjusting the position of the column line is time-consuming and laborious. The efficiency of typesetting is reduced; manual operation is affected by the minimum distance of mouse movement, and there are certain errors, which can hardly be eliminated by manual operation.

发明内容Contents of the invention

针对现有技术中存在的缺陷,本发明的目的是提供一种根据版心背景格对文字块进行自动分栏的方法,该方法能够让排版人员通过简单的一步操作,准确快速地在版心背景格的特定位置对文字块进行分栏。Aiming at the defects existing in the prior art, the object of the present invention is to provide a method for automatically dividing text blocks into columns according to the background grid of the center of the plate. This method can allow typesetting personnel to accurately and quickly place text blocks in the center of the plate through a simple one-step operation. The specific position of the background frame divides the text block into columns.

为达到以上目的,本发明采用的技术方案是:一种根据版心背景格对文字块进行自动分栏的方法,包括以下步骤:In order to achieve the above object, the technical solution adopted in the present invention is: a method for automatically dividing text blocks into columns according to the background grid of the core, comprising the following steps:

(1)确定需要分栏的文字块,获取版心背景格的信息,得到版心各栏的栏宽数组,确定文字块和版心背景格的相对位置;(1) Determine the text block that needs to be divided into columns, obtain the information of the background grid of the version center, obtain the column width array of each column of the version center, and determine the relative position of the text block and the background grid of the version center;

(2)根据文字块和版心背景格的相对位置,确定文字块第一栏的起始边和终止边的位置,并确定文字块每一栏的栏宽,所述的文字块起始边是指横向排版时文字块外包框的左边或者竖向排版时文字块外包框的顶边,所述的文字块终止边是指横向排版时文字块外包框的右边或者竖向排版时指文字块外包框的底边;(2) According to the relative position of the text block and the background grid of the version center, determine the position of the start edge and the end edge of the first column of the text block, and determine the column width of each column of the text block, the start edge of the text block Refers to the left side of the text block frame during horizontal typesetting or the top edge of the text block frame during vertical typesetting. The bottom edge of the outer box;

(3)根据步骤(2)中确定的文字块的栏宽进行分栏。(3) Carry out column division according to the column width of the text block determined in step (2).

进一步,步骤(2)中,确定文字块第一栏的起始边和终止边的位置时,具体方法如下:初始化N=-1,N表示文字块当前栏起始边在版心栏的序号,N=-1表示文字块当前栏起始边在版心区域以外,取出版心背景格的信息,从中得到版心的栏宽数组,用dStart和dEnd分别表示文字块当前栏的起始边的坐标值和终止边的坐标值,对应的栏宽是dEnd-dStart,用hStart和hEnd分别表示版心起始边的坐标值和版心终止边的坐标值,所述版心区域的坐标原点是标尺原点,X轴的正方向向右,Y轴的正方向向下,然后进行以下操作,Further, in the step (2), when determining the position of the start edge and the end edge of the first column of the text block, the specific method is as follows: initialization N=-1, N represents the serial number of the current column start edge of the text block in the center column , N=-1 indicates that the starting edge of the current column of the text block is outside the center area, and the information of the background grid of the printing center is obtained to obtain the column width array of the center of the text block, and dStart and dEnd are used to represent the starting edge of the current column of the text block respectively The coordinate value of the coordinate value and the coordinate value of the end edge, the corresponding column width is dEnd-dStart, use hStart and hEnd to represent the coordinate value of the start edge of the core and the coordinate value of the end edge of the core respectively, the coordinate origin of the core area is the origin of the ruler, the positive direction of the X-axis is to the right, and the positive direction of the Y-axis is downward, and then perform the following operations,

1)如果文字块起始边的坐标值<(hStart-栏间距),N=-1,dStart=文字块起始边的坐标值,dEnd=hStart-栏间距;1) If the coordinate value of the starting edge of the text block<(hStart-column spacing), N=-1, dStart=the coordinate value of the starting side of the text block, dEnd=hStart-column spacing;

2)如果文字块起始边的坐标值>=hEnd,N=-1,dStart=文字块起始边的坐标值,dEnd=文字块终止边的坐标值;2) If the coordinate value of the starting edge of the text block>=hEnd, N=-1, dStart=the coordinate value of the starting edge of the text block, and the coordinate value of the ending edge of dEnd=the text block;

3)如果不满足前面两个条件,则文字块的起始边在版心区域内,则根据文字块起始边坐标值与版心各栏起始边、终止边的坐标值确定N的数值,其中,版心背景格的分栏数>N>=0,dStart=文字块起始边的坐标值,dEnd=版心第N栏终止边的坐标值。3) If the first two conditions are not satisfied, then the start edge of the text block is in the center area, then the value of N is determined according to the coordinate value of the start edge of the text block and the coordinate values of the start edge and end edge of each column of the center , wherein, the number of columns of the core background grid>N>=0, dStart=the coordinate value of the start side of the text block, dEnd=the coordinate value of the end side of the Nth column of the core.

进一步,步骤(2)中,确定文字块每一栏的栏宽时,具体方法如下:Further, in step (2), when determining the column width of each column of the text block, the specific method is as follows:

a.当dStart<文字块终止边的坐标值,并且文字块当前的分栏数<版心分栏数+2时(因为自动分栏的文字块最多可以分成的栏数=版心分栏数+2),进入循环;a. When dStart < the coordinate value of the end edge of the text block, and the current number of columns of the text block < the number of columns in the center of the layout + 2 (because the maximum number of columns that can be divided into a text block with automatic column division = the number of columns in the center of the layout +2), enter the loop;

b.如果dStart>=hEnd、或者dEnd<=版心第N+1栏起始边的坐标值,则当前栏是文字块的最后一栏,dEnd=文字块终止边的坐标值,退出循环;b. If dStart>=hEnd, or dEnd<=the coordinate value of the starting side of the N+1 column of the core, then the current column is the last column of the text block, dEnd=the coordinate value of the ending side of the text block, and exit the loop;

c.否则就不是最后一栏,dEnd=版心第N栏终止边的坐标值,文字块当前栏的栏宽=dEnd-dStart;c. Otherwise, it is not the last column, dEnd = the coordinate value of the end edge of the Nth column of the core, the column width of the current column of the text block = dEnd-dStart;

d.然后,版心栏序号N=N+1,dStart=dEnd+栏间距,更新版心第N栏的起始边和终止边的坐标值,重复步骤a到d。d. Then, the column number N=N+1, dStart=dEnd+column spacing, update the coordinates of the start side and end side of the Nth column of the version center, and repeat steps a to d.

更进一步,确定文字块的栏宽时:Further, when determining the column width of the text block:

1)如果文字块的起始边落在版心第N栏终止栏线和第N+1栏起始栏线之间的区域内,则将从文字块起始边到第N+1栏的起始栏线处的部分并入文字块的第一栏,栏间距区域内的部分不单独分为一栏;1) If the starting edge of the text block falls within the area between the ending column line of the Nth column and the starting column line of the N+1th column, then the The part at the starting column line is merged into the first column of the text block, and the part within the space between columns is not divided into a separate column;

2)如果文字块的终止边落在版心第N栏终止栏线和第N+1起始栏线之间的区域内,则将从第N栏终止栏线到文字块终止边的部分并入文字块的最后一栏。2) If the end edge of the text block falls within the area between the end line of column N and the start line of N+1, the part from the end line of column N to the end edge of the text block will be Enter the last column of the text block.

进一步,步骤(3)中,文字块内所有栏的栏宽确定之后,分栏之前,如果排版方向是反向横排,则把栏宽数组进行反转。Further, in step (3), after the column widths of all columns in the text block are determined and before column division, if the typesetting direction is reverse horizontal, the column width array is reversed.

本发明的效果在于:采用本发明所述的方法,排版人员在对文字块进行分栏操作时可以实现自动分栏,不必手工调整栏宽,可以实现既准确又快速地在版心背景格的特定位置对文字块进行自动分栏,精确性和效率均大大提高。The effect of the present invention is that: by adopting the method described in the present invention, typesetting personnel can realize automatic column separation when performing column separation operations on text blocks, without manually adjusting the column width, and can realize accurate and fast layout in the center and background grids. The text blocks are automatically divided into columns at a specific position, and the accuracy and efficiency are greatly improved.

附图说明Description of drawings

图1是本发明所述方法的具体实施方式的流程图;Fig. 1 is the flow chart of the embodiment of the method of the present invention;

图2横排的版心示意图;Figure 2 is a schematic diagram of the horizontal layout of the core;

图3正向横排的文字块不分栏的效果示意图;Figure 3 is a schematic diagram of the effect of text blocks arranged horizontally without columns;

图4正向横排的文字块自动分栏的效果示意图;Figure 4 is a schematic diagram of the effect of automatic column division of text blocks arranged in the forward and horizontal direction;

图5正向竖排文字块不分栏的效果示意图;Figure 5 is a schematic diagram of the effect of forward vertical text blocks without columns;

图6正向竖排文字块自动分栏的效果示意图;Figure 6 is a schematic diagram of the effect of automatic column division of forward vertical text blocks;

图7正向横排文字块的起始边、终止边在版心栏间距区域内的不分栏效果示意图;Figure 7 is a schematic diagram of the effect of not dividing columns in the area between the starting edge and the ending edge of the forward horizontal text block in the center-column spacing area;

图8正向横排文字块的起始边、终止边在版心栏间距区域内的自动分栏效果示意图;Figure 8 is a schematic diagram of the automatic column division effect of the starting edge and the ending edge of the forward horizontal text block in the center column spacing area;

图9正向横排文字块的起始边、终止边在版心栏间距区域内未经特殊处理的模拟效果示意图。Fig. 9 is a schematic diagram of the simulated effect of the starting edge and the ending edge of the forward horizontal text block in the center-column spacing area without special treatment.

具体实施方式Detailed ways

下面结合附图及具体实施例对本发明作进一步的描述:Below in conjunction with accompanying drawing and specific embodiment the present invention will be further described:

如图2所示,版心21分为四个栏,分别为第0栏24、第1栏25第2栏26第3栏27,版心起始边和终止边分别如图2中的22、23所示,第1栏起始边和终止边分别如图2中的28、29所示。其中的网格为版心背景格,版心背景格填充整个版心21区域。As shown in Figure 2, the version core 21 is divided into four columns, namely the 0th column 24, the first column 25, the second column 26 and the third column 27. , 23, the starting side and the ending side of column 1 are shown as 28 and 29 in Fig. 2 respectively. The grid is the background grid of the core, and the background grid of the core fills the entire 21 area of the core.

本实施例中,首先定义下面技术术语的含义:In this embodiment, first define the meaning of the following technical terms:

文字块起始边:横向排版时指文字块外包框的左边(X值,如图4中的41),竖向排版时指文字块外包框的顶边(Y值,如图6中的61)。The starting edge of the text block: refers to the left side of the outer frame of the text block during horizontal typesetting (X value, 41 in Figure 4), and refers to the top edge of the outer frame of the text block during vertical typesetting (Y value, 61 in Figure 6 ).

文字块终止边:横向排版时指文字块外包框的右边(X值,如图4中的42),竖向排版时指文字块外包框的底边(Y值,如图6中的62)。Ending edge of the text block: refers to the right side of the outer frame of the text block during horizontal typesetting (X value, 42 in Figure 4), and refers to the bottom edge of the outer frame of the text block during vertical typesetting (Y value, 62 in Figure 6) .

版心当前栏的起始边:横向排版时指版心当前栏排版区域的最左位置(X值,如图2中的28表示第1栏的起始边),竖向排版时指版心当前栏排版区域的最顶位置(Y值)。The starting edge of the current column of the layout center: refers to the leftmost position of the typesetting area of the current column of the layout center during horizontal typesetting (X value, 28 in Figure 2 indicates the starting edge of the first column), and refers to the layout center of the vertical typesetting The topmost position (Y value) of the layout area of the current column.

版心当前栏的终止边:横向排版时指版心当前栏排版区域的最右位置(X值,如图2中的29表示第1栏的终止边),竖向排版时指版心当前栏排版区域的最底位置(Y值)。The end edge of the current column of the version center: refers to the rightmost position of the typesetting area of the current column of the version center during horizontal typesetting (X value, 29 in Figure 2 indicates the end edge of the first column), and refers to the current column of the version center during vertical typesetting The bottommost position (Y value) of the typesetting area.

版心起始边:横向排版时指版心区域的最左位置(X值,如图2中的22),竖向排版时指版心区域的最顶位置(Y值)。The starting edge of the core: refers to the leftmost position of the core area (X value, 22 in Figure 2) during horizontal typesetting, and refers to the top position (Y value) of the core area during vertical typesetting.

版心终止边:横向排版时指版心区域的最右位置(X值,如图2中的23),竖向排版时指版心区域的最底位置(Y值)。End edge of version center: refers to the rightmost position (X value, 23 in Figure 2) of the version center area during horizontal typesetting, and refers to the bottommost position (Y value) of the version center area during vertical typesetting.

本实施例中,所述版心区域的坐标原点是标尺原点,X轴的正方向向右,Y轴的正方向向下。In this embodiment, the origin of the coordinates of the core area is the origin of the scale, the positive direction of the X-axis is to the right, and the positive direction of the Y-axis is downward.

如图1所示,一种根据版心背景格对文字块进行自动分栏的方法,包括以下步骤:As shown in Figure 1, a method for automatically dividing text blocks into columns according to the center background grid includes the following steps:

(1)首选确定需要分栏的文字块,获取版心背景格的信息,得到版心各栏的栏宽数组,确定文字块和版心背景格的相对位置;(1) The first choice is to determine the text block that needs to be divided into columns, obtain the information of the background grid of the version center, obtain the column width array of each column of the version center, and determine the relative position of the text block and the background grid of the version center;

(2)根据文字块和版心背景格的相对位置,确定文字块第一栏的起始边和终止边的位置,并确定文字块每一栏的栏宽;(2) According to the relative position of the text block and the background frame of the center, determine the position of the start edge and the end edge of the first column of the text block, and determine the column width of each column of the text block;

确定文字块第一栏的起始边和终止边的位置时,本实例中采用的具体方法如下:When determining the position of the start side and end side of the first column of the text block, the specific method used in this example is as follows:

初始化N=-1,N表示文字块当前栏起始边在版心栏的序号,N=-1表示文字块当前栏起始边在版心区域以外,取出版心背景格的信息,从中得到版心各栏的栏宽数组,用dStart和dEnd分别表示文字块当前栏的起始边的坐标值和终止边的坐标值,对应的栏宽是dEnd-dStart,用hStart和hEnd分别表示版心起始边的坐标值和版心终止边的坐标值,然后进行以下操作,Initialize N=-1, N represents the serial number of the initial edge of the current column of the text block in the core column, N=-1 represents the initial edge of the current column of the text block is outside the core area, take the information of the background grid of the print center, and obtain The column width array of each column in the layout center, use dStart and dEnd to represent the coordinates of the start side and end side of the current column of the text block, respectively, the corresponding column width is dEnd-dStart, use hStart and hEnd to represent the layout center respectively The coordinate value of the start side and the coordinate value of the end side of the core, and then perform the following operations,

1)如果文字块起始边的坐标值<(hStart-栏间距),N=-1,dStart=文字块起始边的坐标值,dEnd=hStart-栏间距;1) If the coordinate value of the starting edge of the text block<(hStart-column spacing), N=-1, dStart=the coordinate value of the starting side of the text block, dEnd=hStart-column spacing;

2)如果文字块起始边的坐标值>=hEnd,N=-1,dStart=文字块起始边的坐标值,dEnd=文字块终止边的坐标值;2) If the coordinate value of the starting edge of the text block>=hEnd, N=-1, dStart=the coordinate value of the starting edge of the text block, and the coordinate value of the ending edge of dEnd=the text block;

3)如果不满足前面两个条件,则文字块的起始边在版心区域内,则根据文字块起始边坐标值与版心各栏起始边、终止边的坐标值确定N的数值,其中,版心背景格的分栏数>N>=0,dStart=文字块起始边的坐标值,dEnd=版心第N栏终止边的坐标值。3) If the first two conditions are not satisfied, then the start edge of the text block is in the center area, then the value of N is determined according to the coordinate value of the start edge of the text block and the coordinate values of the start edge and end edge of each column of the center , wherein, the number of columns of the core background grid>N>=0, dStart=the coordinate value of the start side of the text block, dEnd=the coordinate value of the end side of the Nth column of the core.

确定文字块每一栏的栏宽时,本实施例中采用的具体方法如下:When determining the column width of each column of the text block, the specific method adopted in the present embodiment is as follows:

a.当dStart<文字块终止边的坐标值,并且文字块当前的分栏数<版心分栏数+2时,进入循环;a. When dStart < the coordinate value of the end edge of the text block, and the current number of columns of the text block < the number of columns in the center of the page + 2, enter the loop;

b.如果dStart>=hEnd、或者dEnd<=版心第N+1栏起始边的坐标值,则当前栏是文字块的最后一栏,dEnd=文字块终止边的坐标值,退出循环;b. If dStart>=hEnd, or dEnd<=the coordinate value of the starting side of the N+1 column of the core, then the current column is the last column of the text block, dEnd=the coordinate value of the ending side of the text block, and exit the loop;

c.否则就不是最后一栏,dEnd=版心第N栏终止边的坐标值,文字块当前栏的栏宽=dEnd-dStart;c. Otherwise, it is not the last column, dEnd = the coordinate value of the end edge of the Nth column of the core, the column width of the current column of the text block = dEnd-dStart;

d.然后,版心栏序号N=N+1,dStart=dEnd+栏间距,更新版心第N栏的起始边和终止边的坐标值,重复步骤a到d。d. Then, the column number N=N+1, dStart=dEnd+column spacing, update the coordinates of the start side and end side of the Nth column of the version center, and repeat steps a to d.

如图7和图8所示,如果在上述确定栏宽的过程中,遇到下述问题则特殊处理:As shown in Figure 7 and Figure 8, if the following problems are encountered in the process of determining the column width above, special treatment will be given:

1)如果文字块的起始边落在版心第N栏终止栏线和第N+1栏起始栏线之间的区域内,如图8中的81所示,则从文字块起始边到第N+1栏的起始栏线处,并入文字块的第一栏,栏间距区域内的部分不单独分为一栏。图8中,文字块起始边81落在版心第1栏终止栏线83和第2栏起始栏线84之间的区域内,如果严格地把文字块分成所有栏的栏宽和版心栏宽都相等的情况,就会出现图9的结果,图中区域91的宽度不够1个栏间距的宽度,排版中也不允许出现半个栏间距的情况,因此把图9中的91区域合并到文字块的第一栏,就是图8的效果。这样,当文字块在版心区域中进行自动分栏时,文字块一栏的最大宽度=版心栏宽+1个版心栏间距;文字块在版心区域外时,就不受这个最大宽度的限制了。1) If the starting edge of the text block falls in the area between the end column line of the Nth column and the start column line of the N+1 column, as shown in 81 in Figure 8, then start from the text block From the edge to the initial column line of the N+1th column, it is merged into the first column of the text block, and the part within the inter-column space area is not divided into a separate column. In Fig. 8, the starting edge 81 of the text block falls in the area between the terminating column line 83 of the first column and the starting column line 84 of the second column in the center of the version. If the widths of the center columns are all equal, the result shown in Figure 9 will appear. The width of the area 91 in the figure is not enough for the width of one column spacing, and half a column spacing is not allowed in the typesetting. Therefore, the 91 in Figure 9 The area is merged into the first column of the text block, which is the effect in Figure 8. In this way, when the text block is automatically divided into columns in the center area, the maximum width of a column of the text block = the width of the center column + 1 space between the center columns; when the text block is outside the center area, it is not affected by this maximum width. The width is limited.

2)如果文字块的终止边落在版心第N栏终止栏线和第N+1起始栏线之间的区域内,如图8中的82所示,则从第N栏终止栏线到文字块终止边,并入文字块的最后一栏。图8中,文字块终止边82落在版心第3栏终止栏线85和第4栏起始栏线86之间的区域内,合并前后的对比参见图8和图9。2) If the ending edge of the text block falls in the area between the ending column line of the Nth column and the N+1th starting column line in the core, as shown in 82 in Figure 8, then the ending column line from the Nth column To the end edge of the text block, merged into the last column of the text block. In FIG. 8 , the end edge 82 of the text block falls within the area between the end line 85 of the third column and the start line 86 of the fourth column in the core. For comparison before and after merging, refer to FIGS. 8 and 9 .

(3)根据步骤(2)中确定的文字块的栏宽进行分栏,文字块内所有栏的栏宽确定之后,如果排版方向是反向横排,就把栏宽数组进行反转,在其它排版方向时保持不变。然后进行分栏,分栏的方法与现有的普通分栏方法相同。(3) Divide into columns according to the column width of the text block determined in step (2). After the column widths of all columns in the text block are determined, if the typesetting direction is reverse horizontal, the column width array is reversed. It remains unchanged for other layout directions. Carry out column division then, the method for column division is identical with existing common column method.

如图3、图5、图7是没有根据版心背景格进行文字块分栏的示意图,图4、图6、图8分别是图3、图5、图7采用本发明所述方法根据版心背景格自动分栏后的效果示意图。如图3和图4所示,当版心背景格是横排时,网格行附近的数字表示版心背景格行序号,网格列附近的数字表示版心背景格栏的序号。图4中,41表示文字块起始边,42表示文字块终止边。图8是图7采用本发明所述方法特殊处理后的效果,图9是图7中没有用本发明所述方法特殊处理的效果,实际排版中不会出现图9的效果。As Fig. 3, Fig. 5, Fig. 7 are the schematic diagrams that do not carry out text block columns according to the background lattice of the version center, Fig. 4, Fig. 6, Fig. 8 are respectively Fig. 3, Fig. 5, Fig. 7 adopting the method according to the present invention according to the version Schematic diagram of the effect after the heart background grid is automatically divided into columns. As shown in Figure 3 and Figure 4, when the core background grid is horizontal, the numbers near the grid row indicate the row number of the core background grid, and the numbers near the grid column indicate the serial number of the core background grid column. In FIG. 4 , 41 represents the starting side of the text block, and 42 represents the ending side of the text block. Fig. 8 is the effect of Fig. 7 after special treatment by the method of the present invention, and Fig. 9 is the effect of Fig. 7 without special treatment by the method of the present invention, and the effect of Fig. 9 will not appear in actual typesetting.

另外,对本发明所述的分栏方法其应用范围说明如下:In addition, its scope of application of the column separation method described in the present invention is described as follows:

(1)只有当文字块的排版方向和版心背景格的排版方向都是横排或者都是竖排的时候,本发明所述的自动分栏才会有效果;如果版心背景格是横排,文字块是竖排,或者版心背景格是竖排,文字块是横排,则该文字块只有一栏。当文字块的排版跟版心背景格的排版方向调整为一致后,仍然可以得到根据本发明所述的方法进行自动分栏后的效果。(1) Only when the typesetting direction of the text block and the typesetting direction of the background grid of the version center are all horizontal or vertical, the automatic column division of the present invention will have an effect; if the background grid of the version center is horizontal row, the text block is vertical, or the center background grid is vertical, and the text block is horizontal, then the text block has only one column. When the typesetting of the text block is adjusted to be consistent with the typesetting direction of the center background frame, the effect of automatic column division according to the method of the present invention can still be obtained.

(2)只有文字块与版心有重叠区域的时候,本发明所述的自动分栏才有效果;如果文字块与版心没有重叠区域,则该文字块为一栏。当调整文字块或者版心使两者有重叠区域后,仍然可以得到根据本发明所述的方法进行自动分栏后的效果。(2) Only when there is an overlapping area between the text block and the core, the automatic column division of the present invention is effective; if there is no overlapping area between the text block and the core, then the text block is a column. After adjusting the text block or the center of the page so that there is an overlapping area between them, the effect of automatic column division according to the method of the present invention can still be obtained.

本发明所述的方法并不限于具体实施方式中所述的实施例,本领域技术人员根据本发明的技术方案得出其他的实施方式,同样属于本发明的技术创新范围。The method described in the present invention is not limited to the examples described in the specific implementation manners, and those skilled in the art can obtain other implementation manners according to the technical solutions of the present invention, which also belong to the technical innovation scope of the present invention.

Claims (6)

1.一种根据版心背景格对文字块进行自动分栏的方法,包括以下步骤:1. A method for automatically dividing text blocks into columns according to the background lattice of the version center, comprising the following steps: (1)确定需要分栏的文字块,获取版心背景格的信息,得到版心各栏的栏宽数组,确定文字块和版心背景格的相对位置;(1) Determine the text block that needs to be divided into columns, obtain the information of the background grid of the version center, obtain the column width array of each column of the version center, and determine the relative position of the text block and the background grid of the version center; (2)根据文字块和版心背景格的相对位置,确定文字块第一栏的起始边和终止边的位置,并确定文字块每一栏的栏宽,所述的文字块起始边是指横向排版时文字块外包框的左边或者竖向排版时文字块外包框的顶边,所述的文字块终止边是指横向排版时文字块外包框的右边或者竖向排版时指文字块外包框的底边;(2) According to the relative position of the text block and the background grid of the version center, determine the position of the start edge and the end edge of the first column of the text block, and determine the column width of each column of the text block, the start edge of the text block Refers to the left side of the text block frame during horizontal typesetting or the top edge of the text block frame during vertical typesetting. The bottom edge of the outer box; (3)根据步骤(2)中确定的文字块的栏宽进行分栏。(3) Carry out column division according to the column width of the text block determined in step (2). 2.如权利要求1所述的一种根据版心背景格对文字块进行自动分栏的方法,其特征是:步骤(2)中,确定文字块第一栏的起始边和终止边的位置时,具体方法如下:初始化N=-1,N表示文字块当前栏起始边在版心栏的序号,N=-1表示文字块当前栏起始边在版心区域以外,取出版心背景格的信息,从中得到版心的栏宽数组,用dStart和dEnd分别表示文字块当前栏的起始边的坐标值和终止边的坐标值,对应的栏宽是dEnd-dStart,用hStart和hEnd分别表示版心起始边的坐标值和版心终止边的坐标值,所述版心区域的坐标原点是标尺原点,X轴的正方向向右,Y轴的正方向向下,然后进行以下操作,2. a kind of method that text block is carried out to column automatically according to version center background grid as claimed in claim 1, it is characterized in that: in step (2), determine the start edge of the first column of text block and the end edge For the position, the specific method is as follows: Initialize N=-1, N indicates the serial number of the text block’s current column start edge in the center column, N=-1 indicates the text block’s current column start edge is outside the center area, take the print center The information of the background grid, from which the column width array of the center of the layout is obtained. Use dStart and dEnd to represent the coordinates of the starting side and the ending side of the current column of the text block respectively. The corresponding column width is dEnd-dStart. Use hStart and dEnd hEnd respectively represent the coordinate values of the starting edge of the core and the end edge of the core, the origin of the coordinates of the core area is the origin of the scale, the positive direction of the X-axis is to the right, and the positive direction of the Y-axis is downward, and then The following operations, 1)如果文字块起始边的坐标值<(hStart-栏间距),则N=-1,dStart=文字块起始边的坐标值,dEnd=hStart-栏间距;1) If the coordinate value of the starting edge of the text block<(hStart-column spacing), then N=-1, dStart=the coordinate value of the starting side of the text block, dEnd=hStart-column spacing; 2)如果文字块起始边的坐标值>=hEnd,则N=-1,dStart=文字块起始边的坐标值,dEnd=文字块终止边的坐标值;2) If the coordinate value of the starting edge of the text block>=hEnd, then N=-1, the coordinate value of dStart=the starting edge of the text block, and the coordinate value of the ending edge of dEnd=the text block; 3)如果不满足前面两个条件,则文字块的起始边在版心区域内,则根据文字块起始边坐标值与版心各栏起始边、终止边的坐标值确定N的数值,其中,版心背景格的分栏数>N>=0,dStart=文字块起始边的坐标值,dEnd=版心第N栏终止边的坐标值。3) If the first two conditions are not satisfied, then the start edge of the text block is in the center area, then the value of N is determined according to the coordinate value of the start edge of the text block and the coordinate values of the start edge and end edge of each column of the center , wherein, the number of columns of the core background grid>N>=0, dStart=the coordinate value of the start side of the text block, dEnd=the coordinate value of the end side of the Nth column of the core. 3.如权利要求1或2所述的一种根据版心背景格对文字块进行自动分栏的方法,其特征是:步骤(2)中,确定文字块每一栏的栏宽时,具体方法如下:3. A kind of method that text block is carried out to column automatically according to version center background lattice as claimed in claim 1 or 2, it is characterized in that: in step (2), when determining the column width of each column of text block, specifically Methods as below: a.当dStart<文字块终止边的坐标值,并且文字块当前的分栏数<版心分栏数+2时,进入循环;a. When dStart < the coordinate value of the end edge of the text block, and the current number of columns of the text block < the number of columns in the center of the page + 2, enter the loop; b.如果dStart>=hEnd、或者dEnd<=版心第N+1栏起始边的坐标值,则当前栏是文字块的最后一栏,dEnd=文字块终止边的坐标值,退出循环;b. If dStart>=hEnd, or dEnd<=the coordinate value of the starting side of the N+1 column of the core, then the current column is the last column of the text block, dEnd=the coordinate value of the ending side of the text block, and exit the loop; c.否则就不是最后一栏,dEnd=版心第N栏终止边的坐标值,文字块当前栏的栏宽=dEnd-dStart;c. Otherwise, it is not the last column, dEnd = the coordinate value of the end edge of the Nth column of the core, the column width of the current column of the text block = dEnd-dStart; d.然后,版心栏序号N=N+1,dStart=dEnd+栏间距,更新版心第N栏的起始边和终止边的坐标值,重复步骤a到d。d. Then, the column number N=N+1, dStart=dEnd+column spacing, update the coordinates of the start side and end side of the Nth column of the version center, and repeat steps a to d. 4.如权利要求3所述的一种根据版心背景格对文字块进行自动分栏的方法,其特征是:确定文字块的栏宽时:4. a kind of method that text block is carried out to column automatically according to version center background frame as claimed in claim 3, it is characterized in that: when determining the column width of text block: 1)如果文字块的起始边落在版心第N栏终止栏线和第N+1栏起始栏线之间的区域内,则将从文字块起始边到第N+1栏的起始栏线处的部分并入文字块的第一栏,栏间距区域内的部分不单独分为一栏;1) If the starting edge of the text block falls within the area between the ending column line of the Nth column and the starting column line of the N+1th column, then the The part at the starting column line is merged into the first column of the text block, and the part within the space between columns is not divided into a separate column; 2)如果文字块的终止边落在版心第N栏终止栏线和第N+1起始栏线之间的区域内,则将从第N栏终止栏线到文字块终止边的部分并入文字块的最后一栏。2) If the end edge of the text block falls within the area between the end line of column N and the start line of N+1, the part from the end line of column N to the end edge of the text block will be Enter the last column of the text block. 5.如权利要求1或2所述的一种根据版心背景格对文字块进行自动分栏的方法,其特征是:步骤(3)中,文字块内所有栏的栏宽确定之后,分栏之前,如果排版方向是反向横排,则把栏宽数组进行反转。5. A kind of method that text block is carried out to column automatically according to version center background grid as claimed in claim 1 or 2, it is characterized in that: in step (3), after the column width of all columns in the text block is determined, divide Before the column, if the typesetting direction is reverse horizontal, reverse the column width array. 6.如权利要求4所述的一种根据版心背景格对文字块进行自动分栏的方法,其特征是:步骤(3)中,文字块内所有栏的栏宽确定之后,分栏之前,如果排版方向是反向横排,则把栏宽数组进行反转。6. A kind of method for carrying out automatic column division to text block according to the background lattice of version center as claimed in claim 4, it is characterized in that: in step (3), after the column width of all columns in the text block is determined, before column division , if the typesetting direction is reverse horizontal, reverse the column width array.
CN200610066428A 2006-03-31 2006-03-31 A Method of Automatically Separating Text Blocks into Columns According to the Background Grid Expired - Fee Related CN1821994B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200610066428A CN1821994B (en) 2006-03-31 2006-03-31 A Method of Automatically Separating Text Blocks into Columns According to the Background Grid

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200610066428A CN1821994B (en) 2006-03-31 2006-03-31 A Method of Automatically Separating Text Blocks into Columns According to the Background Grid

Publications (2)

Publication Number Publication Date
CN1821994A CN1821994A (en) 2006-08-23
CN1821994B true CN1821994B (en) 2010-05-26

Family

ID=36923362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200610066428A Expired - Fee Related CN1821994B (en) 2006-03-31 2006-03-31 A Method of Automatically Separating Text Blocks into Columns According to the Background Grid

Country Status (1)

Country Link
CN (1) CN1821994B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567301A (en) * 2010-12-21 2012-07-11 北大方正集团有限公司 Method and device for subfield composing

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186519B (en) * 2011-12-31 2017-04-05 北大方正集团有限公司 Two-way composition method and equipment
CN104572604B (en) * 2013-10-09 2018-04-27 北大方正集团有限公司 Word subfield processing method and processing device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567301A (en) * 2010-12-21 2012-07-11 北大方正集团有限公司 Method and device for subfield composing

Also Published As

Publication number Publication date
CN1821994A (en) 2006-08-23

Similar Documents

Publication Publication Date Title
CN108446264B (en) Table vector analysis method and device in PDF document
CN105045776B (en) A kind of page automatic composing method
JP5344812B2 (en) Imposition method for automatic document printing
CN108470021A (en) The localization method and device of table in PDF document
CN108637370B (en) Rectangular piece optimized layout method based on plate utilization rate
CN101876967A (en) Method for generating PDF text paragraphs
CN114781314B (en) Method and system for rapidly drawing layout
JP2009526276A (en) Method and apparatus for inserting a filling mold into a design layout
CN101609555A (en) A Gray Level Template Matching Method Based on Gray Level Co-occurrence Matrix
CN115983183B (en) Method for placing pins in integrated circuit layout design
CN1821994B (en) A Method of Automatically Separating Text Blocks into Columns According to the Background Grid
JP5779378B2 (en) Imposition template, imposition data generation apparatus, imposition data generation method and program
CN101021841B (en) A method of automatically adding tuplets to control line format fullness in Uyghur typesetting
CN116394520B (en) Methods, apparatus, electronic devices and storage media for generating grid support structures
CN205074686U (en) Tablet cutting platform
CN1828580B (en) A Typesetting Method of Matrix Text Box Adapting to Text Content
CN104701252B (en) A kind of method of automatic placement chip layout
CN116611388A (en) Method for automatically correcting size and spacing of via holes based on scripting language
TWI389244B (en) Model Picker Method
CN116562016B (en) A method for structural in-depth design of reinforced truss floor deck based on BIM
CN116852716B (en) Edge-distributed support generation method, apparatus, electronic device and storage medium
CN106651993A (en) Method for filling non self-intersecting polygon in FPGA
CN102693341B (en) Distribution optimization design method for back-plane type part strengthening indentations
CN101937569B (en) Character laydown method and system
CN102236638B (en) Method and device for correcting capital and lowercase forms of characters in western language words

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100526

Termination date: 20170331