[go: up one dir, main page]

CN101295290B - Method for multi-row words layout in row - Google Patents

Method for multi-row words layout in row Download PDF

Info

Publication number
CN101295290B
CN101295290B CN2008101147050A CN200810114705A CN101295290B CN 101295290 B CN101295290 B CN 101295290B CN 2008101147050 A CN2008101147050 A CN 2008101147050A CN 200810114705 A CN200810114705 A CN 200810114705A CN 101295290 B CN101295290 B CN 101295290B
Authority
CN
China
Prior art keywords
line
typesetting
text
row
typeset
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
CN2008101147050A
Other languages
Chinese (zh)
Other versions
CN101295290A (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 Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
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 Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN2008101147050A priority Critical patent/CN101295290B/en
Publication of CN101295290A publication Critical patent/CN101295290A/en
Application granted granted Critical
Publication of CN101295290B publication Critical patent/CN101295290B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Machine Translation (AREA)

Abstract

本发明公开了一种多行文字行中排版的方法,属于印刷排版技术领域。现有技术中,实现行中排版的方法有手动实现或者通过无线表格来实现,费时费力,效果却并不能在所有场合下都能十分精确。本发明所述方法:首先在小样编辑器中输入待排版文字,然后插入BD排版语言注解,依据上下文或者用户自定义设置获得排版参数,再依据获得的排版参数对待排版文字进行一系列的位置计算及位移修正,生成大样文件,最后通过大样文件浏览器解析该大样文件,获得具体的排版效果。本发明所述的方法能够迅速的完成多行文字行中排版的效果,从而提高了行中排版的效率。

Figure 200810114705

The invention discloses a typesetting method in a multi-line character line, which belongs to the technical field of printing typesetting. In the prior art, the methods for implementing in-line typesetting are manually or through wireless forms, which is time-consuming and laborious, but the effect cannot be very accurate in all occasions. The method of the present invention: first input the text to be typeset in the sample editor, then insert the BD typesetting language annotation, obtain the typesetting parameters according to the context or user-defined settings, and then perform a series of position calculations for the typesetting text according to the obtained typesetting parameters and displacement correction to generate a large sample file, and finally parse the large sample file through the large sample file browser to obtain a specific typesetting effect. The method of the invention can quickly complete the effect of typesetting in lines of multi-line characters, thereby improving the efficiency of typesetting in lines.

Figure 200810114705

Description

一种多行文字行中排版的方法A Method of Typesetting in Multi-line Text Lines

技术领域 technical field

本发明属于印刷排版技术领域,具体涉及一种多行文字行中排版的方法。  The invention belongs to the technical field of printing and typesetting, and in particular relates to a typesetting method in a multi-line text line. the

背景技术 Background technique

目前,在印刷排版行业中,在对文字内容进行排版处理时,绝大多数是以行为单位排版文字的,这样在进行多行文字行中排版处理时,必须使用手动排版每行的文字、设置每行的对齐方式等属性,来模拟达到行中排版的效果;或者借助表格实现,具体实现方法如下:  At present, in the printing and typesetting industry, when typesetting text content, most of the text is typeset in units of lines. In this way, when performing typesetting in multi-line text lines, it is necessary to manually typeset the text of each line, set Attributes such as the alignment of each row to simulate the effect of typesetting in a row; or realize it with the help of a table, the specific implementation method is as follows:

(1)手动排版:排版人员根据版式要求输入各行文字,设置文字属性,手动调整行中排版各行文字的对齐方式;  (1) Manual typesetting: The typesetting personnel enter each line of text according to the layout requirements, set the text attributes, and manually adjust the alignment of each line of typesetting in the line;

(2)借助表格排版:排版人员依据行数N插入一个N行3列的表格,第1列和第3列分别合并成1个单元格,并设置单元格属性为居中对齐,中间列各单元格设置文本对齐方式,并输入各行文字,然后设置表格的无边框属性,最后依据文字多少调整单元格宽度属性。  (2) With the help of table typesetting: the typesetting staff inserts a table with N rows and 3 columns according to the number of rows N, the first column and the third column are respectively merged into one cell, and the cell properties are set to center alignment, and the cells in the middle column Set the text alignment in the cell, and enter each line of text, then set the borderless property of the table, and finally adjust the cell width property according to the amount of text. the

上述两种实现多行文字行中排版方法的缺点是:手动排版只适合于总行数为奇数行的行中排版,并且当行中排版的文字格式与其前后文字的格式不同时,不能完全精确的实现行中排版;而表格排版则费时费力,降低了行中排版的效率。  The disadvantages of the above two methods of implementing multi-line typesetting in lines are: manual typesetting is only suitable for in-line typesetting with an odd number of lines in total, and when the text format of in-line typesetting is different from the format of the text before and after it, it cannot be completely accurate. In-line typesetting; while table typesetting is time-consuming and laborious, reducing the efficiency of in-line typesetting. the

为了更好的理解本发明,现对本发明涉及的BD排版语言简要介绍如下:BD排版语言是北大电子出版系统专门用来排书刊的一种计算机语言,是方正书版系统的专用语言,它由100多个注解组成,每个注解都有自己的功能,指明排版的某些要求,并有确定的作用范围;BD排版语言每个注解都有一个或多个参数可选择,每个参数对应某个功能;多个注解联合使用,可以完成比较复杂的版面排版。  In order to better understand the present invention, the BD typesetting language involved in the present invention is now briefly introduced as follows: BD typesetting language is a computer language specially used by Peking University Electronic Publishing System to arrange books and periodicals, and is a special language for the Founder Book Edition system. Composed of more than 100 annotations, each annotation has its own function, specifies certain requirements of typesetting, and has a definite scope of action; each annotation of BD typesetting language has one or more parameters to choose from, and each parameter corresponds to a certain A function; multiple annotations can be used in combination to complete more complex layouts. the

发明内容 Contents of the invention

针对现有技术中存在的缺陷,本发明的目的是提供一种多行文字行中排版的方法,该方法能够迅速并且精确地将多行文字作为一个整体排版在任意行的行中,提高行中排版的效率。  Aiming at the defects existing in the prior art, the purpose of the present invention is to provide a method for typesetting multi-line text in a line, which can rapidly and accurately type-type multi-line text in any line as a whole, and improve line layout. Typesetting efficiency. the

为达到以上目的,本发明采用的技术方案是,一种多行文字行中排版的方法,包括以下步骤:  In order to achieve the above object, the technical solution adopted in the present invention is a method for typesetting in a multi-line text line, comprising the following steps:

(1)在小样编辑器中顺序输入待排版文字及符号,不同的行之间以回车键间隔;  (1) Enter the text and symbols to be typeset sequentially in the sample editor, and use the Enter key to separate different lines;

(2)根据用户对排版效果的要求,在小样编辑器中插入BD排版语言注解,依据BD排版语言注解使用规则将行中待排版文字作为一个整体标示出来,生成小样文件;  (2) According to the user's requirements for typesetting effects, insert BD typesetting language annotations into the sample editor, mark the text to be typeset in the line as a whole according to the usage rules of BD typesetting language annotations, and generate a sample file;

(3)解析小样文件中的BD排版语言注解,获得行中待排版文字的排版参数,依据该排版参数排版后,生成大样文件;  (3) Analyze the BD typesetting language annotation in the sample file, obtain the typesetting parameters of the text to be typeset in the row, and generate the large sample file after typesetting according to the typesetting parameters;

(4)大样文件浏览器解析该大样文件,得到具体的排版效果。  (4) The large sample file browser parses the large sample file to obtain a specific typesetting effect. the

进一步,步骤(1)中所述的顺序输入是指按照从左至右,从高行到低行的顺序依次输入。  Further, the sequential input described in step (1) refers to sequential input from left to right, from high row to low row. the

所述的待排版文字包括行中待排版文字、行中待排版文字之前和之后的文字,以及标点符号。  The text to be typed includes the text to be typed in the row, the text before and after the text to be typed in the row, and punctuation marks. the

所述的符号是指书版专用字符,包括空格字符、硬回车字符和文件结束符。  The symbols mentioned above refer to special characters for book editions, including space characters, hard return characters and end-of-file characters. the

进一步,步骤(2)中所述的BD排版语言注解包括行中(HZ)注解以及能够与行中注解配合使用的注解。  Further, the BD typesetting language annotations in step (2) include in-line (HZ) annotations and annotations that can be used in conjunction with in-line annotations. the

所述的行中注解是指开闭弧注解,开弧标志行中注解状态的开始,闭弧标志行中注解状态的结束,开弧与闭弧之间的文字为行中待排版文字。  The comment in the line refers to the comment of opening and closing arcs, the opening arc marks the start of the comment state in the line, and the closing arc marks the end of the comment state in the line, and the text between the open arc and the closed arc is the text to be typesetting in the line. the

进一步,步骤(3)中所述的排版参数是根据上下文或者设置在小样编辑器中的参数设置界面获得。  Further, the typesetting parameters described in step (3) are obtained according to the context or the parameter setting interface set in the sample editor. the

依据排版参数排版的过程包括以下步骤:  The process of typesetting according to typesetting parameters includes the following steps:

1)获取第一行排版参数:包括字高,字宽,字间距,行高,行间距,入口横、纵坐标;  1) Obtain the typesetting parameters of the first line: including character height, character width, character spacing, line height, line spacing, horizontal and vertical coordinates of the entry;

