CN101770452B - Method for automatic typesetting of content blocks - Google Patents

Method for automatic typesetting of content blocks Download PDF

Info

Publication number
CN101770452B
CN101770452B CN2009101559036A CN200910155903A CN101770452B CN 101770452 B CN101770452 B CN 101770452B CN 2009101559036 A CN2009101559036 A CN 2009101559036A CN 200910155903 A CN200910155903 A CN 200910155903A CN 101770452 B CN101770452 B CN 101770452B
Authority
CN
China
Prior art keywords
layout
layout areas
areas
current
width
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
CN2009101559036A
Other languages
Chinese (zh)
Other versions
CN101770452A (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.)
AODAA NETWORK (HANGZHOU) Co Ltd
Original Assignee
AODAA NETWORK (HANGZHOU) 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 AODAA NETWORK (HANGZHOU) Co Ltd filed Critical AODAA NETWORK (HANGZHOU) Co Ltd
Priority to CN2009101559036A priority Critical patent/CN101770452B/en
Publication of CN101770452A publication Critical patent/CN101770452A/en
Application granted granted Critical
Publication of CN101770452B publication Critical patent/CN101770452B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention provides a method for automatic typesetting of content blocks. The steps of the method are as follows: (1) extracting layout information: according to a typeset layout which comprises the content blocks with rectangular boundaries, relationship information among the content blocks is recorded in each divided process, including a parent-child relationship between a layout region and a secondary layout region, a context relationship between the layout regions, and the size of each layout region; the content blocks are the smallest layout regions, and blanks are the content blocks without contents; (2) using the layout information for layout: the layout information of the layout regions is converted into position information of the content blocks; (3) when the contents of the content blocks are changed, the automatic typesetting is carried out according to the layout information defined in step (2). The method in the invention can automatically complete editing and typesetting, which greatly improves the typesetting efficiency.

Description

