CN100580663C - Method and apparatus for automatic typesetting - Google Patents

Method and apparatus for automatic typesetting Download PDF

Info

Publication number
CN100580663C
CN100580663C CN200710178991A CN200710178991A CN100580663C CN 100580663 C CN100580663 C CN 100580663C CN 200710178991 A CN200710178991 A CN 200710178991A CN 200710178991 A CN200710178991 A CN 200710178991A CN 100580663 C CN100580663 C CN 100580663C
Authority
CN
China
Prior art keywords
current line
reference frame
length
border
contraposition
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
CN200710178991A
Other languages
Chinese (zh)
Other versions
CN101256555A (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 CN200710178991A priority Critical patent/CN100580663C/en
Publication of CN101256555A publication Critical patent/CN101256555A/en
Application granted granted Critical
Publication of CN100580663C publication Critical patent/CN100580663C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an automatic layout method for automatic line justification to make printing plate aligning in order and beauty. The method is: confirming position of current line relative to reference system boundary; judging whether or not position of the current line is integral multiple of para position step size, if it is true, it is no need to adjust the current line, otherwise, the current line need to be adjusted to the position to which integral multiple of para position step size corresponds. The invention also discloses a device.

Description

A kind of automatic composing method and device
Technical field
The present invention relates to computing machine and typesetting and printing field, particularly relate to a kind of automatic composing method and device.
Background technology
Inevitably need literal in the typographical printing, the syntagmatic between literal and the literal, between literal and the picture directly affects the visual effect of the space of a whole page.
In the print publishing industry, in order to distinguish different interior some information of perhaps emphasizing, often need change the font size of segment word during composing according to content request, such as article title or subhead, usually than font size commonly used greatly some or smaller, it is straggly each other so just may to produce between the multicolumn of space of a whole page above chapter article or the different article literal, row with capable between can not fitly arrange and influence the attractive in appearance of publication.
At present, after when setting type, changing the font size of segment word, for literal and other text alignment after realizing changing, usually the literal and line-spacing between other related text or the section distance that adopt these font sizes of manual setting to change, whether the back row by the visual determination adjustment aligns with row, if unjustified, then need to adjust once more line-spacing or section distance.
As seen, prior art need adopt the mode of manual setting to set type, and may need to adjust repeatedly, and composing efficient is very low, and it is more to take human resources.
Summary of the invention
The embodiment of the invention provides a kind of automatic composing method and device, is used to realize automatic row alignment, makes space of a whole page marshalling attractive in appearance.
A kind of automatic composing method may further comprise the steps:
Determine the position of current line with respect to the reference frame border;
Whether the position of judging current line is the integral multiple of contraposition step-length, if then do not need to adjust current line, otherwise determine to be no more than the maximum multiple of the contraposition step-length of current line position, according to the composing order, current line is adjusted according to the pairing position of maximum multiple of contraposition step-length; Wherein, described contraposition step-length comprises capable height, perhaps comprises capable height and line space.
A kind of device that is used for automatic typesetting comprises:
Position module is used for determining the position of current line with respect to the reference frame border;
Judge module is used to judge whether the position of current line is the integral multiple of contraposition step-length;
Adjusting module, when being used for being the integral multiple of contraposition step-length in the position of current line, do not adjust current line, and in the position of current line during for the integral multiple of contraposition step-length, determine to be no more than the maximum multiple of the contraposition step-length of current line position, according to the composing order, current line is adjusted according to the pairing position of maximum multiple of contraposition step-length; Wherein, described contraposition step-length comprises capable height, perhaps comprises capable height and line space.
The embodiment of the invention is provided with the desired location of every row in advance according to the acquiescence font size, when the current line of setting type when needs is not inconsistent with desired location, adjust this row automatically, make itself and desired location identical, realize whole literal piece or whole space of a whole page neat appearance, no longer need user's manual setting space of a whole page.
Description of drawings
Figure 1A is the synoptic diagram of type page in the embodiment of the invention;
Figure 1B is the synoptic diagram of embodiment of the invention Chinese block and literal piece background check;
Fig. 2 A is the main method process flow diagram of automatic typesetting in the embodiment of the invention;
Fig. 2 B is by the synoptic diagram after the existing method composing when being reference frame with the type page;
Fig. 3 A is the method flow diagram of automatic typesetting when being reference frame with the type page in the embodiment of the invention;
Fig. 3 B is the synoptic diagram of type page background check in the embodiment of the invention;
Fig. 4 is the synoptic diagram after setting type during for reference frame with the type page in the embodiment of the invention;
The method flow diagram of Fig. 5 automatic typesetting when being reference frame with the literal piece in the embodiment of the invention;
Fig. 6 is by the synoptic diagram after the existing method composing when being reference frame with the literal piece;
Synoptic diagram after Fig. 7 sets type when being reference frame with the literal piece in the embodiment of the invention;
Fig. 8 is for being used for the basic block diagram of the device of automatic typesetting in the embodiment of the invention;
Fig. 9 is for being used for the detailed structure view of the device of automatic typesetting in the embodiment of the invention.
Embodiment
The embodiment of the invention adopts the object of reference of reference frame as layout position, according to unified automatically each row of adjusting of contraposition step-length, makes the space of a whole page neat appearance after the composing.
Type page in the embodiment of the invention is meant that page middle part is used for the part of content typesetting, the zone of drawing a circle to approve referring to black box in the space of a whole page shown in Figure 1A.The row of article is at reading habit, if laterally set type, then row is meant horizontal direction, if vertically set type, then row is meant vertical direction.Current line is meant the row that current needs are set type, and literal can be arranged, and also can not have literal, promptly carries out text composition again behind the position of definite current line.The physical location of mentioning in the embodiment of the invention is for the space of a whole page, if the forward horizontally-arranged, then the upper left corner with the space of a whole page is 0 point, extends downwards to the right respectively; If the forward vertical setting of types, then the upper right corner with type page is 0 point, extends left downwards respectively; If reverse horizontally-arranged, then the upper right corner with the space of a whole page is 0 point, extends downwards left respectively; If reverse vertical setting of types, then the upper left corner with the space of a whole page is 0 point, extends to the right downwards respectively.Be that example describes with the forward horizontally-arranged below.The size of the space of a whole page has been determined (as 210mm * 297mm, i.e. A4 paper, margin is known) can adopt a millimeter equal length unit representation physical location during composing.Definite mode of physical location is not unique, no longer enumerates herein.Literal piece in the embodiment of the invention is meant and is used for the piece that article is set type that shown in Figure 1B, one piece of article can take a plurality of literal pieces, even takies multipage.
Referring to Fig. 2 A, the main method flow process of automatic typesetting is as follows in the present embodiment:
Step 201: determine the row that current needs are set type, and definite current line is with respect to the position on reference frame border.
Step 202: whether the position of judging current line is the integral multiple of contraposition step-length, if then continue step 203, otherwise continue step 204.Present embodiment is that standard is weighed the position with the standard current line with the contraposition step-length, realizes the space of a whole page neat appearance after the automatic typesetting.
Step 203: do not need to adjust current line.
Step 204:, current line is adjusted to the pairing position of integral multiple of contraposition step-length according to the composing order.
Described reference frame can be a type page, also can be meant the literal piece at current line place, and other situations (such as first literal piece of article under the current line) can also be arranged.Be mainly used at many pieces of articles or a plurality of literal piece being arranged in the type page and wishing the situation that all literal of the whole space of a whole page all align as situation with type page with reference to system.Be mainly used in composing at the literal piece with the literal piece as the situation with reference to system, especially literal piece has the situation on a plurality of hurdles, and the article shown in Fig. 2 B " common Baoshang food materials " has comprised two hurdle literal.Two kinds of situations at reference frame are described in detail the method for automatic typesetting respectively below, and are that example describes with the forward horizontally-arranged.
Referring to Fig. 3 A, the concrete grammar flow process of automatic typesetting is as follows when with type page as reference being:
Step 301: determine that according to contraposition reference it is that the contraposition of certain literal piece of reference is set type that needs carry out with the type page, obtain this article block correspondence to bit attribute.Contraposition reference is meant the reference frame when contraposition is set type, and comprises type page and literal piece.If classify according to contraposition reference, contraposition is set type comprises with the type page being that the contraposition of reference is set type and is that the contraposition of reference is set type with the literal piece.
Wherein, the contraposition attribute comprises the reference point Y0 of the contraposition composing type and the reference frame of literal piece.Contraposition composing type comprises not contraposition, contraposition and the first contraposition of section line by line.Not contraposition is meant that all provisional capitals in the literal piece adopt common composition method, promptly adopts the type-setting mode of prior art; Contraposition is meant the position of all provisional capital alignment expections of literal piece line by line; The first contraposition of section is meant every section first row alignment desired location in the literal piece.Can increase other alignment thereof according to actual needs, as choosing a few row or a few sections by mouse, for selected row or section are set a kind of to bit attribute.Below being that example describes to the contraposition line by line in the bit attribute.
Step 302: the definite contraposition step-length Step that needs and the physical location Y0 of type page top margin, referring to the type page background check shown in Fig. 3 B, the position of row is the desired location that contraposition is set type in this background check.Step is relevant with font size, refers to type page acquiescence font size in the present embodiment, and height at once is if consider that line space, Step comprise capable height and line space.
Step 303: the physical location Y1 that determines current line.
Step 304: whether judge current line in desired location, judge promptly whether the result of Y1-Y0 is the integral multiple of Step, expression formula such as Y1-Y0=N * Step+y, N are positive integer, and 0≤y<Step is if y=0 then continues step 305, if step 306 is then continued in y ≠ 0.This desired location is meant: the top margin with type page is a benchmark, and the coboundary of every row in the type page (being each Step) is shown in Fig. 3 B.
Because physical location is for the space of a whole page,,, can judge directly then whether Y1 is the integral multiple of Step if physical location is to decide with respect to type page so need to determine the result of Y1-Y0.
Step 305: current line is in desired location, so do not need to adjust current line.Continue step 307.
Step 306: current line so need to adjust current line, is then adjusted to current line the position of next Step, expression formula such as Y1=(N+1) * Step+Y0 not in desired location.
Step 307: begin to set type row delegation from Y1.Upgrade the value of Y1 according to the composing result.Capable height+the line-spacing of Y1=Y1+.This row is high relevant with the font size of article, if the acquiescence font size of the font size of article and type page is inconsistent, then follow-up every provisional capital may need to adjust.
Step 308: because contraposition composing type is contraposition line by line, so the operation that need adjust line by line and set type, judge whether this article block sets type and finish, judge whether that promptly literal does not enter the literal piece in addition, perhaps whether also have the zone can supply to set type in the literal piece, above-mentioned two any one establishments of condition then continue step 303, otherwise process ends.
Three pieces of articles shown in Fig. 2 B, the title of every piece of article has all adopted special effect treatment, also has subhead in the part article, adopts common composition method, and the literal in the different articles can not complete matching, influences the attractive in appearance of article.Referring to shown in Figure 4, after the method that adopts present embodiment to describe was adjusted the article composing flow process among Fig. 2 B, each article content is marshalling, has realized expected effect.Present embodiment is that current line is adjusted backward realizing that contraposition sets type, but scheme is not limited thereto, so present embodiment increases precision delta, 0<delta<Step.When the y in the step 304 ≠ 0, whether further judge y greater than delta, if greater than delta, then continue step 306, otherwise be adjusted into Y1=N * Step+Y0, avoided occurring on the space of a whole page too much null.
Present embodiment is to be the implementation procedure that example is described with contraposition composing type for contraposition line by line, if the first contraposition of contraposition composing type be section, then only needs first of every section in article to go the employing present embodiment, and other row can adopt the mode of prior art to set type.
Referring to Fig. 5, the concrete grammar flow process of automatic typesetting is as follows when with the literal piece as reference being:
Step 501: determine that according to contraposition reference it is that the contraposition of reference is set type that needs carry out with the literal piece, obtain this article block correspondence to bit attribute.Adopt the literal piece composing effect of common composition method only to have arranged a literal piece in the type page wherein referring to shown in Figure 6.
Step 502: the definite contraposition step-length Step that needs and the physical location Y2 of current literal piece top margin, referring to the literal piece background check shown in Figure 1B.Step refers to the height and the line-spacing sum of this article block acquiescence font size in the present embodiment.
Step 503: the physical location Y1 that determines the current line top margin.
Step 504: whether judge current line in desired location, judge promptly whether Y1-Y2 is the integral multiple of Step, expression formula such as Y1-Y2=N * Step+y are if y=0 then continues step 505, if step 506 is then continued in y ≠ 0.
Step 505: current line is in desired location, so do not need to adjust current line.Continue step 507.
Step 506: current line so need to adjust current line, is then adjusted to current line the position of next Step, expression formula such as Y1=(N+1) Step+Y2 not in desired location.
Step 507: begin to set type row delegation from Y1.Upgrade the value of Y1 according to the composing result.Capable height+the line-spacing of Y1=Y1+.
Step 508: because contraposition composing type is contraposition line by line, the operation of contraposition so need set type line by line, judge whether this article block sets type and finish, judge whether that promptly literal does not enter the literal piece in addition, perhaps whether also have the zone can supply version in the literal piece, above-mentioned two any one establishments of condition then continue step 503, otherwise process ends.
As shown in Figure 6, only arranged a literal piece in the type page, this article block comprises three hurdles, the font size of each title is more bigger than the font size of text, the uneven phenomenon of character arranging in the different hurdles can appear according to the type-setting mode of prior art, two row as horizontal line among Fig. 6 indicates influence the attractive in appearance of publication.Referring to shown in Figure 7, after the method that adopts present embodiment to describe was set type to Fig. 6 Chinese block, literal piece content is marshalling.Y is further judged greater than delta in y ≠ 0 of present embodiment in step 504 o'clock whether, if greater than delta, then continues step 506, otherwise is adjusted into Y1=N * Step+Y2, has avoided occurring on the space of a whole page too much null.
The method of automatic typesetting when the foregoing description is described the forward horizontally-arranged in detail, similar when method when setting type and forward horizontally-arranged by other writing directions, only need the border of reference frame is made as the corresponding edge dividing value, earlier determine that according to contraposition reference reference frame is type page or literal piece, oppositely horizontally-arranged is got the reference frame coboundary, the forward vertical setting of types is got the reference frame right margin, and oppositely vertical setting of types is got the reference frame left margin.The process of automatic typesetting can not repeat them here referring to above-mentioned realization flow.
Referring to Fig. 8, the device that is used for automatic typesetting in the present embodiment comprises position module 801, judge module 802 and adjusting module 803.This device can specifically be a kind of plug-in unit or software module etc.
Position module 801 is used for determining to bit attribute, and determines reference frame according to contraposition reference, and determines that further current line is with respect to the position on reference frame border etc.When described reference was type page, the reference frame border was the type page border, and current line is the physical location of self and the difference of the physical location on type page border with respect to the position on reference frame border.When described reference was the literal piece at current line place, the reference frame border was meant the border of described literal piece, and current line is the physical location of self and the difference of the physical location of described literal block boundary with respect to the position on reference frame border.
Judge module 802 is used to judge whether the position of current line is the integral multiple of contraposition step-length, when being not integral multiple, can judge further that whether the part that exceeds integral multiple is greater than default precision.
When adjusting module 803 is used for being the integral multiple of contraposition step-length in the position of current line, do not adjust current line, and during for the integral multiple of contraposition step-length, current line is adjusted to the pairing position of integral multiple of contraposition step-length in the position of current line.
The device that is used for automatic typesetting can also comprise the type-setting module 806 that is used to set type, type-setting module 806 begins to set type according to adjusting module 803 adjusted current line positions, after delegation sets type end, the physical location Y1 of next line (i.e. the current line of setting type next time) is sent to position module 801, perhaps notify position module 801 to measure the physical location of next line.
And, the device that is used for automatic typesetting can comprise the interface module 804 that is used to receive the article of needs composing and outwards exports the space of a whole page after setting type, and can comprise be used to store the article and the space of a whole page etc. the memory module 805 of information, concrete structure can be referring to shown in Figure 9.This memory module 805 comprises buffer memory, hard disk, CD and flash memory etc.
Be used to realize that the software of the embodiment of the invention can be stored in storage mediums such as floppy disk, hard disk, CD and flash memory.
The embodiment of the invention is provided with the desired location of every row in advance according to the acquiescence font size, when the current line of setting type when needs is not inconsistent with desired location, adjust this row automatically, make itself and desired location identical, realize whole literal piece or whole space of a whole page neat appearance, no longer need user's manual setting space of a whole page.And the embodiment of the invention is by satisfying user's multiple contraposition composing demand to the selection of bit attribute, and these contraposition type-setting modes all can be realized automatically.The embodiment of the invention adopts precision to control and finely tunes and optimize the effect that contraposition is set type when satisfying user's aesthetic requirement.
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, a kind of automatic composing method is characterized in that, may further comprise the steps:
Determine the position of current line with respect to the reference frame border;
Whether the position of judging current line is the integral multiple of contraposition step-length, if then do not need to adjust current line, otherwise determine to be no more than the maximum multiple of the contraposition step-length of current line position, according to the composing order, current line is adjusted according to the pairing position of maximum multiple of contraposition step-length; Wherein, described contraposition step-length comprises capable height, perhaps comprises capable height and line space.
2, automatic composing method as claimed in claim 1 is characterized in that, described reference frame is meant type page, and then the reference frame border is meant the type page border; Current line is the physical location of self and the difference on corresponding type page border with respect to the position on reference frame border.
3, automatic composing method as claimed in claim 1 is characterized in that, described reference frame is meant the literal piece at current line place, and then the reference frame border is meant the border of described literal piece; Current line is the physical location of self and the difference of the physical location of described literal block boundary with respect to the position on reference frame border.
4, automatic composing method as claimed in claim 1 is characterized in that, when laterally setting type, described reference frame border is the coboundary of reference frame; When writing direction was the forward vertical setting of types, described reference frame border was the right margin of reference frame; When writing direction was reverse vertical setting of types, described reference frame border was the left margin of reference frame.
5, as each described automatic composing method in the claim 1 to 4, it is characterized in that, after the position of determining current line is not for the integral multiple of contraposition step-length, the difference of the position of further definite current line and the integral multiple of contraposition step-length, and when determining this difference, adjust current line backward greater than default precision, when being not more than default precision, definite this difference adjusts current line forward; Wherein, this default precision is greater than 0 and less than the contraposition step-length.
6, a kind of device that is used for automatic typesetting is characterized in that, comprising:
Position module is used for determining the position of current line with respect to the reference frame border;
Judge module is used to judge whether the position of current line is the integral multiple of contraposition step-length;
Adjusting module, when being used for being the integral multiple of contraposition step-length in the position of current line, do not adjust current line, and in the position of current line during for the integral multiple of contraposition step-length, determine to be no more than the maximum multiple of the contraposition step-length of current line position, according to the composing order, current line is adjusted according to the pairing position of maximum multiple of contraposition step-length; Wherein, described contraposition step-length comprises capable height, perhaps comprises capable height and line space.
7, the device that is used for automatic typesetting as claimed in claim 6 is characterized in that, described reference frame is meant type page, and then the reference frame border is meant the type page border; Current line is the physical location of self and the difference on corresponding type page border with respect to the position on reference frame border.
8, the device that is used for automatic typesetting as claimed in claim 6 is characterized in that, described reference frame is meant the literal piece at current line place, and then the reference frame border is meant the border of described literal piece; Current line is the physical location of self and the difference of the physical location of described literal block boundary with respect to the position on reference frame border.
9, as each described device that is used for automatic typesetting in the claim 6 to 8, it is characterized in that, described judge module also is used for after the position of determining current line is not for the integral multiple of contraposition step-length, the difference of the position of further definite current line and the integral multiple of contraposition step-length, and when determining this difference, adjust current line backward greater than default precision, when being not more than default precision, definite this difference adjusts current line forward; Wherein, this default precision is greater than 0 and less than the contraposition step-length.
CN200710178991A 2007-12-07 2007-12-07 Method and apparatus for automatic typesetting Expired - Fee Related CN100580663C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710178991A CN100580663C (en) 2007-12-07 2007-12-07 Method and apparatus for automatic typesetting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710178991A CN100580663C (en) 2007-12-07 2007-12-07 Method and apparatus for automatic typesetting

Publications (2)

Publication Number Publication Date
CN101256555A CN101256555A (en) 2008-09-03
CN100580663C true CN100580663C (en) 2010-01-13

Family

ID=39891387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710178991A Expired - Fee Related CN100580663C (en) 2007-12-07 2007-12-07 Method and apparatus for automatic typesetting

Country Status (1)

Country Link
CN (1) CN100580663C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876973B (en) * 2009-04-30 2012-05-30 方正国际软件(北京)有限公司 Layout equalization typesetting method
CN102110085A (en) * 2009-12-29 2011-06-29 北京大学 Automatic typesetting method and system based on dependency relationship of typesetting objects

Also Published As

Publication number Publication date
CN101256555A (en) 2008-09-03

Similar Documents

Publication Publication Date Title
CN101876967B (en) Method for generating PDF text paragraphs
US20060256116A1 (en) Method and system of character placement in opentype fonts
US8171401B2 (en) Resizing an editable area in a web page
CN102779118B (en) Paper typesetting method and system
US20090327875A1 (en) Design editing apparatus, design editing method, and storage medium storing design editing program
US20140115432A1 (en) Techniques for typographic electronic pagination
US20080024502A1 (en) Document editing device, program, and storage medium
JP2018533782A5 (en)
CN1936882A (en) Paging form data-processing method and system
JPH10289230A (en) Automatic layout of contents in page composition
CN1975712A (en) Method for changing literal to curved line
EP3602331B1 (en) Electronic text pen systems and methods
CN101013417B (en) Page setup assisted apparatus and method for changing line-shifted attribute of composition data
CN100589097C (en) A kind of character typesetting method along curves
CN100580663C (en) Method and apparatus for automatic typesetting
CN101183358A (en) Typesetting method and apparatus
CN100517299C (en) Typesetting method for implementing multiple alignment in word rows
CN102033855B (en) Method and system for typesetting characters of various fonts and same code value
CN101286146A (en) Typesetting method and system
CN102509125A (en) Method for automatically modifying a graphics feature to comply with a resolution limit
CN101419591B (en) Typesetting method and device
US20150278163A1 (en) Image processing apparatus, image processing method, and storage medium that stores program
CN105677262A (en) Typesetting method and device for banner printing
EP3422174B1 (en) Display control apparatus, printing apparatus, control method of display control apparatus, and program therefor
KR101999549B1 (en) Cell auto divide device

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

Termination date: 20191207