2)排版第一行;  2) typeset the first line;

3)判断第一行是否排版结束,如是则转步骤4),如否则转步骤2);  3) Determine whether the typesetting of the first line is completed, if so, go to step 4), otherwise go to step 2);

4)备份上一行排版参数,获得下一行排版参数;  4) Back up the typesetting parameters of the previous line to obtain the typesetting parameters of the next line;

5)计算该行文字向下位移量,及入口横、纵坐标;  5) Calculate the downward displacement of the line of text, and the horizontal and vertical coordinates of the entry;

6)排版该行;  6) typeset the line;

7)判断该行是否排版结束,如是则转步骤8),如否则转步骤6);  7) Determine whether the typesetting of the line is completed, if so, go to step 8), otherwise go to step 6);

8)该行文字向下位移;  8) The line of text is displaced downward;

9)判断行中待排版文字所有行是否均排版结束,如是则转步骤10),如否则转步骤4);  9) Judging whether all lines of the text to be typeset in the row have been typeset completed, if so, go to step 10), otherwise go to step 4);

10)行中待排版文字之前的文字向下位移;  10) The text before the typesetting text in the row is shifted downward;

11)计算行中待排版文字之后的文字入口横、纵坐标;  11) Calculate the horizontal and vertical coordinates of the text entry after the text to be typeset in the row;

12)排版行中待排版文字之后的文字。  12) The text after the text to be typeset in the typesetting row. the

更进一步,步骤2)和步骤6)中排版一行的具体过程包括以下步骤:  Further, step 2) and step 6) in the specific process of typesetting a line includes the following steps:

①计算该行第一个字的横、纵坐标,排版第一个字;  ①Calculate the horizontal and vertical coordinates of the first character in the line, and typeset the first character; 

②判断该行是否结束,如是则转步骤④,如否则转步骤③;  ②Judge whether the row is over, if yes, go to step ④, otherwise go to step ③; 

③计算该行下一个字的横、纵坐标:横坐标=前一个字横坐标+字宽+字间距,纵坐标与前一个字纵坐标相同,排版该字后转步骤②;  ③Calculate the abscissa and ordinate of the next character in the line: abscissa = abscissa of the previous character + character width + character spacing, the ordinate is the same as the ordinate of the previous character, typesetting the character and then go to step ②; 

④该行排版完成。  ④The typesetting of this line is completed. the

步骤10)中,行中待排版文字之前的文字向下位移的位移量的计算公式为,(所有行的行高之和+所有行之间的行间距之和-所有行之前的文字字高)/2。  In step 10), the formula for calculating the displacement of the text before the text to be typeset in the row is (sum of the row heights of all rows+the sum of the row spacing between all rows-the text height before all rows )/2. the

进一步,步骤(4)中所述的具体排版效果中行中各行文字的对齐方式为左对齐、右对齐、居中对齐或分散对齐。  Further, in the specific typesetting effect described in step (4), the alignment of each line of text in the row is left alignment, right alignment, center alignment or scattered alignment. the

更进一步,实现行中各行文字左对齐的方法是:在小样编辑器中输入待排版文字时,插入的BD排版语言注解为行中注解;在排版时,各行入口纵坐标相同,均为当前纵坐标y;各行出口横坐标为各行排完最后一个字之后得到的下一个字的预排横坐标xn,xn=xn-1+(zk+zj)*mi,x1=x,x为当前横坐标;各行向下位移量dn=dn-1+hj_1+zg_1,d1=0。所述的当前横、纵坐标是指第一 行第一个字的排版区域左上角点坐标;zk为字宽,zj为字间距,hj_1为各行与上一行的行间距,第一行时为0,zg_1为上一行文字的字高,第一行时为0;mi、n为变量,mi表示第i行的字数,n表示行数,n>2;xn-1表示出口横坐标为xn的行的上一行出口横坐标;dn-1表示向下位移量为dn的行的上一行向下位移量。  Furthermore, the method to realize the left alignment of each line of text in the row is: when entering the text to be typeset in the sample editor, the inserted BD typesetting language annotation is the annotation in the line; when typesetting, the vertical coordinates of the entry of each row are the same, which are the current vertical Coordinate y; the abscissa of the exit of each row is the prearranged abscissa x n of the next word obtained after the last word of each row, x n =x n-1 +(zk+zj)*m i , x 1 =x, x is the current abscissa; the downward displacement of each row is d n =d n-1 +hj_1+zg_1, d 1 =0. The current horizontal and vertical coordinates refer to the coordinates of the upper left corner of the typesetting area of the first word in the first line; zk is the word width, zj is the word spacing, hj_1 is the line spacing between each line and the previous line, and the first line is 0, zg_1 is the character height of the previous line, and it is 0 for the first line; m i and n are variables, m i represents the number of words in the i-th line, n represents the number of lines, n>2; x n-1 represents the exit horizontal The abscissa of the exit of the previous line of the line whose coordinate is x n ; d n-1 means the downward displacement of the previous line of the line whose downward displacement is d n .