A kind of method of content blocks automatic typesetting
Technical field
The present invention relates to the computer composition field, especially a kind of method of using spatial layout feature that variable content is set type.
Background technology
Appear in the application in various computing machine contents, often need make up the situation of composing, for example, set type before the seal of magazine, newpapers and periodicals for the content blocks of some variable content, the electronic multimedia reading matter, webpage, or the like.After the board-like decision of setting type, the meeting of the position of content blocks is owing to the variation of following two factors is adjusted:
1. the content of content blocks changes, and causes the content blocks size to change, and then influences the position of content blocks self and peripheral contents piece.
2. the size of whole one layout region changes, and will cause the size of the corresponding adjustment of some content blocks needs self.
For example, in Fig. 1, in the format of one two row, when the content of the first content piece of first row increased, the follow-up piece of first row need move down, but any variation does not take place in the position of the content blocks of secondary series.
Therefore, autoplacement must obtain the related information between each content blocks, and guaranteeing has enough information to come logical adjustment is carried out in the position of layout piece when these changes take place.
At present; In the existing content blocks automatic composing method; These related informations are provided by composing person; Composing person must specify each content blocks layout structure characteristic information in the format, the method among typical method such as HTML and the CSS to the automatic typesetting of content blocks, and they need composing person come defined feature information through special-purpose layout description language.Though this mode can accurately be described the layout related information, owing to need composing person to import by hand/the layout structure characteristic information of specified layout piece, cause this type of automatic composing method to be used by the professional, the composing work efficiency is not high.
Summary of the invention
For big, the ineffective deficiency of setting type of edit, composing difficulty that overcomes existing content blocks automatic composing method, the method that the present invention provides a kind of automatic editor, sets type and accomplish automatically, improve the content blocks automatic typesetting of composing work efficiency greatly.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of method of content blocks automatic typesetting, the method for said automatic typesetting may further comprise the steps:
(1), extract layout information:
According to the typesetted space of a whole page, the said space of a whole page includes the content blocks of square boundary, and content blocks is minimum layout areas, and wherein, blank also is sleazy content blocks;
Layout areas refinement partition process is following:
1.1) if current layout areas is the layout areas of a blank, then need not refinement again and divide, finish to divide flow process;
1.2) if current layout areas has only a content blocks, it is exactly minimum layout areas, also need not refinement again and divides, and finishes to divide flow process;
1.3) find out can not with any one content blocks in the layout areas in have intersection point, and the lines that can laterally divide current layout areas are from left to right laterally divided secondary layout areas;
1.4) if can not laterally divide, then find out the lines that can vertically divide layout areas from top to bottom, vertically divided secondary layout areas;
1.5) if horizontal secondary layout areas or vertical secondary layout areas are single content blocks, then need not to divide again this secondary layout areas; If the horizontal secondary layout areas or the vertical secondary layout areas that divide still comprise a plurality of content blocks, then need again according to 1.1) to 1.4) step divide, till obtaining minimum layout areas;
In each flow process of dividing, the following related information between the recorded content piece: the context up and down between set membership, layout areas and the layout areas of generation layout areas and secondary layout areas and the size of each layout areas;
(2), use the layout information layout: convert the layout information of layout areas the positional information of content blocks to, the target area is meant and is used for layout areas is carried out again the rectangular area that comprises suggested position and size of layout; Top target area is to be used for the target area of the top layout areas of layout again; Specific as follows:
2.1), when layout areas is the layout areas of a blank,
1. its layout dimension in top target area is exactly its physical size.
2. in horizontal and vertical layout areas, the target area size of blank content blocks is exactly its original size.
2.2) if layout areas is single content blocks, when carrying out layout in the target area, the left margin of content blocks and coboundary would be the left margin and the coboundary of layout areas always, the physical size of target area is for carrying out the content blocks physical size after the layout to content blocks;
2.3) if layout areas comprises a plurality of horizontal secondary layout areas, carry out according to following steps:
2.3.1), all secondary layout areas are carried out pre-layout;
2.3.2), the height of secondary layout areas in the unified goal zone: if the true altitude of the secondary layout areas in the target area is not exclusively the same, then need adjust the height of secondary layout areas; Find out the highest secondary layout areas of true altitude earlier; Then, the secondary layout areas to other carries out layout again;
2.3.3) the regional physical size of calculating current goal;
2.4) if layout areas comprises a plurality of vertical secondary layout areas, carry out according to following steps:
2.4.1), all secondary layout areas are carried out pre-layout;
2.4.2), the width of secondary layout areas in the unified goal zone: if the developed width of the secondary layout areas in the target area is not exclusively the same, then need adjust the width of secondary layout areas; Find out the maximum secondary layout areas of developed width earlier.Then, the secondary layout areas to other carries out layout again;
2.4.3) the regional physical size of calculating current goal;
(3), when the content of content blocks changes, carry out automatic typesetting according to the layout information of step (2) definition.
Further, in the said step (1), layout areas refinement partition process also comprises: 1.6) but can not carry out horizontal and vertical division if current layout areas has comprised a plurality of content plates, then be classified as special circumstances;
Said step (2) also comprises 2.5) if layout areas is special layout areas, to the convergent-divergent that carries out of content blocks; Convergent-divergent to content blocks carries out through the target area of calculating each content blocks.
Further again, said step 2.2) in, when the suggestion size of decision content blocks layout, then can produce four kinds of situation:
1. during the limit for width limit for height, the physical size of target area is exactly to after the content block layout, the physical size that obtains
2. during limit for height, under the situation that limits width, the height of a given suggestion is not zero to limit for width, and the true altitude of target area is to after the content block layout, the true altitude that obtains
3. during limit for width, under the situation of constrain height, the width of a given suggestion is not zero to limit for height; The developed width of target area is exactly to after the content block layout, the developed width that obtains
4. limit for height is not during limit for width, and in the target area, the height of a given suggestion and width all are zero; The developed width of target area with highly be exactly to after the content block layout, the developed width that obtains and highly.
Further, said step 2.3.1) in, the process of all secondary layout areas being carried out pre-layout is:
If a. layout areas is a limit for width
1. find out the wideest secondary layout areas earlier
2. the secondary layout areas (if any) to this layout areas left side carries out layout by order from left to right, and the target area during first secondary layout areas layout is:
1) left margin is the left margin in current goal zone
1) coboundary is the coboundary in current goal zone
1) width is the size of first secondary layout areas
1) highly is the size of current layout areas
Target area during follow-up secondary layout areas layout is:
● left margin is the actual right margin after last layout areas layout is accomplished
● the coboundary is the coboundary in current goal zone
● width is the size of current secondary layout areas
● highly be the size of current layout areas
3., carry out layout by order from right to left if the secondary layout areas to this layout areas right side is arranged;
Target area during first secondary layout areas layout is:
● left margin is the size that the right margin in current goal zone deducts first secondary layout areas
● the coboundary is the coboundary in current goal zone
● width is the size of first secondary layout areas
● highly be the size of current layout areas
Target area during follow-up secondary layout areas layout is:
● left margin is the size that the actual left margin after last layout areas layout is accomplished deducts current secondary layout areas
● the coboundary is the coboundary in current goal zone
● width is the size of current secondary layout areas
● highly be the size of current layout areas
After each secondary layout areas on right side carried out layout, if secondary layout areas developed width is inconsistent with in advance given width, then need carry out layout again to this secondary layout areas, the target area of layout is:
● left margin is the developed width that the actual left margin after last layout areas layout is accomplished deducts current secondary layout areas
● the coboundary is constant, or the coboundary in current goal zone
● width is the developed width of current secondary layout areas
● highly be the developed width of current layout areas
4. the wideest layout areas of width is carried out layout, the target area is:
● left margin is the actual right margin after the secondary layout areas layout in left side is accomplished, if there is not the secondary layout areas in left side, then is the left margin of current layout areas
● the coboundary is the coboundary in current goal zone
● width is the actual left margin (if any, if not then be the right margin of current layout areas) after the secondary layout areas layout in right side is accomplished and current secondary layout areas left margin is poor.
● highly be the size of current layout areas
B. if limit for width not, according under the limit for width condition, the wideest secondary layout areas left side layout type from left to right being carried out layout one by one to all secondary layout areas.
Said step 2.3.2) in, the packing objective zone that other secondary layout areas carries out again layout is:
● left margin, the coboundary, width is the same with the actual value of phase one;
● highly be the true altitude of the highest secondary layout areas of reality.
Further, said step 2.4.1) in, the process of all secondary layout areas being carried out pre-layout is:
If a. layout areas is a limit for height
A.1) find out the highest secondary layout areas earlier
A.2) the secondary layout areas (if any) to this layout areas upside carries out layout by order from the top down, and the target area during first secondary layout areas layout is:
1) coboundary is the coboundary in current goal zone
1) left margin is the left margin in current goal zone
1) highly is the height dimension of first secondary layout areas
1) width is the width dimensions of current layout areas
Target area during follow-up secondary layout areas layout is:
● the coboundary is the actual lower boundary after last layout areas layout is accomplished
● left margin is the left margin in current goal zone
● highly be the height dimension of current secondary layout areas
● width is the width dimensions of current layout areas
A.3) if the secondary layout areas to the narrow side of this layout areas is arranged, carry out layout by order from bottom to top
Target area during first secondary layout areas layout is:
● the coboundary is the size that the lower boundary in current goal zone deducts first secondary layout areas
● left margin is the left margin in current goal zone
● highly be the height dimension of first secondary layout areas
● width is the width dimensions of current layout areas
Target area during follow-up secondary layout areas layout is:
● the coboundary is the size that the in fact border after last layout areas layout is accomplished deducts current secondary layout areas
● left margin is the left margin in current goal zone
● highly be the height dimension of current secondary layout areas
● width is the width dimensions of current layout areas
After each secondary layout areas of downside carried out layout, if secondary layout areas true altitude is inconsistent with in advance given height, then need carry out layout again to this secondary layout areas, the target area of layout is:
● the coboundary is the developed width that the in fact border after last layout areas layout is accomplished deducts current secondary layout areas
● left margin is constant, or the left margin in current goal zone
● highly be the true altitude of current secondary layout areas
● width is the true altitude of current layout areas
A.4) highly the highest layout areas is carried out layout, the target area is:
● the coboundary is the actual lower boundary after the secondary layout areas layout of upside is accomplished, if there is not the secondary layout areas of upside, then is the coboundary of current layout areas
● left margin is the left margin in current goal zone
● highly be in fact border and current secondary layout areas coboundary poor after the secondary layout areas layout of downside is accomplished
● width is the width dimensions of current layout areas
B is if non-limit for height, according under the limit for height condition, the highest secondary layout areas upside layout type from the top down being carried out layout one by one to all secondary layout areas.
Said step 2.4.2) in, the packing objective zone that other secondary layout areas carries out again layout is:
1. coboundary, left margin, height is the same with the actual value of phase one;
2. width is the developed width of the wideest secondary layout areas of reality.
Said step 2.5) in, in the target area, carry out layout and can divide following four kinds of situation: 1. if the wide layout areas of limit for height not, in the target area:
Left margin=raw content piece left margin
Coboundary=raw content piece coboundary
Highly=the raw content tile height
Width=raw content piece width
2. if the limit for height layout areas of limit for width not, obtain the target area of each content blocks by following formula:
Scaling=current goal region height/layout areas height
Left margin=layout piece left margin+(content blocks left margin-layout piece left margin) * scaling
Coboundary=layout piece coboundary+(content blocks coboundary-layout piece coboundary) * scaling
Highly=content blocks height * scaling
Width=content blocks width * scaling
3. if the limit for width layout areas of limit for height not, obtain the target area of each content blocks by following formula:
Scaling=current goal peak width/layout areas width
Left margin=layout piece left margin+(content blocks left margin-layout piece left margin) * scaling
Coboundary=layout piece coboundary+(content blocks coboundary-layout piece coboundary) * scaling
Highly=content blocks height * scaling
Width=content blocks width * scaling
4. if the wide layout areas of limit for height is pressed the target area that following formula obtains each content blocks:
Width scaling=current goal peak width/layout areas width
Height scaling=current goal region height/layout areas height
Left margin=layout piece left margin+(content blocks left margin-layout piece left margin) * width scaling
Coboundary=layout piece coboundary+(content blocks coboundary-layout piece coboundary) * height scaling
Highly=content blocks height * height scaling
Width=content blocks width * width scaling
Through above four kinds of layout flow processs, can calculate the physical size in current goal zone to content blocks:
A. developed width is left margin poor of right margin and the leftmost side content blocks of rightmost side content blocks;
B. true altitude is coboundary poor of lower boundary and the top side content blocks of lower side content blocks.
Technical conceive of the present invention is: at first, the definition content blocks is meant the effective object of said layout method, and these objects have following characteristic:
1. the border that a rectangle is arranged;
2. can accomplish the layout of self with reference to the size (wide, height) of a suggestion, the physical size after the layout might be different with reference dimension.
3. the content in the content blocks might change at any time, but once content is confirmed and through after the layout, the size of content blocks will be fixed up.
All objects that meet above three characteristics all can be used as content blocks.The literal that for example in composing, occurs usually, picture etc.
Layout areas is the rectangular area that is used for specifying its internal object layout logic.Press the layout logic of layout areas and the classification of type of internal object, layout areas can be divided into:
Empty layout areas: inner do not have an object
Content blocks layout areas: inner single content blocks
The particular topology zone: there are a plurality of content blocks inside
The landscape layout zone: there are a plurality of transversely arranged secondary layout areas inside
Vertical layout areas: there is the secondary layout areas of a plurality of vertical arrangements inside
Secondary layout areas is meant the layout areas that is included in the medium and small one-level of current layout areas.
Top layout areas is meant the layout areas that does not have father's layout areas.
Layout information comprises:
1. set membership: the relation of inclusion between layout areas and the secondary layout areas.
2. context up and down: the relation between layout areas and the layout areas.
3. layout dimension: layout areas wide and high.
Positional information is meant in the layout areas content blocks residing left and right sides upper-lower position and it is to the distance between layout areas.
The basic thought of layout: described layout method passes through from the content blocks positional information of an existing model space of a whole page, to extract the layout information of the required layout areas of layout, and then uses this layout information that the fresh content of content blocks is carried out layout.
In the ordinary course of things; Lacked in the only content blocks positional information of the model space of a whole page carry out the required content blocks related information of fresh content layout (as; The information of description interblock position relation is explained when a content blocks changes because of the content change position information how position of content blocks is on every side adjusted etc.); This method will be obtained the related information that this part is lost again through to the semantic analysis of model space of a whole page vision.
Here the vision semanteme of indication is meant that the new layout result and the model space of a whole page keep visual consistance and similarity, specifically comprises following three principles:
1. guarantee the unchangeability of new layout result and model space of a whole page content blocks relation, promptly descend relation of plane to remain unchanged:
A) content blocks upper and lower relation
B) concern about content blocks
C) content blocks overlapping relation
2. the unchangeability of the border relation of guaranteeing as far as possible in the model space of a whole page, to align, as:
A) keep the content blocks limit of alignment to align as far as possible
B) guarantee that as far as possible frontier distance is constant
3. generally speaking, flexible if the zone needs, the bigger part of size in the always preferentially flexible model space of a whole page.
Beneficial effect of the present invention mainly shows: the composing work efficiency is accomplished, is improved greatly in editor, composing automatically automatically.
Description of drawings
Fig. 1 is the variation synoptic diagram of the typesetting format of two row.
Fig. 2 is the synoptic diagram of the layout areas of special circumstances.
1. and 2. Fig. 3 is the process synoptic diagram of the secondary layout areas that comes out of horizontal and vertical division, annotates: a. divides for the first time and obtains secondary layout areas; 3. and 4. b.. divide for the second time and obtain secondary layout areas; 3. and 4. c. be set membership with 2. relation.
Fig. 4 is the synoptic diagram of the height in unified goal zone; Annotate: not blank between the content blocks among a. figure, blank is the needs of drawing here; B. the shaded in 5. is after the unified goal zone, the true altitude that obtains.
Fig. 5 is the synoptic diagram of the layout areas of special circumstances.
Embodiment
Below in conjunction with accompanying drawing the present invention is further described.
With reference to Fig. 1~Fig. 5, a kind of method of content blocks automatic typesetting, the method for said automatic typesetting may further comprise the steps:
(1), extract layout information:
According to the typesetted space of a whole page, the said space of a whole page includes the content blocks of square boundary, and content blocks is minimum layout areas, and wherein, blank also is sleazy content blocks;
Layout areas refinement partition process is following:
1.1) if current layout areas is the layout areas of a blank, then need not refinement again and divide, finish to divide flow process;
1.2) if current layout areas has only a content blocks, it is exactly minimum layout areas, also need not refinement again and divides, and finishes to divide flow process;
1.3) find out can not with any one content blocks in the layout areas in have intersection point, and the lines that can laterally divide current layout areas are from left to right laterally divided secondary layout areas;
1.4) if can not laterally divide, then find out the lines that can vertically divide layout areas from top to bottom, vertically divided secondary layout areas;
1.5) if horizontal secondary layout areas or vertical secondary layout areas are single content blocks, then need not to divide again this secondary layout areas; If the horizontal secondary layout areas or the vertical secondary layout areas that divide still comprise a plurality of content blocks, then need again according to 1.1) to 1.4) step divide, till obtaining minimum layout areas;
In each flow process of dividing, the following related information between the recorded content piece: the context up and down between set membership, layout areas and the layout areas of generation layout areas and secondary layout areas and the size of each layout areas;
(2), use the layout information layout: convert the layout information of layout areas the positional information of content blocks to, the target area is meant and is used for layout areas is carried out again the rectangular area that comprises suggested position and size of layout; Top target area is to be used for the target area of the top layout areas of layout again; Specific as follows:
2.1), when layout areas is the layout areas of a blank,
1. its layout dimension in top target area is exactly its physical size.
2. in horizontal and vertical layout areas, the target area size of blank content blocks is exactly its original size.
2.2) if layout areas is single content blocks, when carrying out layout in the target area, the left margin of content blocks and coboundary would be the left margin and the coboundary of layout areas always, the physical size of target area is for carrying out the content blocks physical size after the layout to content blocks;
2.3) if layout areas comprises a plurality of horizontal secondary layout areas, carry out according to following steps:
2.3.1), all secondary layout areas are carried out pre-layout;
2.3.2), the height of secondary layout areas in the unified goal zone: if the true altitude of the secondary layout areas in the target area is not exclusively the same, then need adjust the height of secondary layout areas; Find out the highest secondary layout areas of true altitude earlier; Then, the secondary layout areas to other carries out layout again;
2.3.3) the regional physical size of calculating current goal;
2.4) if layout areas comprises a plurality of vertical secondary layout areas, carry out according to following steps:
2.4.1), all secondary layout areas are carried out pre-layout;
2.4.2), the width of secondary layout areas in the unified goal zone: if the developed width of the secondary layout areas in the target area is not exclusively the same, then need adjust the width of secondary layout areas; Find out the maximum secondary layout areas of developed width earlier.Then, the secondary layout areas to other carries out layout again;
2.4.3) the regional physical size of calculating current goal;
(3), when the content of content blocks changes, carry out automatic typesetting according to the layout information of step (2) definition.
In the present embodiment, extract the process of layout information:
The leaching process of layout information is the layout information that the positional information of content blocks is converted to layout areas in essence.
The prerequisite of extracting layout information is that typesetted space of a whole page will be arranged, and must include content blocks (blank content blocks also is a layout piece) in this space of a whole page.Wherein, content blocks itself is exactly minimum layout areas, and blank also is a kind of special sleazy content blocks.
Divide for a layout areas refinement, generally comprise following 5 kinds:
1. if current layout areas is the layout areas of a blank, then need not refinement again and divide, finish to divide flow process.
2. if current layout areas has only a content blocks, it is exactly minimum layout areas, also need not refinement again and divides, and finishes to divide flow process.
3. find out can not with any one content blocks in the layout areas in have intersection point and the lines that can laterally divide current layout areas from left to right.
4., then find out the lines that vertically to divide layout areas from top to bottom if can not laterally divide.
5. but can not carry out horizontal and vertical division if current layout areas has comprised a plurality of content plates, then be classified as special circumstances.
6., then need not to divide again this secondary layout areas if the secondary layout areas that horizontal and vertical division is come out is single content blocks; Still comprise a plurality of content blocks if divide the secondary layout areas that comes out, then need to divide according to 1 to 5 step again, till obtaining minimum layout areas.
In each flow process of dividing, all can produce the set membership of layout areas and secondary layout areas, the context up and down between layout areas and layout areas, and the size of each layout areas (comprising current layout areas and secondary layout areas).
Use the layout information layout: the target area is meant and is used for layout areas is carried out again the rectangular area that comprises suggested position and size (wide and high) of layout.Top target area is to be used for the target area of the top layout areas of layout again.
Using the process of layout information layout is the positional information that the layout information of layout areas is converted to content blocks.
When in the current goal zone, current layout areas being carried out again layout, undertaken by following 5 steps according to layout information:
1, when layout areas is the layout areas of a blank,
Its layout dimension in top target area is exactly its physical size.
In horizontal and vertical layout areas, the target area size of blank content blocks is exactly its original size.
If 2 layout areas are single content blocks, when carrying out layout in the target area, the left margin of content blocks and coboundary would be the left margin and the coboundary of layout areas always, and the physical size of target area is for carrying out the content blocks physical size after the layout to content blocks.When the suggestion size of decision content blocks layout, then can produce four kinds of situation:
1. during the limit for width limit for height, the physical size of target area is exactly to after the content block layout, the physical size that obtains.
2. during limit for height, under the situation that limits width, the height of a given suggestion is not zero to limit for width, and the true altitude of target area is to after the content block layout, the true altitude that obtains.
3. during limit for width, under the situation of constrain height, the width of a given suggestion is not zero to limit for height.The developed width of target area is exactly to after the content block layout, the developed width that obtains.
4. limit for height is not during limit for width, and in the target area, the height of a given suggestion and width all are zero.The developed width of target area with highly be exactly to after the content block layout, the developed width that obtains and highly.
Annotate: 3. top, 4. in given suggestion height, width is zero to be minimum constructive height or the width in order to obtain content blocks, reference is to the definition 2 of content blocks.
If 3 layout areas comprise a plurality of horizontal secondary layout areas,, carry out layout according to following three phases
In first stage, all secondary layout areas are carried out pre-layout:
If a layout areas is a limit for width
A.1) find out the wideest secondary layout areas earlier
A.2) the secondary layout areas (if any) to this layout areas left side carries out layout by order from left to right
Target area during first secondary layout areas layout is:
1) left margin is the left margin in current goal zone
2), the coboundary is the coboundary in current goal zone
3), width is the size of first secondary layout areas
4), highly be the size of current layout areas
Target area during follow-up secondary layout areas layout is:
1). left margin is the actual right margin after last layout areas layout is accomplished
2). the coboundary is the coboundary in current goal zone
3). width is the size of current secondary layout areas
4). highly be the size of current layout areas
A.3) the secondary layout areas (if any) to this layout areas right side carries out layout by order from right to left:
Target area during first secondary layout areas layout is:
1. left margin is the size that the regional right margin of current goal deducts first secondary layout areas
2. the coboundary is the coboundary in current goal zone
3. width is the size of first secondary layout areas
4. highly be the size of current layout areas
Target area during follow-up secondary layout areas layout is:
1. left margin is the size that actual left margin after last layout areas layout is accomplished deducts current secondary layout areas
2. the coboundary is the coboundary in current goal zone
3. width is the size of current secondary layout areas
4. highly be the size of current layout areas
After each secondary layout areas on right side carried out layout, if secondary layout areas developed width is inconsistent with in advance given width, then need carry out layout again to this secondary layout areas, the target area of layout is:
1. left margin is the developed width that actual left margin after last layout areas layout is accomplished deducts current secondary layout areas
2. the coboundary is constant, or the coboundary in current goal zone
3. width is the developed width of current secondary layout areas
4. highly be the developed width of current layout areas
A.4) the wideest layout areas of width is carried out layout.The target area is:
1. left margin is the actual right margin after the secondary layout areas layout in left side is accomplished, if there is not the secondary layout areas in left side, then is the left margin of current layout areas
2. the coboundary is the coboundary in current goal zone
3. width is the actual left margin (if any, if not then be the right margin of current layout areas) after the secondary layout areas layout in right side is accomplished and current secondary layout areas left margin is poor
4. highly be the size of current layout areas
B is if non-limit for width, according under the limit for width condition, the wideest secondary layout areas left side layout type from left to right being carried out layout one by one to all secondary layout areas.
Subordinate phase, the height of secondary layout areas in the unified goal zone
If the true altitude of the secondary layout areas in the target area is not exclusively the same, then need adjust the height of secondary layout areas.Find out the highest secondary layout areas of true altitude earlier.Then, other secondary layout areas is carried out layout again, the packing objective zone is:
A. left margin, the coboundary, width is the same with the actual value of phase one
B. highly be the true altitude of the highest secondary layout areas of reality
Phase III, calculate the physical size in current goal zone
A. developed width is left margin poor of secondary layout areas of right margin and the leftmost side of the secondary layout areas of the rightmost side
B. true altitude is the height of high secondary layout areas
4. if layout areas comprises a plurality of vertical secondary layout areas, the layout type of vertical secondary layout areas and the layout type of horizontal secondary layout areas are symmetrical fully, with reference to the layout type of horizontal secondary layout areas; Carry out layout according to following three phases
In first stage, all secondary layout areas are carried out pre-layout:
If a layout areas is a limit for height
1) finds out the highest secondary layout areas earlier
2) the secondary layout areas (if any) to this layout areas upside carries out layout by order from the top down
Target area during first secondary layout areas layout is:
1) left margin is the left margin in current goal zone
2), the coboundary is the coboundary in current goal zone
3), highly be the size of first secondary layout areas
4), width is the size of current layout areas
Target area during follow-up secondary layout areas layout is:
1). the coboundary is the actual lower boundary after last layout areas layout is accomplished
2). left margin is the left margin in current goal zone
3). highly be the size of current secondary layout areas
4). width is the size of current layout areas
3) the secondary layout areas (if any) to this layout areas downside carries out layout by order from bottom to top
Target area during first secondary layout areas layout is:
1. the coboundary is the size that the regional lower boundary of current goal deducts first secondary layout areas
2. left margin is the left margin in current goal zone
3. highly be the size of first secondary layout areas
4. width is the size of current layout areas
Target area during follow-up secondary layout areas layout is:
1. the coboundary is the size that in fact border after last layout areas layout is accomplished deducts current secondary layout areas
2. left margin is the left margin in current goal zone
3. highly be the size of current secondary layout areas
4. width is the size of current layout areas
After each secondary layout areas of downside carried out layout, if secondary layout areas true altitude is inconsistent with in advance given height, then need carry out layout again to this secondary layout areas, the target area of layout is:
1. the coboundary is the developed width that actual lower boundary after last layout areas layout is accomplished deducts current secondary layout areas
2. left margin is constant, or the left margin in current goal zone
3. highly be the developed width of current secondary layout areas
4. width is the developed width of current layout areas
4) the wideest layout areas of width is carried out layout.The target area is:
1. the coboundary is the actual lower boundary after the secondary layout areas layout of upside is accomplished, if there is not the secondary layout areas of upside, then is the coboundary of current layout areas
2. left margin is the left margin in current goal zone
3. highly be the in fact border (if any, if not then be the lower boundary of current layout areas) after the secondary layout areas layout of downside is accomplished and current secondary layout areas coboundary is poor
4. width is the size of current layout areas
B is if non-limit for height, according under the limit for height condition, the wideest secondary layout areas left side layout type from the top down being carried out layout one by one to all secondary layout areas.
Subordinate phase, the width of secondary layout areas in the unified goal zone
If the developed width of the secondary layout areas in the target area is not exclusively the same, then need adjust the width of secondary layout areas.Find out the wideest secondary layout areas of developed width earlier.Then, other secondary layout areas is carried out layout again, the packing objective zone is:
A. coboundary, left margin, height is the same with the actual value of phase one
B. width is the true altitude of the wideest secondary layout areas of reality
Phase III, calculate the physical size in current goal zone
A. true altitude is coboundary poor of secondary layout areas of lower boundary and top side of the secondary layout areas of top side
B. developed width is the width of wide secondary layout areas
5. if layout areas is special layout areas, show in given target area in order to make the content blocks in the layout areas, need be to the convergent-divergent that carries out of content blocks.To the convergent-divergent of content blocks, be to carry out through the target area of calculating each content blocks.In the target area, carry out layout and can divide following four kinds of situation:
1. if the wide layout areas of limit for height not, the target area
Left margin=raw content piece left margin
Coboundary=raw content piece coboundary
Highly=the raw content tile height
Width=raw content piece width
2. if the limit for height layout areas of limit for width not, obtain the target area of each content blocks by following formula
Scaling=current goal region height/layout areas height
Left margin=layout piece left margin+(content blocks left margin-layout piece left margin) * scaling
Coboundary=layout piece coboundary+(content blocks coboundary-layout piece coboundary) * scaling
Highly=content blocks height * scaling
Width=content blocks width * scaling
3. if the limit for width layout areas of limit for height not, obtain the target area of each content blocks by following formula
Scaling=current goal peak width/layout areas width
Left margin=layout piece left margin+(content blocks left margin-layout piece left margin) * scaling
Coboundary=layout piece coboundary+(content blocks coboundary-layout piece coboundary) * scaling
Highly=content blocks height * scaling
Width=content blocks width * scaling
4. if the wide layout areas of limit for height is pressed the target area that following formula obtains each content blocks
Width scaling=current goal peak width/layout areas width
Height scaling=current goal region height/layout areas height
Left margin=layout piece left margin+(content blocks left margin-layout piece left margin) * width scaling
Coboundary=layout piece coboundary+(content blocks coboundary-layout piece coboundary) * height scaling
Highly=content blocks height * height scaling
Width=content blocks width * width scaling
Through above four kinds of layout flow processs, can calculate the physical size in current goal zone to content blocks:
C. developed width is left margin poor of right margin and the leftmost side content blocks of rightmost side content blocks
D. true altitude is coboundary poor of lower boundary and the top side content blocks of lower side content blocks
After if layout is accomplished, the step the when content of content blocks changes above same the use is carried out layout;
When the content of the layout areas of finding current layout or content blocks does not change and new target area when identical with original physical size, can directly skip the zone that needs layout.

