CN101452445B - Typesetting method and device for text alignment in paragraph - Google Patents

Typesetting method and device for text alignment in paragraph Download PDF

Info

Publication number
CN101452445B
CN101452445B CN2007101789931A CN200710178993A CN101452445B CN 101452445 B CN101452445 B CN 101452445B CN 2007101789931 A CN2007101789931 A CN 2007101789931A CN 200710178993 A CN200710178993 A CN 200710178993A CN 101452445 B CN101452445 B CN 101452445B
Authority
CN
China
Prior art keywords
paragraph
width
literal
zone
type
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
CN2007101789931A
Other languages
Chinese (zh)
Other versions
CN101452445A (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 CN2007101789931A priority Critical patent/CN101452445B/en
Publication of CN101452445A publication Critical patent/CN101452445A/en
Application granted granted Critical
Publication of CN101452445B publication Critical patent/CN101452445B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a typesetting method and a typesetting device for text alignment in a paragraph, which are used for solving the problems of low typesetting efficiency or nonideal adjustment effect in the prior art. The method determines a typesettable area of a row according to an entered tab character and the attribute of the current row in the paragraph, and then typesets characters in the paragraph in the typesettable area. The proposal provided by the invention can improve the efficiency of the typesetting and assure the adjustment effect.

Description

The composition method and the device of text alignment in a kind of paragraph
Technical field
The present invention relates to field of printing and typesetting technology, relate in particular to the composition method and the device of text alignment in a kind of paragraph.
Background technology
Text alignment is meant when print publishing in the paragraph, the literal paragraph that will have clauses and subclauses character is set type with the form of tabulation, the head that the numbering and the title of clauses and subclauses come the paragraph first trip, and the content of clauses and subclauses that after numbering and title, begins to set type, and when wrap text, align with the content reference position automatically.
The method of text alignment mainly contains two kinds in the existing adjustment paragraph, wherein a kind of alignment mark that is to use, and another kind is to use the bullets pattern.
(1) uses alignment mark
This method is according to alignment start mark that inserts at process of typeset and alignment end mark, determines the one layout region of literal in the paragraph.The concrete operations of this scheme are: the literal in predetermined one layout region in the composing paragraph, when running into an alignment start mark, in the composing of subsequent rows, the arranged zone of paragraph literal is the position of this pairing position of alignment start mark to the one layout region end, the paragraph literal is set type in every row of determining can be arranged the zone, when running into an alignment end mark, finish the composing of this alignment form.
This scheme needs operating personnel place that begins in each entry contents that need align when setting type to insert the alignment start mark, inserts the alignment end mark at the end of text place of clauses and subclauses.When number of entries is very big, use the adjusting of aliging of this method, can waste of manpower and time, thus reduce the efficient of setting type.
(2) use the bullets pattern
In this method, aligned position to first trip and non-first trip sets parameter, in use, input relevant parameters value just can realize the alignment of paragraph literal, and the pattern of what a clauses and subclauses is set, other clauses and subclauses can be applied mechanically this pattern, and need not set once more, therefore, the efficiency ratio of this method is higher.But this method only is suitable for having only numbering or the unique situation of clause name, can not single treatment contains the paragraph literal of different clause names.
Above prior art scheme can realize text alignment in the paragraph to a certain extent, though but method 1 can be handled the situation that contains numbering and different titles, but owing to need insert an initial alignment mark and an alignment end mark to each clauses and subclauses, complex operation, waste time and energy, reduced the efficient of setting type; Though and method 2 can improve the efficient of composing, can not handle the different situation of clause name of each paragraph, thereby the unfavorable problem of adjustment effect may occur literal in the paragraph.
Summary of the invention
In view of this, the embodiment of the invention provides the composition method of text alignment in a kind of paragraph, in order to solve the low or unfavorable problem of adjustment effect of the composing efficient that exists in the prior art.
The composition method of text alignment in a kind of paragraph that the embodiment of the invention provides comprises:
A, whether be the corresponding relation of paragraph first trip with corresponding row capable number according to paragraph, determine whether current line to be set type is the paragraph first trip, if, then this row in the arranged zone of Width be from one layout region in the reference position of Width to the end position of described one layout region at Width; Otherwise,
From the literal of this paragraph of having set type, obtain tab character, then this row is to the end position of described one layout region at Width from the position of this character after Width in the arranged zone of Width, wherein said tab character is a character in the described paragraph, imports during literal in this paragraph of typing;
B, described arrange the zone in the composing this paragraph in remaining literal.
A kind of composing device of realizing text alignment in the paragraph that the embodiment of the invention provides comprises:
Can arrange regional acquisition module, be used for when determining current behavior paragraph first trip to be set type, determine the arranged zone of this row at the reference position and the end position of Width at Width according to one layout region; When determining the non-paragraph first trip of current behavior to be set type, from the literal of this paragraph of having set type, obtain tab character, according to described tab character in the position of Width and described one layout region at the end position of Width, determine the arranged zone of this row at Width;
The text composition module is used at the described determined residue literal of arranging in this paragraph of setting type in the zone of regional acquisition module of arranging.
In the embodiment of the invention, when the paragraph words input, whether tab character of input before the literal of needs alignment is the paragraph first trip according to the position and the current line of tab character then, determines the arranged zone of current line, then this can arrange the zone in composing paragraph literal, it is simple to operate to set type, and is applicable to the composing of the clauses and subclauses literal paragraph of any line, thereby, can not only improve the efficient of composing, also can guarantee to adjust effect.
Description of drawings
The process flow diagram of Fig. 1 in the embodiment of the invention passage being set type;
Fig. 2 A is an effect synoptic diagram of realizing text alignment in the embodiment of the invention when comprising the paragraph literal horizontally-arranged of entry number;
Fig. 2 B is an effect synoptic diagram of realizing text alignment in the embodiment of the invention when comprising the paragraph literal vertical setting of types of entry number;
Fig. 3 A is an effect synoptic diagram of realizing text alignment in the embodiment of the invention when comprising the paragraph literal horizontally-arranged of bullets and title;
Fig. 3 B is an effect synoptic diagram of realizing text alignment in the embodiment of the invention when comprising the paragraph literal horizontally-arranged of bullets and title;
Fig. 4 is a kind of structural representation of realizing the composing device of text alignment in the paragraph in the embodiment of the invention.
Embodiment
In the embodiment of the invention, when the paragraph words input, before the literal of needs alignment, import a tab character, when setting type, whether be the corresponding relation of paragraph first trip with current line capable number at first according to current paragraph, judge whether current line is the paragraph first trip, if the first trip of current behavior paragraph, then this row is [X in the arranged zone of Width 0, X m), X wherein 0Be the origin coordinates of the Width of one layout region, X mBe the end coordinate of the Width of one layout region, arrange described that composing comprises the tab character of typing at interior paragraph literal in the zone then; If the non-paragraph first trip of current behavior is then searched tab character C in this paragraph literal of having set type T, obtain the coordinate X of its follow-up Width c, then the arranged zone of this row is [X c, X m), the residue literal in this paragraph of in this can arrange the zone, setting type then.This composition method is simple to operate, can set type to a plurality of clauses and subclauses paragraphs simultaneously, can improve the efficient of setting type.No matter be only numbered clauses and subclauses paragraph literal, still, can adopt this method with the clauses and subclauses paragraph literal of title.
Fig. 1 illustrates and adopts this composition method to the one section paragraph literal of typing tab character concrete scheme process flow diagram of setting type, as shown in Figure 1, mainly may further comprise the steps:
Step 101: whether is the corresponding relation of paragraph first trip according to the row in the current paragraph number with current line, judges whether current line to be set type is the paragraph first trip, if, then continue step 102, otherwise, step 104 entered.
Wherein, number setting when setting type of row in the current paragraph, can be set to 0 by its initial value, if paragraph first trip, row in the then current paragraph number is 0 or 1, the full delegation of the every composing of the literal in this paragraph, and the row in its paragraph number just adds 1 or other fixed value, up to running into a paragraph end mark, the row in the paragraph number is re-set as initial value.
Step 102: the origin coordinates X that obtains the Width of one layout region 0With end coordinate Xm, thereby determine that this row is [X in the arranged zone of Width 0, Xm).
Wherein, when the writing direction of this paragraph literal is a vertical setting of types, then described Width is vertical; When the writing direction of this paragraph literal is a horizontally-arranged, then described Width is horizontal.
Step 103: setting type in this can arrange the zone comprises tab character C TLiteral in this interior paragraph.Tab character C wherein TBeing to establish in advance, can being space character, also can be other character, and this tab character is imported when words input, and its position is before the needs positions aligning.
Step 104: when the non-paragraph first trip of definite current behavior, then search whether there is tab character C at this paragraph Wen Fuzhong that has set type TIf, exist, then continue step 105; Otherwise, this row is considered as the paragraph first trip, enter step 102.
Step 105: obtain the tab character C that is found TSubsequent coordinates X at Width C, and then determine that this row is [X in the arranged zone of Width C, Xm).
Step 106: the remaining literal of not setting type in this paragraph of in this can arrange the zone, setting type.
Step 107: judge whether last character of setting type in current line is the paragraph end mark, if, illustrate that then the composing of current literal paragraph is finished, then enter step 110, otherwise, enter step 108.
Step 108: judge to set type described arrange last character position afterwards in the zone at the coordinate of Width whether less than Xm, if, then row is not full for this row, literal in the current paragraph has been set type and has been finished, enter step 110, otherwise, illustrate that this row sets type, literal in the current paragraph has not also been arranged, and continues step 109.
Step 109: the remaining literal in this paragraph of setting type of the descending continuation in one layout region.
Step 110: finish the composing of literal in this paragraph, the row of current paragraph number is changed to initial value, begin the composing of next paragraph.
Be elaborated with the scheme of concrete example below to the embodiment of the invention.Suppose and will set type the paragraph of following input:
" the benefit of house-purchase in winter
(1) through the development ﹠ construction in early stage, the house in most of winter substantially binds, and is existing apartment.The common people can see the original looks in house.
(2) all can accomplish in the winter time to investigate the most intuitively to dwelling house sunlight, ventilation, insulation, heating problem and construction quality etc.,, have the experience check in winter only, could prove whether very gold of institute house-purchase room for the key factor that these influences are lived.
(3) catch up with and celebrate a festival to the end of the year winter, it is preferential many to buy house.”
Shu Ru tab character C wherein TBe space character, if writing direction is a horizontally-arranged, then Width is laterally, as the indicated direction of arrow among Fig. 2 A, and the zone that rectangle comprised among the figure in its one layout region, then X 0, Xm is this rectangular region origin coordinates and end coordinate in the horizontal, X CBe tab character C TLateral coordinates afterwards, its particular location are as shown in Fig. 2 A, and during composing, first trip is [X in the arranged zone of Width 0, Xm), non-first trip is [X in the arranged zone of Width C, Xm), the literal in above-mentioned each paragraph of in the arranged zone of every row of determining, setting type, last composing effect such as Fig. 2 A.
If writing direction is a vertical setting of types, then Width is vertically, and as the indicated direction of arrow among Fig. 2 B, one layout region is the zone that rectangle comprised among the figure, then X 0, Xm is this rectangular region origin coordinates and end coordinate in the vertical, X CBe tab character C TAlong slope coordinate afterwards, its particular location are as shown in Fig. 2 B, and during composing, first trip is [X in the arranged zone of Width 0, Xm), non-first trip is [X in the arranged zone of Width C, Xm), last composing effect such as Fig. 2 B.
The paragraph literal of Pai Baning also comprises title if desired, and then the aligned position of this paragraph should be in the title back of each paragraph, if will set type to following paragraph literal:
" no matter high-end the ★ outward appearance is, still low side, and the appearance and modeling of car all is the vital factor that attracts clients, the market key of success.
★ brand car is large consumer goods, and brand factor plays very big effect in purchasing process, and several ten thousand yuan of other vehicles of level can not be with tens 2 ten ten thousand ratio brand, but horizontal more still has.”
Wherein, the tab character C of input TStill be space character, if the direction of setting type is laterally, then Width is laterally, as the indicated direction of arrow among Fig. 3 A, and the zone that one layout region comprises for rectangle among Fig. 3 A, then X 0, Xm is this rectangular region origin coordinates and end coordinate in the horizontal, X CBe tab character C TLateral coordinates afterwards, its particular location as shown in Figure 3A, in process of typeset, first trip is [X in the arranged zone of Width 0, Xm), non-first trip is [X in the arranged zone of Width C, Xm), the literal in each the above-mentioned paragraph of in the arranged zone of every row, setting type, last composing effect such as Fig. 3 A.
If vertical the composing, then Width is vertically, as the indicated direction of arrow among Fig. 3 B, X CBe tab character C on this direction TFollow-up coordinate, the zone that one layout region comprises for rectangle among Fig. 3 B, then X 0, Xm the position shown in Fig. 3 B, in process of typeset, first trip is [X in the arranged zone of Width 0, Xm), non-first trip is [X in the arranged zone of Width C, Xm), last composing effect such as Fig. 3 B.
Referring to Fig. 4, a kind of composing device structural representation of realizing text alignment in the paragraph comprises: can arrange regional acquisition module and text composition module in the embodiment of the invention.Wherein, can arrange regional acquisition module, be used for when determining current behavior paragraph first trip to be set type, determine the arranged zone of this row at the reference position and the end position of Width at Width according to one layout region; When determining the non-paragraph first trip of current behavior to be set type, from the literal of this paragraph of having set type, obtain tab character, according to described tab character in the position of Width and described one layout region at the end position of Width, determine the arranged zone of this row at Width; The text composition module is used at the described determined literal of arranging in this paragraph of setting type in the zone of regional acquisition module of arranging.
Further, this composing device also comprises the paragraph judge module, is used for when described text composition module has been set type literal in current line described arranged the zone, judges whether the interior literal of this paragraph sets type to finish.
If described paragraph judge module is determined that the literal in this paragraph has been set type and finished, then finish the composing of this paragraph literal; If described paragraph judge module is determined the literal in this paragraph and is not also had composing to finish, then continues to handle next line.
Further, described paragraph judge module comprises: first judge module and second judge module.Wherein, first judge module is used to judge whether composing is the paragraph end mark at described last character of arranging in the zone; Second judge module, be used for determine setting type when described last character of arranging in the zone is non-paragraph end mark at described first judge module, whether judging sets type arrives the end position of described one layout region at Width in the described position of last character after Width of arranging in regional.
Determine setting type at described last character of arranging in the zone when first judge module is the paragraph end mark, illustrates then that this paragraph literal has been set type to finish; If it is not the paragraph end mark that first judge module is determined to set type at described last character of arranging in the zone, then second judge module judges further whether composing arrives the end position of described one layout region at Width in the described position of last character after Width of arranging in the zone, do not reach the end position of described one layout region if described second judge module determine to be set type in the described position of last character after Width of arranging in the zone, illustrate then that this paragraph literal has also been set type to finish at Width.
The embodiment of the invention is before the literal that the paragraph literal need align, import a tab character, when setting type,, determine the arranged zone of current line according to the position of attribute and this tab character of current line, composing paragraph literal in the arranged zone of this row then, this method promptly can be used for comprising the justify paragraph of entry number, also can be used for comprising the justify paragraph of entry number and title, and uses simple, convenient, thereby improved the efficient of setting type, also guaranteed the effect of setting type simultaneously.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (9)

1. the composition method of the interior text alignment of paragraph is characterized in that, comprising:
A, whether be the corresponding relation of paragraph first trip with corresponding row capable number according to paragraph, determine whether current line to be set type is the paragraph first trip, if, then this row in the arranged zone of Width be from one layout region in the reference position of Width to the end position of described one layout region at Width; Otherwise,
From the literal of this paragraph of having set type, obtain tab character, then this row is to the end position of described one layout region at Width from the position of this character after Width in the arranged zone of Width, wherein said tab character is a character in the described paragraph, imports during literal in this paragraph of typing;
B, arrange the residue literal of composing in this paragraph in the zone described.
2. method according to claim 1 is characterized in that, after described step B, this method further comprises:
C, judge whether literal in this paragraph sets type and finish, if then finish the composing of this paragraph literal; Otherwise, return steps A and continue to handle next line.
3. method according to claim 2 is characterized in that, describedly judges whether literal in this paragraph sets type and finishes, and comprising:
Judge whether set type at described last character of arranging in the zone is the paragraph end mark, if then the literal in this paragraph has been set type and has been finished, otherwise,
Whether judging sets type arrives the end position of described one layout region at Width in the described position of last character after Width of arranging in the zone, if, then the literal in this paragraph has been set type and has been finished, otherwise the literal in this paragraph does not also have composing to finish.
4. method according to claim 2 is characterized in that, described step C further comprises:
When the text composition in determining this paragraph finishes, described paragraph is set to initial value capable number; Otherwise, described paragraph is added a fixed value for capable number.
5. method according to claim 1 is characterized in that, if the writing direction of this paragraph literal is a horizontally-arranged, then described Width is horizontal.
6. method according to claim 1 is characterized in that, if the writing direction of this paragraph literal is a vertical setting of types, then described Width is vertical.
7. a composing device of realizing text alignment in the paragraph is characterized in that, comprising:
Can arrange regional acquisition module, be used for when determining current behavior paragraph first trip to be set type, determine the arranged zone of this row at the reference position and the end position of Width at Width according to one layout region; When determining the non-paragraph first trip of current behavior to be set type, from the literal of this paragraph of having set type, obtain tab character, according to described tab character in the position of Width and described one layout region at the end position of Width, determine the arranged zone of this row at Width;
The text composition module is used at the described determined residue literal of arranging in this paragraph of setting type in the zone of regional acquisition module of arranging.
8. device according to claim 7 is characterized in that, this device further comprises:
The paragraph judge module is used for when described text composition module has been set type literal in current line described arranged the zone, judges whether the interior literal of this paragraph sets type to finish.
9. device according to claim 8 is characterized in that, described paragraph judge module comprises:
First judge module is used to judge whether composing is the paragraph end mark at described last character of arranging in the zone;
Second judge module, be used for determine setting type when described last character of arranging in the zone is non-paragraph end mark at described first judge module, whether judging sets type arrives the end position of described one layout region at Width in the described position of last character after Width of arranging in regional.
CN2007101789931A 2007-12-07 2007-12-07 Typesetting method and device for text alignment in paragraph Expired - Fee Related CN101452445B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101789931A CN101452445B (en) 2007-12-07 2007-12-07 Typesetting method and device for text alignment in paragraph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101789931A CN101452445B (en) 2007-12-07 2007-12-07 Typesetting method and device for text alignment in paragraph

Publications (2)

Publication Number Publication Date
CN101452445A CN101452445A (en) 2009-06-10
CN101452445B true CN101452445B (en) 2010-08-25

Family

ID=40734681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101789931A Expired - Fee Related CN101452445B (en) 2007-12-07 2007-12-07 Typesetting method and device for text alignment in paragraph

Country Status (1)

Country Link
CN (1) CN101452445B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984419B (en) * 2010-10-21 2013-08-28 优视科技有限公司 Method and device for reforming paragraphs of webpage picture content
CN104063364A (en) * 2013-03-19 2014-09-24 福建福昕软件开发股份有限公司北京分公司 PDF document recognition method
CN104572608B (en) * 2013-10-18 2017-12-19 北大方正集团有限公司 The method and apparatus of vertical setting of types Mongolian word
CN104346323B (en) * 2014-11-25 2017-02-22 无锡永中软件有限公司 Collecting and editing processing system and method
CN107391105B (en) * 2017-06-07 2020-11-03 北京五八信息技术有限公司 Text drawing method and device
CN111273836B (en) * 2020-02-13 2021-05-28 潍坊北大青鸟华光照排有限公司 Mongolian vertical scrolling display method on electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5857212A (en) * 1995-07-06 1999-01-05 Sun Microsystems, Inc. System and method for horizontal alignment of tokens in a structural representation program editor
CN1558340A (en) * 2004-02-06 2004-12-29 珠海金山软件股份有限公司 Typesetting method
CN1936881A (en) * 2006-10-13 2007-03-28 北京北大方正电子有限公司 Method for aligning unit lattice specific symbol

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5857212A (en) * 1995-07-06 1999-01-05 Sun Microsystems, Inc. System and method for horizontal alignment of tokens in a structural representation program editor
CN1558340A (en) * 2004-02-06 2004-12-29 珠海金山软件股份有限公司 Typesetting method
CN1936881A (en) * 2006-10-13 2007-03-28 北京北大方正电子有限公司 Method for aligning unit lattice specific symbol

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
US 5857212 A,全文.

Also Published As

Publication number Publication date
CN101452445A (en) 2009-06-10

Similar Documents

Publication Publication Date Title
CN101452445B (en) Typesetting method and device for text alignment in paragraph
CN100435139C (en) Method for aligning unit lattice specific symbol
CN101727461B (en) Method for extracting content of web page
CN102043762B (en) Method and device for comparing layouts
DE60136478D1 (en) CHSTABEN.
CN101876972B (en) Method of automatic alignment of layouts
CN101311922A (en) Advertisement formwork style matching method and system
CN105630817A (en) Electronic invoice content analysis method and system
CN1808421B (en) Typesetting system and method based on electronic sample paper
CN101770446A (en) Method and system for identifying form in layout file
CN101013417B (en) Page setup assisted apparatus and method for changing line-shifted attribute of composition data
CN106845726A (en) A kind of rectangular-shaped piece blanking optimization method concentrated towards clout
CN102129436A (en) Method, system and device for constructing webpage template
CN100447793C (en) Method for extracting page query interface based on character of vision
CN101183372B (en) Style list processing system and method
CN102708163A (en) Highlighted display method for common modules of webpage forum
CN101286146A (en) Typesetting method and system
CN101183358A (en) Typesetting method and apparatus
CN100517299C (en) Typesetting method for implementing multiple alignment in word rows
CN101207742A (en) Method and device for paging of display contents and digital television receiving device
CN101673406A (en) Method and device for setting font
CN102158825A (en) Handwritten multimedia message realization method
CN103186518A (en) Method and system for typesetting of footmark contained documents
CN104331392A (en) Method capable of editing display content in image-text APP (application) in batch
CN103136178A (en) Method and device of splitting table in process of type setting

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: 20100825

Termination date: 20191207

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