实现行中各行文字右对齐的方法是:首先实现行中各行文字左对齐,然后计算各行的行宽,将各行文字向右移动,移动的位移量为行中各行中最大行宽减去每一行的行宽。  The method to realize the right alignment of each line of text in the row is: first realize the left alignment of each line of text in the row, then calculate the line width of each line, and move the text of each line to the right, and the displacement amount is the maximum line width of each line in the line minus each line The row width. the

实现行中各行文字居中对齐的方法是:首先实现行中各行文字左对齐,然后计算各行的行宽,将各行文字向右移动,移动的位移量为行中各行中最大行宽减去每一行的行宽后除以2。  The method to realize the center alignment of each line of text in the row is: first realize the left alignment of each line of text in the row, then calculate the line width of each line, and move the text of each line to the right, and the displacement amount is the maximum line width of each line in the line minus each line Divide by 2 after the row width. the

实现行中各行文字分散对齐的方法是:在小样编辑器中输入待排版文字时,插入的BD排版语言注解为行中注解和对齐注解;在排版时,实现行中各行文字左对齐后排版一行文字的过程包括以下步骤:  The method to realize the scattered alignment of text in each line is: when inputting the text to be typeset in the sample editor, the inserted BD typesetting language comment is the comment in the line and the alignment comment; when typesetting, the text in each line in the line is aligned to the left and then typeset a line The writing process includes the following steps:

1)获得对齐字距dzj,计算本行行宽wide和本行出口横坐标Xc,其中,wide=dzj*(zk+zj),Xc=x+wide;x为本行入口横坐标,zk为字宽,zj为字间距;  1) Obtain the alignment kerning dzj, calculate the line width wide of the line and the abscissa Xc of the exit of the line, wherein, wide=dzj*(zk+zj), Xc=x+wide; x is the abscissa of the entrance of the line, and zk is Character width, zj is the character spacing;

2)判断本行是否结束,如是则转步骤3),如否则获取如下参数:zk,zj,计算本行各文字的横坐标;  2) Determine whether the line is over, if so, go to step 3), if not, obtain the following parameters: zk, zj, calculate the abscissa of each character in the line;

3)判断本行是否为单字,如是则单字右移(wide-zk)/2后转步骤7),如否则转步骤4);  3) Judging whether the line is a single character, if so, move the word to the right (wide-zk)/2 and go to step 7), otherwise go to step 4);

4)获得本行字数n;  4) Obtain the number of words in the bank n;

5)第k(1<k<n)字右移k*(wide-n*(zk+zj))/(n-1);  5) The kth (1<k<n) word is shifted to the right by k*(wide-n*(zk+zj))/(n-1);

6)第n字右移:wide-n*zk-(n-1)*zj;  6) Move the nth word to the right: wide-n*zk-(n-1)*zj;

7)一行排版完成。  7) A row of typesetting is completed. the

本发明的效果在于:在小样编辑器中输入行中待排版文字及辅助的排版语言和符号后,通过对行中待排版文字各行以及各行文字的坐标调整能够方便、快捷并精确地实现多行文字行中排版的效果,提高了行中排版的效率。  The effect of the present invention is that after inputting the text to be typeset in the row and the auxiliary typesetting language and symbols in the sample editor, by adjusting the coordinates of each line of the text to be typeset and each line of text in the row, it is convenient, fast and accurate to realize multi-line The effect of in-line typesetting improves the efficiency of in-line typesetting. the

附图说明 Description of drawings

图1是本发明所述方法的流程图;  Fig. 1 is the flowchart of method of the present invention;

图2是本发明具体实施方式中行中待排版文字排版的流程图;  Fig. 2 is the flowchart of text layout to be typesetting in the bank of the embodiment of the present invention;

图3是实施例1中小样编辑器中输入内容示意图;  Fig. 3 is the schematic diagram of input content in sample editor in embodiment 1;

图4是实施例1的效果示意图;  Fig. 4 is the effect schematic diagram of embodiment 1;

图5是实施例2中小样编辑器中输入内容示意图;  Fig. 5 is a schematic diagram of the input content in the sample editor in embodiment 2;

图6是实施例2的效果示意图;  Fig. 6 is the effect schematic diagram of embodiment 2;

图7是实施例3中小样编辑器中输入内容示意图;  Fig. 7 is a schematic diagram of the input content in the sample editor in embodiment 3;

图8是实施例3的效果示意图。  FIG. 8 is a schematic diagram of the effect of Embodiment 3. the

具体实施方式 Detailed ways

如图1所示,一种多行文字行中排版的排版方法,包括以下步骤。  As shown in FIG. 1 , a typesetting method for typesetting in a multi-line text line includes the following steps. the

(1)在小样编辑器中顺序输入待排版文字及符号(见S11);所述的顺序输入是指将行中待排版文字由高行到低行、从左至右依次输入;所述的待排版文字包括行中待排版文字、行中待排版文字之前和之后的文字,以及标点符号;所述的符号是指书版专用字符;不同的行之间以回车键36间隔。  (1) Input the text and symbols to be typeset sequentially in the sample editor (see S11); the sequential input refers to inputting the text to be typeset in the row from high row to low row, and from left to right; The text to be typesetting includes the text to be typesetting in the row, the text before and after the text to be typesetting in the row, and punctuation marks; the

(2)根据用户对排版效果的要求,在小样编辑器中插入BD排版语言注解,依据BD排版语言注解使用规则将行中待排版文字作为一个整体标示出来,生成小样文件(见S12)。所述的BD排版语言注解包括HZ(行中)注解以及可以与HZ注解相配合使用的注解,如HT(汉体)注解51、DQ(对齐)注解71等。所述的行中注解是指开闭弧注解,开弧31标志行中注解状态的开始,闭弧34标志行中注解状态的结束,开弧31与闭弧34之间的文字为行中待排版文字。  (2) Insert the BD typesetting language comment into the sample editor according to the user's requirements for the typesetting effect, mark the text to be typeset in the line as a whole according to the usage rules of the BD typesetting language note, and generate a sample file (see S12). The BD typesetting language annotations include HZ (inline) annotations and annotations that can be used in conjunction with HZ annotations, such as HT (Han Chinese) annotations 51 , DQ (alignment) annotations 71 and so on. The comment in the line refers to the comment of the open and closed arc. The opening arc 31 marks the start of the comment state in the line, and the closed arc 34 marks the end of the comment state in the line. The text between the open arc 31 and the closed arc 34 is the line to be Typographic text. the

(3)解析小样文件中的BD排版语言注解,依据上下文或者用户设置获得行中待排版文字的排版参数,依据该排版参数排版后,生成大样文件(见S13)。  (3) Analyze the BD typesetting language annotation in the sample file, obtain the typesetting parameters of the text to be typeset in the line according to the context or user settings, and generate the large sample file after typesetting according to the typesetting parameters (see S13). the

如图2所示,排版的具体过程包括以下步骤:  As shown in Figure 2, the specific process of typesetting includes the following steps:

1)获取第一行排版参数:包括字高,字宽,字间距,行高,行间距,入口横、纵坐标等(见S201);  1) Obtain the typesetting parameters of the first line: including character height, character width, character spacing, line height, line spacing, horizontal and vertical coordinates of the entry, etc. (see S201);