Claims (5)

1. the method for a content blocks automatic typesetting, it is characterized in that: the method for said automatic typesetting may further comprise the steps:
(1), extract layout information:
According to the typesetted space of a whole page, the said space of a whole page includes the content blocks of square boundary, and content blocks is minimum layout areas, and wherein, blank also is sleazy content blocks;
Layout areas refinement partition process is following:
1.1) if current layout areas is the layout areas of a blank, then need not refinement again and divide, finish to divide flow process;
1.2) if current layout areas has only a content blocks, it is exactly minimum layout areas, also need not refinement again and divides, and finishes to divide flow process;
1.3) find out can not with any one content blocks in the layout areas in have intersection point, and the lines that can laterally divide current layout areas are from left to right laterally divided secondary layout areas;
1.4) if can not laterally divide, then find out the lines that can vertically divide layout areas from top to bottom, vertically divided secondary layout areas;
1.5) if horizontal secondary layout areas or vertical secondary layout areas are single content blocks, then need not to divide again this secondary layout areas; If the horizontal secondary layout areas or the vertical secondary layout areas that divide still comprise a plurality of content blocks, then need again according to 1.1) to 1.4) step divide, till obtaining minimum layout areas;
1.6) if having comprised a plurality of content plates, current layout areas but can not carry out horizontal and vertical division, then be classified as special circumstances;
In each flow process of dividing, the following related information between the recorded content piece: the context up and down between set membership, layout areas and the layout areas of generation layout areas and secondary layout areas and the size of each layout areas;
(2), use the layout information layout: convert the layout information of layout areas the positional information of content blocks to, the target area is meant and is used for layout areas is carried out again the rectangular area that comprises suggested position and size of layout; Top target area is to be used for the target area of the top layout areas of layout again; Specific as follows:
2.1), when layout areas is the layout areas of a blank,
1. its layout dimension in top target area is exactly its physical size;
2. in horizontal and vertical layout areas, the target area size of blank content blocks is exactly its original size;
2.2) if layout areas is single content blocks, when carrying out layout in the target area, the left margin of content blocks and coboundary would be the left margin and the coboundary of layout areas always, the physical size of target area is for carrying out the content blocks physical size after the layout to content blocks;
2.3) if layout areas comprises a plurality of horizontal secondary layout areas, carry out according to following steps:
2.3.1), all horizontal secondary layout areas are carried out pre-layout;
2.3.2), the height of horizontal secondary layout areas in the unified goal zone: if the true altitude of the horizontal secondary layout areas in the target area is not exclusively the same, then need transfer the height of laterally whole secondary layout areas; Find out the highest horizontal secondary layout areas of true altitude earlier; Then, the horizontal secondary layout areas to other carries out layout again;
2.3.3) the regional physical size of calculating current goal;
2.4) if layout areas comprises a plurality of vertical secondary layout areas, carry out according to following steps:
2.4.1), all vertical secondary layout areas are carried out pre-layout;
2.4.2), the width of vertical secondary layout areas in the unified goal zone: if the developed width of the vertical secondary layout areas in the target area is not exclusively the same, then need adjust vertically time. the width of level layout areas; Find out the maximum vertical secondary layout areas of developed width earlier; Then, the vertical secondary layout areas to other carries out layout again;
2.4.3) the regional physical size of calculating current goal;
2.5) if layout areas is special layout areas, the size of content blocks is carried out convergent-divergent; Convergent-divergent to content blocks carries out through the target area of calculating each content blocks;
(3), when the content of content blocks changes, carry out automatic typesetting according to the layout information of step (2) definition.
2. the method for a kind of content blocks automatic typesetting as claimed in claim 1 is characterized in that: said step 2.3.1), the process of all horizontal secondary layout areas being carried out pre-layout is:
If a. layout areas is a limit for width
A.1) find out the wideest secondary layout areas earlier;
A.2) the secondary layout areas (if any) to this layout areas left side carries out layout by order from left to right, and the target area during first secondary layout areas layout is:
● left margin is the left margin in current goal zone
● the coboundary is the coboundary in current goal zone
● width is the width dimensions of first secondary layout areas
● highly be the height dimension of current layout areas
Target area during follow-up secondary layout areas layout is:
● left margin is the actual right margin after last layout areas layout is accomplished
● the coboundary is the coboundary in current goal zone
● width is the width dimensions of current secondary layout areas
● highly be the height dimension of current layout areas
A.3) if the secondary layout areas to this layout areas right side is arranged, carry out layout by order from right to left;
Target area during first secondary layout areas layout is:
● left margin is the size that the right margin in current goal zone deducts first secondary layout areas
● the coboundary is the coboundary in current goal zone
● width is the width dimensions of first secondary layout areas
● the target area during highly for the follow-up secondary layout areas layout of the height dimension of current layout areas is:
● left margin is the size that the actual left margin after last layout areas layout is accomplished deducts current secondary layout areas
● the coboundary is the coboundary in current goal zone
● width is the width dimensions of current secondary layout areas
● highly be the height dimension of current layout areas
After each secondary layout areas on right side carried out layout, if secondary layout areas developed width is inconsistent with in advance given width, then need carry out layout again to this secondary layout areas, the target area of layout is:
● left margin is the developed width that the actual left margin after last layout areas layout is accomplished deducts current secondary layout areas
● the coboundary is constant, or the coboundary in current goal zone
● width is the developed width of current secondary layout areas
● highly be the developed width of current layout areas
A.4) the wideest layout areas of width is carried out layout, the target area is:
● left margin is the actual right margin after the secondary layout areas layout in left side is accomplished, if there is not the secondary layout areas in left side, then is the left margin of current layout areas
● the coboundary is the coboundary in current goal zone
● width is actual left margin and current secondary layout areas left margin poor after the secondary layout areas layout in right side is accomplished
● highly be the height dimension of current layout areas
B. if limit for width not, according under the limit for width condition, the wideest secondary layout areas left side layout type from left to right being carried out layout one by one to all secondary layout areas.
3. the method for a kind of content blocks automatic typesetting as claimed in claim 2 is characterized in that: said step 2.3.2), the packing objective zone that other horizontal secondary layout areas carries out again layout is:
● left margin, the coboundary, width is the same with the actual value of phase one;
● highly be the true altitude of the highest secondary layout areas of reality.
4. the method for a kind of content blocks automatic typesetting as claimed in claim 1 is characterized in that: said step 2.4.1), the process of all vertical secondary layout areas being carried out pre-layout is:
If a. layout areas is a limit for height
A.1) find out the highest secondary layout areas earlier
A.2) the secondary layout areas (if any) to this layout areas upside carries out layout by order from the top down, and the target area during first secondary layout areas layout is:
● the coboundary is the coboundary in current goal zone
● left margin is the left margin in current goal zone
● highly be the height dimension of first secondary layout areas
● the target area when width is the follow-up secondary layout areas layout of the width dimensions of current layout areas is:
● the coboundary is the actual lower boundary after last layout areas layout is accomplished
● left margin is the left margin in current goal zone
● highly be the height dimension of current secondary layout areas
● width is the width dimensions of current layout areas
A.3) if the secondary layout areas to the narrow side of this layout areas is arranged, carry out layout by order from bottom to top
Target area during first secondary layout areas layout is:
● the coboundary is the size that the lower boundary in current goal zone deducts first secondary layout areas
● left margin is the left margin in current goal zone
● highly be the height dimension of first secondary layout areas
● the target area when width is the follow-up secondary layout areas layout of the width dimensions of current layout areas is:
● the coboundary is the size that the in fact border after last layout areas layout is accomplished deducts current secondary layout areas
● left margin is the left margin in current goal zone
● highly be the height dimension of current secondary layout areas
● width is after the width dimensions of current layout areas carries out layout to each secondary layout areas of downside; If secondary layout areas true altitude is inconsistent with in advance given height; Then need carry out layout again to this secondary layout areas, the target area of layout is:
● the coboundary is the developed width that the in fact border after last layout areas layout is accomplished deducts current secondary layout areas
● left margin is constant, or the left margin in current goal zone
● highly be the true altitude of current secondary layout areas
● width is the true altitude of current layout areas
A.4) highly the highest layout areas is carried out layout, the target area is:
● the coboundary is the actual lower boundary after the secondary layout areas layout of upside is accomplished, if there is not the secondary layout areas of upside, then is the coboundary of current layout areas
● left margin is the left margin in current goal zone
● highly be in fact border and current secondary layout areas coboundary poor after the secondary layout areas layout of downside is accomplished
● width is the width dimensions of current layout areas
B is if non-limit for height, according under the limit for height condition, the highest secondary layout areas upside layout type from the top down being carried out layout one by one to all secondary layout areas.
5. the method for a kind of content blocks automatic typesetting as claimed in claim 4 is characterized in that: said step 2.4.2), the packing objective zone that other vertical secondary layout areas carries out again layout is:
● the coboundary, left margin, height is the same with the actual value of phase one;
● width is the developed width of the wideest secondary layout areas of reality.
CN2009101559036A 2009-12-31 2009-12-31 Method for automatic typesetting of content blocks Expired - Fee Related CN101770452B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101559036A CN101770452B (en) 2009-12-31 2009-12-31 Method for automatic typesetting of content blocks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101559036A CN101770452B (en) 2009-12-31 2009-12-31 Method for automatic typesetting of content blocks