2)排版第一行(见S202);  2) typeset the first line (see S202);

3)判断第一行是否排版结束(见S203),如是则转步骤4),如否则转步骤2);  3) judge whether the typesetting of the first line is finished (see S203), if so, turn to step 4), otherwise turn to step 2);

4)备份上一行排版参数,获得下一行排版参数(见S204);  4) Back up the typesetting parameters of the previous line to obtain the typesetting parameters of the next line (see S204);

5)计算同行文字向下位移量,及入口横、纵坐标(见S205);  5) Calculate the downward displacement of the text in the same line, and the horizontal and vertical coordinates of the entrance (see S205);

6)排版该行(见S206);  6) typesetting the line (see S206);

7)判断该行是否排版结束(见S207),如是则转步骤8),如否则转步骤6);  7) Judging whether the typesetting of the line is finished (see S207), if so, turn to step 8), otherwise turn to step 6);

8)同行文字向下位移(见S208);  8) The characters in the same line are displaced downwards (see S208);

9)判断是否所有行均排版结束(见S209),如是则转步骤10),如否则转步骤4);  9) Judging whether all rows are typesetting finished (see S209), if so, turn to step 10), otherwise turn to step 4);

10)行中待排版文字之前的文字向下位移(见S210);  10) The text before the typesetting text in the row is displaced downwards (see S210);

11)计算行中待排版文字之后的文字入口横、纵坐标(见S211);  11) Calculate the horizontal and vertical coordinates of the text entry after the text to be typeset in the row (see S211);

12)排版行中待排版文字之后的文字(见S212)。  12) The text after the text to be typeset in the typesetting row (see S212). the

其中,步骤2)和步骤6)中排版的具体过程包括以下步骤:  Wherein, the specific process of typesetting in step 2) and step 6) includes the following steps:

①计算该行第一个字的横、纵坐标,排版第一个字;  ①Calculate the horizontal and vertical coordinates of the first character in the line, and typeset the first character; 

②判断该行是否结束,如是则转步骤④,如否则转步骤③;  ②Judge whether the row is over, if yes, go to step ④, otherwise go to step ③; 

③计算该行下一个字的横、纵坐标:横坐标=前一个字横坐标+字宽+字间距,纵坐标不变,排版该字后转步骤②;  ③Calculate the abscissa and ordinate of the next word in the row: abscissa = abscissa of the previous word+word width+word spacing, the ordinate remains unchanged, typesetting the word and then go to step ②; 

④该行排版完成。  ④The typesetting of this line is completed. the

步骤10)中,行中待排版文字之前的文字向下位移的位移量的计算公式为:(所有行的行高之和+所有行之间的行间距之和-所有行之前的文字字高)/2。  In step 10), the calculation formula for the downward displacement of the text before the typesetting text in the row is: (the sum of the row heights of all rows+the sum of the row spacing between all rows-the text height before all rows )/2. the

(4)大样文件浏览器解析该大样文件,得到具体的排版效果(见S14),其中行中各行文字的对齐方式包括左对齐、右对齐、居中对齐和分散对齐。  (4) The large sample file browser parses the large sample file to obtain a specific typesetting effect (see S14), wherein the alignment methods of each line of text in a row include left alignment, right alignment, center alignment and scattered alignment. the

实施例1  Example 1

以在同一行的“动画片:”和“即将上映”中间排入“《米老鼠与唐老鸭》《铁扇公主》《勇敢的公主希瑞》《海底总动员》”为例对本发明所述方法进行详细的描述。排版后的效果为行中文字的格式与其前后的文字格式相同,对齐方式为左对齐,如图4所示。  Take the "cartoon:" and "coming soon" in the same row to enter "" Mickey Mouse and Donald Duck "," The Iron Fan Princess "," Brave Princess Sherry "" Finding Nemo "" as an example to describe the present invention The method is described in detail. The effect after typesetting is that the format of the text in the line is the same as that of the text before and after it, and the alignment is left-aligned, as shown in Figure 4. the

首先,在小样编辑器中输入行中待排版文字左边的文字“动画片:”,然后按照从高行到低行,从左至右的顺序输入行中待排版文字“《米老鼠与 唐老鸭》《铁扇公主》《勇敢的公主希瑞》《海底总动员》”,不同行之间以回车键间隔,最后输入行中待排版文字后面的文字“即将上映”,同时插入书版专用字符,如图3所示。其中,32为空格字符,33为硬回车字符,35为文件结束符,36为回车键。  First, enter the text "Cartoon:" to the left of the text to be typeset in the row in the sample editor, and then input the text to be typeset in the row ""Mickey Mouse and Tang Lao "Duck", "Princess Iron Fan", "Brave Princess Sherry", "Finding Nemo", different lines are separated by the carriage return key, and finally enter the text "coming soon" after the text to be typeset in the line, and insert it for the book version at the same time characters, as shown in Figure 3. Wherein, 32 is a space character, 33 is a hard return character, 35 is a file end character, and 36 is a carriage return key. the

其次,在小样编辑器输入的行中待排版文字中加入BD排版语言中的HZ注解,依据HZ注解使用规则将行中待排版文字作为一个整体标示出来。所述的HZ注解为开闭弧注解,开弧标志HZ注解状态的开始,闭弧标志HZ注解状态的结束,开弧与闭弧之间的文字为行中待排版文字。本实施例中使用HZ注解标注“《米老鼠与唐老鸭》《铁扇公主》《勇敢的公主希瑞》《海底总动员》”的结果如图3所示。其中,31为开弧,34为闭弧。  Secondly, add the HZ annotation in the BD typesetting language to the text to be typeset in the line input by the sample editor, and mark the text to be typeset in the line as a whole according to the usage rules of the HZ annotation. The HZ annotation is an open and closed arc annotation, an open arc marks the start of the HZ annotation state, and a closed arc marks the end of the HZ annotation state, and the text between the open arc and the closed arc is the text to be typeset in the line. In this embodiment, the result of using HZ annotation to mark ""Mickey Mouse and Donald Duck", "The Iron Fan Princess", "Brave Princess She-Ra", and "Finding Nemo"" is shown in Figure 3 . Among them, 31 is an open arc, and 34 is a closed arc. the

再次,启动小样编辑器中“正文发排”功能,分析小样文件中的HZ注解,根据上文获得排版参数,排版后生成大样文件,排版过程中涉及到的参数及计算公式如下。  Thirdly, start the "text typesetting" function in the sample editor, analyze the HZ annotation in the sample file, obtain the typesetting parameters according to the above, and generate a large sample file after typesetting. The parameters and calculation formulas involved in the typesetting process are as follows. the

(1)根据上文或下文获得字宽zk,字间距zj,字高zg,行高hg,行距hj,当前横坐标x,当前纵坐标y;所述的当前横、纵坐标为第一行第一个字的排版区域左上角的点坐标,本实施例中当前横、纵坐标为“《”左上角点坐标。  (1) Obtain character width zk, character spacing zj, character height zg, line height hg, line spacing hj, current abscissa x, and current ordinate y according to the above or below; the current abscissa and ordinate are the first line The point coordinates of the upper left corner of the typesetting area of the first character, the current horizontal and vertical coordinates in this embodiment are the point coordinates of the upper left corner of "《". the

(2)根据得到的上述参数计算下列参数:  (2) Calculate the following parameters according to the obtained above parameters:

行中待排版文字各行入口横、纵坐标:各行入口横、纵坐标相同,均为当前横、纵坐标x、y。  The horizontal and vertical coordinates of the entry of each row of text to be typeset in the row: the horizontal and vertical coordinates of the entry of each row are the same, and they are the current horizontal and vertical coordinates x and y. the

各行出口横坐标为各行排完最后一个字之后得到的下一个字的预排横坐标xn,xn=xn-1+(zk+zj)*mi,x1=x。各行向下位移量:dn=dn-1+hj_1+zg_1,d1=0。  The abscissa of the exit of each row is the pre-arrangement abscissa x n of the next word obtained after the last word of each row is arranged, x n =x n-1 +(zk+zj)*m i , x 1 =x. The downward displacement amount of each row: d n =d n-1 +hj_1+zg_1, d 1 =0.

行中待排版文字之前的文字(本实施例中为“动画片:”)向下位移的位移量dy=所有行的行高之和+所有行之间的行间距之和-所有行之前的文字字高)/2  The amount of displacement dy=the sum of the row heights of all rows+the sum of the row spacing between all rows of the text before the text to be typeset in the row (in this embodiment, "cartoon: ")-before all rows text height)/2

行中待排版文字之后的文字入口横、纵坐标:Xc=Max(Xn),Yc=y+dy。  The abscissa and ordinate of the text entry after the text to be typeset in the row: Xc=Max(Xn), Yc=y+dy. the

上述的当前横、纵坐标是指第一行第一个字的排版区域左上角点坐标;hj_1为各行与上一行的行间距,第一行时为0,zg_1为上一行文字的字高,第一行时为0;mi、n为变量,mi表示第i行的字数,n表示行数,n>2,1≤i≤n。  The above-mentioned current horizontal and vertical coordinates refer to the coordinates of the upper left corner of the typesetting area of the first character in the first line; hj_1 is the line spacing between each line and the previous line, the first line is 0, zg_1 is the character height of the previous line, The first line is 0; m i and n are variables, m i represents the number of words in the i-th line, n represents the number of lines, n>2, 1≤i≤n.

根据以上排版参数排版小样编辑器中的内容,生成大样文件。  Typesetting the content in the sample editor according to the above typesetting parameters to generate a large sample file. the

最后,大样文件浏览器解析该大样文件,得到具体的排版效果,如图4所示。  Finally, the large sample file browser parses the large sample file to obtain a specific typesetting effect, as shown in Figure 4. the

实施例2  Example 2

与实施例1不同的之处在于:行中待排版文字的排版参数不是根据上下文获得,而是根据用户自定义设置获得,以满足行中待排版文字的格式与其前后的文字格式不同的用户需求。具体实现时,可以在小样编辑器中提供用户自定义设置行中待排版文字排版参数的界面。该界面可以包括设置行中待排版文字的字体、字号、字间距、行间距、对齐方式等参数。  The difference from Embodiment 1 is that the typesetting parameters of the text to be typeset in the row are not obtained according to the context, but are obtained according to the user-defined settings, so as to meet the user needs that the format of the text to be typeset in the row is different from the format of the text before and after it . During specific implementation, an interface for user-defined setting of typesetting parameters of the text to be typeset in the row can be provided in the sample editor. This interface may include setting parameters such as the font, font size, character spacing, line spacing, and alignment of the text to be typeset in the row. the

本实施例获得的排版效果如图6所示,行中排版文字的对齐方式仍为左对齐,但第一行与第二行的文字字号比其前面的文字字号大,因此这两行的排版参数,不能由上下文来获得,可以通过参数设置界面自定义设置字号、字间距、行间距等参数。排版时,根据用户设置的参数来排版。如果用户没有在参数设置界面设置一行的排版参数,则该行的排版参数仍由上下文获得。在小样编辑器中插入的BD排版语言注解包括HZ(行中)和HT(汉体)51注解,如图5所示。  The typesetting effect obtained in this embodiment is shown in Figure 6. The alignment of typesetting text in a row is still left-aligned, but the font size of the text in the first and second lines is larger than the text in front of it, so the typesetting of these two lines Parameters cannot be obtained from the context, and parameters such as font size, word spacing, and line spacing can be customized through the parameter setting interface. When typesetting, the typesetting is done according to the parameters set by the user. If the user does not set the layout parameters of a line in the parameter setting interface, the layout parameters of the line are still obtained from the context. The BD typesetting language annotations inserted in the sample editor include HZ (inline) and HT (Han) 51 annotations, as shown in Figure 5. the

实施例3  Example 3

与实施例1的不同之处在于:获得的排版效果如图8所示,即行中各行文字的对齐方式为分散对齐。在小样编辑器中插入的BD排版语言包括HZ和DQ(对齐)71注解,如图7所示。  The difference from Embodiment 1 is that the typesetting effect obtained is as shown in FIG. 8 , that is, the alignment method of each line of text in a row is scattered alignment. The BD typesetting language inserted in the sample editor includes HZ and DQ (alignment) 71 annotations, as shown in FIG. 7 . the

实现行中各行文字左对齐后,排版一行的过程包括以下步骤:  After realizing the left alignment of each line of text in the line, the process of typesetting a line includes the following steps: 

(1)获得对齐字距dzj,计算本行行宽wide和本行出口横坐标Xc,其中,wide=dzj*(zk+zj),Xc=x+wide;x为本行入口坐标;对齐字距可以在DQ注解中设置,如图7中所示,也可以在参数设置界面设置;  (1) Obtain the alignment word distance dzj, calculate the row width wide of the row and the abscissa Xc of the exit of the row, wherein, wide=dzj*(zk+zj), Xc=x+wide; x is the entry coordinate of the row; alignment character The distance can be set in the DQ annotation, as shown in Figure 7, or it can be set in the parameter setting interface; 

(2)判断本行是否结束,如是则转步骤(3),如否则获取如下参数:字宽zk,字间距zj,计算本行各文字的横坐标;  (2) Determine whether the line is over, if so, go to step (3), otherwise obtain the following parameters: word width zk, word spacing zj, and calculate the abscissa of each character in the line;

(3)判断本行是否为单字,如是则单字右移(wide-zk)/2后转步骤(7),如否则转步骤(4);  (3) Judging whether the bank is a single word, if so, move the word to the right (wide-zk)/2 and then turn to step (7), otherwise turn to step (4);

(4)获得本行字数n;  (4) Obtain the number of words in the bank n;

(5)第k(1<k<n)字右移k*(wide-n*(zk+zj))/(n-1);  (5) The kth (1<k<n) word is shifted to the right by k*(wide-n*(zk+zj))/(n-1);

(6)第n字右移:wide-n*zk-(n-1)*zj;  (6) Move the nth word to the right: wide-n*zk-(n-1)*zj;

(7)一行排版完成。  (7) A row of typesetting is completed. the

实施例4  Example 4