Publications (2)

Publication Number Publication Date
CN101770452A CN101770452A (en) 2010-07-07
CN101770452B true CN101770452B (en) 2012-07-04

Family

ID=42503319

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101559036A Expired - Fee Related CN101770452B (en) 2009-12-31 2009-12-31 Method for automatic typesetting of content blocks

Country Status (1)

Country Link
CN (1) CN101770452B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467496B (en) * 2010-11-17 2015-02-25 北大方正集团有限公司 Method and device for converting stream mode typeset content into block mode typeset document
CN102567301A (en) * 2010-12-21 2012-07-11 北大方正集团有限公司 Method and device for subfield composing
CN102541818B (en) * 2010-12-21 2015-09-16 北大方正集团有限公司 Large version re-editing method and device
CN103914555B (en) * 2014-04-14 2017-10-27 百度在线网络技术(北京)有限公司 The method and apparatus that webpage is laid out again
CN105787877B (en) * 2016-02-18 2018-11-23 精实万维软件(北京)有限公司 A kind of more figure composition methods of dynamic and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928863A (en) * 2006-09-20 2007-03-14 田园 Method for automatically dividing web page zone
CN101013417A (en) * 2007-02-12 2007-08-08 北京大学 Page setup assisted apparatus and method for changing line-shifted attribute of composition data
US7554689B2 (en) * 2003-10-15 2009-06-30 Canon Kabushiki Kaisha Document layout method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7554689B2 (en) * 2003-10-15 2009-06-30 Canon Kabushiki Kaisha Document layout method
CN1928863A (en) * 2006-09-20 2007-03-14 田园 Method for automatically dividing web page zone
CN101013417A (en) * 2007-02-12 2007-08-08 北京大学 Page setup assisted apparatus and method for changing line-shifted attribute of composition data