与实施例1不同之处在于:排版效果要求行中待排版文字右对齐。由于现有的BD排版语言中没有能与HZ注解相配合使用的右对齐注解,因此在实施例1的基础上,通过对左对齐的行中待排版文字进行坐标调整,每一行文字向右移动适当的距离,即可实现右对齐的排版效果。右移距离的计算过程是:首先计算出行中待排版文字各行的行宽,选出最大的行宽作为参照,每一行向右移动的位移量等于最大行宽减去每一行的行宽,行宽最大行不移动。  The difference from Embodiment 1 is that the typesetting effect requires that the text to be typeset in the row be right-aligned. Since there is no right-aligned annotation that can be used in conjunction with HZ annotations in the existing BD typesetting language, on the basis of Embodiment 1, by adjusting the coordinates of the text to be typeset in the left-aligned line, each line of text moves to the right Appropriate distance can achieve right-aligned typesetting effect. The calculation process of the right shift distance is: first calculate the line width of each line of the text to be typeset in the line, select the largest line width as a reference, and the displacement of each line to the right is equal to the maximum line width minus the line width of each line, and the line The widest row does not move. the

实施例5  Example 5

与实施例1不同之处在于:排版效果要求行中待排版文字居中对齐。由于现有的BD排版语言中没有能与HZ注解相配合使用的居中对齐注解,因此在实施例1的基础上,通过对左对齐的行中待排版文字进行坐标调整,每一行文字向右移动适当的距离,即可实现右对齐的排版效果。右移距离的计算过程是:首先计算出行中待排版文字各行的行宽,选出最大的行宽作为参照,每一行向右移动的位移量等于最大行宽减去每一行的行宽后再除以2,行宽最大行不移动。  The difference from Embodiment 1 is that the typesetting effect requires that the text to be typeset in the row be centered. Since the existing BD typesetting language does not have a center-aligned annotation that can be used in conjunction with the HZ annotation, on the basis of Embodiment 1, by adjusting the coordinates of the text to be typeset in the left-aligned line, each line of text moves to the right Appropriate distance can achieve right-aligned typesetting effect. The calculation process of the right shift distance is: first calculate the line width of each line of the text to be typeset in the line, select the largest line width as a reference, the displacement of each line to the right is equal to the maximum line width minus the line width of each line, and then Divided by 2, the row with the largest row width does not move. the

本发明所述的方法并不限于具体实施方式中所述的实施例,本领域技术人员根据本发明的技术方案得出其他的实施方式,同样属于本发明的技术创新范围。  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. the

Claims (14)

1.一种多行文字行中排版的方法,包括以下步骤: 1. A method for typesetting in a multi-line text line, comprising the following steps: (1)在小样编辑器中顺序输入待排版文字及符号,不同的行之间以回车键间隔; (1) Enter the text and symbols to be typeset sequentially in the sample editor, and separate lines with the Enter key; (2)根据用户对排版效果的要求,在小样编辑器中插入BD排版语言注解,依据BD排版语言注解使用规则将行中待排版文字作为一个整体标示出来,生成小样文件; (2) According to the user's requirements for typesetting effects, insert BD typesetting language annotations into the sample editor, mark the text to be typeset in the line as a whole according to the usage rules of BD typesetting language annotations, and generate a sample file; (3)解析小样文件中的BD排版语言注解,获得行中待排版文字的排版参数,依据该排版参数排版后,生成大样文件; (3) Analyze the BD typesetting language annotation in the sample file, obtain the typesetting parameters of the text to be typeset in the line, and generate the large sample file after typesetting according to the typesetting parameters; (4)大样文件浏览器解析该大样文件,得到排版效果。 (4) The large sample file browser parses the large sample file to obtain a typesetting effect. 2.如权利要求1所述的一种多行文字行中排版的方法,其特征在于:步骤(1)中所述的顺序输入是指按照从左至右,从高行到低行的顺序依次输入。 2. the method for typesetting in a kind of multi-line text line as claimed in claim 1, is characterized in that: the sequence input described in step (1) refers to according to from left to right, from high line to low line order Enter in sequence. 3.如权利要求1所述的一种多行文字行中排版的方法,其特征在于:步骤(1)中所述的待排版文字包括行中待排版文字、行中待排版文字之前和之后的文字,以及标点符号。 3. the method for typesetting in a kind of multi-line text line as claimed in claim 1, is characterized in that: the text to be typesetting described in the step (1) comprises the text to be typesetting in the row, before and after the text to be typesetting in the row text, and punctuation marks. 4.如权利要求1所述的一种多行文字行中排版的方法,其特征在于:步骤(1)中所述的符号是指书版专用字符,包括空格字符、硬回车字符和文件结束符。 4. the method for typesetting in a kind of multi-line text line as claimed in claim 1, is characterized in that: the symbol described in step (1) refers to the special character of book version, comprises space character, carriage return character and file terminator. 5.如权利要求1所述的一种多行文字行中排版的方法,其特征在于:步骤(2)中所述的BD排版语言注解包括行中注解以及能够与行中注解配合使用的注解,所述的行中注解是指开闭弧注解,开弧标志行中注解状态的开始,闭弧标志行中注解状态的结束,开弧与闭弧之间的文字为行中待排版文字。 5. the method for typesetting in a kind of multi-line text line as claimed in claim 1, is characterized in that: the BD typesetting language annotation described in the step (2) comprises the annotation in the row and the annotation that can cooperate with the annotation in the row , the in-line annotation refers to the open and closed arc annotation, the open arc marks the start of the in-line annotation state, and the closed arc marks the end of the in-line annotation state, and the text between the open arc and the closed arc is the text to be typeset in the line. 6.如权利要求1所述的一种多行文字行中排版的方法,其特征在于:步骤(3)中所述的排版参数是根据上下文获得或者是通过参数设置界面获得。 6. The method for typesetting in a multi-line text line according to claim 1, characterized in that: the typesetting parameters described in step (3) are obtained according to the context or through a parameter setting interface. 7.如权利要求6所述的一种多行文字行中排版的方法,其特征在于:所述的参数设置界面设置在小样编辑器中。 7. The method for typesetting in a multi-line text line according to claim 6, characterized in that: the parameter setting interface is set in the sample editor. 8.如权利要求1所述的一种多行文字行中排版的方法,其特征在于:步骤(3)中,依据排版参数排版的过程包括以下步骤:  8. the method for typesetting in a kind of multi-line text line as claimed in claim 1, is characterized in that: in step (3), according to the process of typesetting parameter typesetting comprises the following steps: 1)获取行中待排版文字第一行排版参数:包括字高,字宽,字间距,行高,行间距,入口横、纵坐标; 1) Obtain the typesetting parameters of the first line of text to be typeset in the line: including character height, character width, character spacing, line height, line spacing, horizontal and vertical coordinates of the entry; 2)排版第一行; 2) typeset the first line; 3)判断第一行是否排版结束,如是则转步骤4),如否则转步骤2); 3) Determine whether the typesetting of the first line is completed, if so, go to step 4), otherwise go to step 2); 4)备份上一行排版参数,获得下一行排版参数; 4) Back up the typesetting parameters of the previous line to obtain the typesetting parameters of the next line; 5)计算该行文字向下位移量,及入口横、纵坐标; 5) Calculate the downward displacement of the line of text, and the horizontal and vertical coordinates of the entry; 6)排版该行; 6) typeset the line; 7)判断该行是否排版结束,如是则转步骤8),如否则转步骤6); 7) Judging whether the typesetting of the row is finished, if so, turn to step 8), otherwise turn to step 6); 8)该行文字向下位移; 8) The line of text is displaced downward; 9)判断行中待排版文字所有行是否均排版结束,如是则转步骤10),如否则转步骤4); 9) Judging whether all the rows of the text to be typeset in the row have been typeset completed, if so, turn to step 10), otherwise turn to step 4); 10)行中待排版文字之前的文字向下位移; 10) The text before the typesetting text in the row is displaced downward; 11)计算行中待排版文字之后的文字入口横、纵坐标; 11) Calculate the horizontal and vertical coordinates of the text entry after the text to be typeset in the row; 12)排版行中待排版文字之后的文字。 12) The text after the text to be typeset in the typesetting line. 9.如权利要求8所述的一种多行文字行中排版的方法,其特征在于:步骤2)和步骤6)中排版一行的具体过程包括以下步骤: 9. the method for typesetting in a kind of multi-line text line as claimed in claim 8, is characterized in that: step 2) and step 6) in the concrete process of typesetting one line comprises the following steps: ①计算该行第一个字的横、纵坐标,排版第一个字; ①Calculate the horizontal and vertical coordinates of the first character in the line, and typeset the first character; ②判断该行是否结束,如是则转步骤④,如否则转步骤③; ②Judge whether the row is over, if yes, go to step ④, otherwise go to step ③; ③计算该行下一个字的横、纵坐标:横坐标=前一个字横坐标+字宽+字间距,纵坐标与前一个字纵坐标相同,排版该字后转步骤②; ③Calculate the abscissa and ordinate of the next word in the line: abscissa=the abscissa of the previous word+word width+word spacing, the ordinate is the same as the ordinate of the previous word, and step ② is turned after the word is typesetting; ④该行排版完成。 ④The typesetting of this line is completed. 10.如权利要求8所述的一种多行文字行中排版的方法,其特征在于,步骤10)中,行中待排版文字之前的文字向下位移的位移量的计算公式为:(所有行的行高之和+所有行之间的行间距之和-所有行之前的文字字高)/2。 10. the method for typesetting in a kind of multi-line text line as claimed in claim 8, it is characterized in that, in step 10), in the row, the computing formula of the displacement amount of the downward displacement of the text before the typesetting text is: (all The sum of the line height of the line + the sum of the line spacing between all lines - the text height before all lines)/2. 11.如权利要求1至10中之一所述的一种多行文字行中排版的方法,其特征在于:步骤(4)中所述的具体排版效果中行中各行文字的对齐方式为左对齐,实现行中各行文字左对齐的方法是:在小样编辑器中输入待排版文字时,插入的BD排版语言注解为行中注解;在排版时,各行入口横、纵坐标相同,均为当前横、纵坐标x、y;各行出口横坐标为各行排完最后一个字之后 得到的下一个字的预排横坐标xn,xn=xn-1+(zk+zj)*mi,x1=x,x为当前横坐标;各行向下位移量dn=dn-1+hj_1+zg_1,d1=0; 11. the method for typesetting in a kind of multi-line text line as described in one of claims 1 to 10, it is characterized in that: the alignment mode of each line of text in the row in the specific typesetting effect described in step (4) is left alignment , the method to realize the left alignment of each line of text in the row is: when entering the text to be typeset in the sample editor, the inserted BD typesetting language annotation is the annotation in the line; , ordinate x, y; the abscissa of the exit of each row is the prearranged abscissa x n of the next word obtained after the last word of each row is arranged, x n = x n-1 +(zk+zj)*m i , x 1 = x, x is the current abscissa; each row's downward displacement d n =d n-1 +hj_1+zg_1, d 1 =0; 所述的当前横、纵坐标是指第一行第一个字的排版区域左上角点坐标;zk为字宽,zj为字间距,hj_1为各行与上一行的行间距,第一行时为0,zg_1为上一行文字的字高,第一行时为0;mi、n为变量,mi表示第i行的字数,n表示行数,n>2;xn-1表示出口横坐标为xn的行的上一行出口横坐标;dn-1表示向下位移量为dn的行的上一行向下位移量。 The current horizontal and vertical coordinates refer to the coordinates of the upper left corner of the typesetting area of the first word in the first line; zk is the word width, zj is the word spacing, hj_1 is the line spacing between each line and the previous line, and the first line is 0, zg_1 is the character height of the previous line, and it is 0 for the first line; m i and n are variables, m i represents the number of words in the i-th line, n represents the number of lines, n>2; x n-1 represents the exit horizontal The abscissa of the exit of the previous line of the line whose coordinate is x n ; d n-1 means the downward displacement of the previous line of the line whose downward displacement is d n . 12.如权利要求1至10中之一所述的一种多行文字行中排版的方法,其特征在于:步骤(4)中所述的具体排版效果中行中各行文字的对齐方式为右对齐,实现行中各行文字右对齐的方法是:首先实现行中各行文字左对齐,然后计算各行的行宽,将各行文字向右移动,移动的位移量为行中各行中最大行宽减去每一行的行宽。 12. The method for typesetting a multi-line text line according to one of claims 1 to 10, characterized in that: the alignment of each line of text in the line in the specific typesetting effect described in step (4) is right alignment , the method to realize the right alignment of each line of text in the row is: first realize the left alignment of each line of text in the row, then calculate the line width of each line, and move each line of text to the right, and the displacement amount is the maximum line width of each line in the line minus each The row width of a row. 13.如权利要求1至10中之一所述的一种多行文字行中排版的方法,其特征在于:步骤(4)中所述的具体排版效果中行中各行文字的对齐方式为居中对齐,实现行中各行文字居中对齐的方法是:首先实现行中各行文字左对齐,然后计算各行的行宽,将各行文字向右移动,移动的位移量为行中各行中最大行宽减去每一行的行宽后除以2。 13. The method for typesetting a multi-line text line according to one of claims 1 to 10, characterized in that: the alignment of each line of text in the line in the specific typesetting effect described in step (4) is center alignment , the method to realize the center alignment of each line of text in the row is: first realize the left alignment of each line of text in the row, then calculate the line width of each line, and move each line of text to the right, and the displacement amount is the maximum line width of each line in the line minus each Divide the width of a row by 2. 14.如权利要求1至10中之一所述的一种多行文字行中排版的方法,其特征在于:步骤(4)中所述的具体排版效果中行中各行文字对齐方式为分散对齐,实现行中各行文字分散对齐的方法是:在小样编辑器中输入待排版文字时,插入的BD排版语言注解为行中注解和对齐注解;在排版时,实现行中各行文字左对齐后排版一行文字的过程包括以下步骤: 14. the method for typesetting in a kind of multi-line text line as described in one of claims 1 to 10, it is characterized in that: in the specific typesetting effect described in the step (4), each line of text alignment in the line is scattered alignment, The method to realize the scattered alignment of text in each line is: when inputting the text to be typeset in the sample editor, the inserted BD typesetting language comment is the comment in the line and the alignment comment; when typesetting, the text in each line in the line is aligned to the left and then typeset a line The text process includes the following steps: 1)获得对齐字距dzj,计算本行行宽wide和本行出口横坐标Xc,其中,wide=dzj*(zk+zj),Xc=x+wide;x为本行入口横坐标,zk为字宽,zj为字间距; 1) Obtain the alignment kerning dzj, calculate the line width wide of the line and the abscissa Xc of the exit of the line, wherein, wide=dzj*(zk+zj), Xc=x+wide; x is the abscissa of the entrance of the line, and zk is Character width, zj is the character spacing; 2)判断本行是否结束,如是则转步骤3),如否则获取如下参数:zk,zj,计算本行各文字的横坐标; 2) Determine whether the line is over, if so, turn to step 3), otherwise obtain the following parameters: zk, zj, calculate the abscissa of each character in the line; 3)判断本行是否为单字,如是则单字右移(wide-zk)/2后转步骤7),如否则转步骤4); 3) Judging whether the bank is a single character, if so, move the character to the right (wide-zk)/2 and turn to step 7), otherwise turn to step 4); 4)获得本行字数n;  4) Obtain the number of words in the bank n; 5)第k(1<k<n)字右移k*(wide-n*(zk+zj))/(n-1); 5) The kth (1<k<n) word is moved to the right by k*(wide-n*(zk+zj))/(n-1); 6)第n字右移:wide-n*zk-(n-1)*zj; 6) Move the nth word to the right: wide-n*zk-(n-1)*zj; 7)一行排版完成。  7) A row of typesetting is completed. the
CN2008101147050A 2008-06-11 2008-06-11 Method for multi-row words layout in row Expired - Fee Related CN101295290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101147050A CN101295290B (en) 2008-06-11 2008-06-11 Method for multi-row words layout in row

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101147050A CN101295290B (en) 2008-06-11 2008-06-11 Method for multi-row words layout in row