Also Published As

Publication number Publication date
CN101770452A (en) 2010-07-07

Similar Documents

Publication Publication Date Title
CN101770452B (en) Method for automatic typesetting of content blocks
CN106156761B (en) Image table detection and identification method for mobile terminal shooting
CN105930159B (en) A kind of method and system that the GUI code based on image generates
US9798925B2 (en) Method for identifying PDF document
CN101770446B (en) Method and system for identifying form in layout file
CN101206639A (en) Method for indexing complex impression based on PDF
CN110008809A (en) Acquisition methods, device and the server of list data
CN102156865A (en) Handwritten text line character segmentation method and identification method
CN102782703A (en) Page layout determination of an image undergoing optical character recognition
CN107301418A (en) Printed page analysis in optical character identification
CN105279506B (en) The localization method of language of the Manchus word central axes
US9536141B2 (en) System and method for forms recognition by synthesizing corrected localization of data fields
CN102542268A (en) Method for detecting and positioning text area in video
CN105159877A (en) Cross-media automatic typesetting system and method thereof
CN105574486A (en) Image table character segmenting method
CN107133566A (en) A kind of method of chart in identification PDF document
CN104063365A (en) Method for inserting object in PDF document
CN110688825A (en) Method for extracting information of table containing lines in layout document
CN103093470A (en) Rapid multi-modal image synergy segmentation method with unrelated scale feature
EP2110758A1 (en) Searching method based on layout information
CN104598907A (en) Stroke width figure based method for extracting Chinese character data from image
CN103440239A (en) Functional region recognition-based webpage segmentation method and device
CN102306294A (en) Method and system for extracting image from portable document format (PDF) file page
CN110309553B (en) Drawing rapid drawing system and method based on standardized bridge universal gallery
CN104616295A (en) News image horizontal headline caption simply and rapidly positioning method

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

Termination date: 20141231

EXPY Termination of patent right or utility model