Publications (2)

Publication Number Publication Date
CN101295290A CN101295290A (en) 2008-10-29
CN101295290B true CN101295290B (en) 2011-11-09

Family

ID=40065582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101147050A Expired - Fee Related CN101295290B (en) 2008-06-11 2008-06-11 Method for multi-row words layout in row

Country Status (1)

Country Link
CN (1) CN101295290B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526999B (en) * 2008-11-24 2012-05-16 北京大学 Image and character separating and outputting device and method thereof
CN102103593B (en) * 2009-12-18 2012-10-31 北大方正集团有限公司 A typesetting method and system for character stroke splitting
CN103186519B (en) 2011-12-31 2017-04-05 北大方正集团有限公司 Two-way composition method and equipment
CN104516868B (en) * 2013-09-30 2018-03-06 北大方正集团有限公司 The streaming restoring method and system in a kind of space of a whole page space
CN104750671B (en) * 2013-12-25 2019-01-11 北大方正集团有限公司 A kind of two-way typesetting character insertion method and device based on full-page proof inverted sequence
CN104410798B (en) * 2014-11-07 2017-10-27 艾迪普(北京)文化科技股份有限公司 A kind of method and apparatus of character features parameter processing
CN104615340B (en) * 2015-01-23 2019-05-14 深圳市金立通信设备有限公司 A kind of terminal
CN104615693A (en) * 2015-01-23 2015-05-13 深圳市金立通信设备有限公司 Data display method
CN105447181B (en) * 2015-12-15 2020-06-09 中智城信息科技(苏州)有限公司 Material simplified brightness coefficient data organization method for illumination design computing platform
CN114063938B (en) * 2020-07-31 2023-10-27 株式会社理光 Print data processing apparatus, print system, and print data processing method
CN111967228B (en) * 2020-08-18 2024-01-23 刘伟 Editing method and device for joint textbook office mark
CN117994170B (en) * 2024-03-08 2025-03-11 广州大学 A method and system for splicing and restoring shredded paper based on semantic error correction and association

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1387290A2 (en) * 2002-07-23 2004-02-04 Xerox Corporation System and method for constraint-based document generation
CN1908930A (en) * 2006-08-16 2007-02-07 北京北大方正电子有限公司 Method for implementing automatic typesetting based on cloning block
CN1936881A (en) * 2006-10-13 2007-03-28 北京北大方正电子有限公司 Method for aligning unit lattice specific symbol
CN101004736A (en) * 2007-01-25 2007-07-25 北京方正国际软件系统有限公司 Template device of style set for quick formatting layout, and implement method
CN101008938A (en) * 2007-01-25 2007-08-01 北京方正国际软件系统有限公司 Composition data reusing method based on exhale annotation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1387290A2 (en) * 2002-07-23 2004-02-04 Xerox Corporation System and method for constraint-based document generation
CN1908930A (en) * 2006-08-16 2007-02-07 北京北大方正电子有限公司 Method for implementing automatic typesetting based on cloning block
CN1936881A (en) * 2006-10-13 2007-03-28 北京北大方正电子有限公司 Method for aligning unit lattice specific symbol
CN101004736A (en) * 2007-01-25 2007-07-25 北京方正国际软件系统有限公司 Template device of style set for quick formatting layout, and implement method
CN101008938A (en) * 2007-01-25 2007-08-01 北京方正国际软件系统有限公司 Composition data reusing method based on exhale annotation

Also Published As

Publication number Publication date
CN101295290A (en) 2008-10-29

Similar Documents

Publication Publication Date Title
CN101295290B (en) Method for multi-row words layout in row
CN103914443B (en) A kind of mixing method and device of multilingual words
KR101412763B1 (en) Contextual input method
US8994660B2 (en) Text correction processing
US10699072B2 (en) Immersive electronic reading
CN100435139C (en) A Method of Cell Special Symbol Alignment
CN101989256A (en) Typesetting method of document file and device
US20150370340A1 (en) New computer keyboard layout, structure and arrangement
JP2007004633A (en) Language model generation device and language processing device using language model generated by the same
CN101201817A (en) A formula typesetting method
US20040268255A1 (en) Method for aligning text to baseline grids and to CJK character grids
CN102147790A (en) Text typesetting method and typesetting engine
CN109117032A (en) Reading processing method and device based on epub e-book
CN103176956B (en) For the method and apparatus extracting file structure
CN100424683C (en) A Typesetting Method for Monotonous Areas
CN101937429A (en) Page composing method and system for mobile terminal
CN105930415A (en) Support vector machine-based Vietnamese part-of-speech tagging method
CN109801620A (en) The sound control method and speech control system of document software for editing
CN101673406B (en) Method and device for setting font
CN102194243B (en) Method and device for laying out formula
CN100368964C (en) Method for inputting mixed languages in positive and negative order in electronic equipment
CN102855233B (en) For the mixing method and apparatus of spoken and written languages
CN101644958A (en) Method and device for inputting symbol
CN110781678A (en) A Text Representation Method Based on Matrix Form
CN114692566B (en) Fast typesetting method, device and computer readable medium in word processing

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

Granted publication date: 20111109

Termination date: 20170611

CF01 Termination of patent right due to non-payment of annual fee