CN110222324B - Automatic layout device based on character paragraph structure and word size change rate - Google Patents
Automatic layout device based on character paragraph structure and word size change rate Download PDFInfo
- Publication number
- CN110222324B CN110222324B CN201910421809.4A CN201910421809A CN110222324B CN 110222324 B CN110222324 B CN 110222324B CN 201910421809 A CN201910421809 A CN 201910421809A CN 110222324 B CN110222324 B CN 110222324B
- Authority
- CN
- China
- Prior art keywords
- size
- layout
- grid
- priority
- block
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/174—Form filling; Merging
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Controls And Circuits For Display Device (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention relates to the technical field of planar design, in particular to an automatic layout device based on a character paragraph structure and a character size change rate.
Description
Technical Field
The invention relates to the technical field of plane design, in particular to an automatic layout device based on a character paragraph structure and a character size change rate.
Background
When designing a plane, it is common practice for designers to use a background image as a background, then find out the foreground regions of the background, and then place logos, decorations, or characters in these foreground regions.
We refer to these areas for placing text collectively as "blocks". For example: the area marked by a red dotted line frame in the poster is a block, and the four blocks are totally arranged in the poster. These "tiles" require a layout that allows for aesthetically pleasing placement of text into these areas.
At present, a large number of algorithms exist for identifying background and foreground regions of a picture, and a block can be identified through the algorithms. However, there is no good algorithm to solve the problem of automatic layout of the content in "blocks". If this problem can be solved well, then automatic generation of this type of flat design can be accomplished along this line of thought.
The device provides an automatic layout device based on the structure of the text paragraph and the change rate of the font size, can realize the automatic layout of the text content in the block, and lays a certain foundation for intelligent automatic plane design.
Disclosure of Invention
Therefore, in order to solve the above problems, the present invention provides an automatic layout device based on a text paragraph structure and a font size change rate, through which a user performs priority division and confirmation of a block size on a text to be laid out, so as to generate a plurality of layout trees, and a grid in the layout trees is automatically changed according to the change rate of the text, so that a designer does not need to repeatedly adjust the grid size, thereby greatly reducing the repeated work of the designer, avoiding the trouble of repeatedly adjusting the size and parameters, and improving the drawing efficiency.
In order to realize the technical problem, the solution scheme adopted by the invention is as follows: an automatic layout device based on the structure of a character paragraph and the change rate of the character size is characterized by comprising a layout generator; the automatic layout method of the layout generator is as follows:
step one, a user self-defines and inputs contents to a layout generator, and sets the priority of the contents according to the design intention of the contents, wherein the priority setting rule is that starting from P0, the smaller the number is, the higher the priority is, the priority represents the relative size of the character size in the grid, and the contents with high priority can use the character size larger than the contents with low priority.
Generating a layout tree for the content according to the priority setting by a layout generator, wherein the tree node grids of the layout tree are generated correspondingly to the priority level; the user can rotate and adjust the generated nodes of the layout tree to obtain different layouts.
After the layout tree is generated in the step (three), obtaining a specific grid size according to an algorithm flow of the grid, wherein the calculation method of the grid size comprises the following flows:
the process (1) sets an initial word size range S for P0 a ~S b 。
Procedure (2) set the font size value S of P0 to S b ;
The flow (3) calculates the word size values of different priorities according to the word size value and the word size change rate function of the P0;
in the process (4), the text contents placed in each grid are used as an independent large section according to the process (3); calculating word sizes with different priorities, putting the words together, trying to put the words into a block, and performing a loop calculation according to the putting result, wherein the loop is as follows:
1. all the text can be put in and the area of the remaining space is less than or equal to k% of the total area of the "block", then we jump to flow (5).
2. Can put all characters in, and the area of the residual space is larger than k% of the total area of the block, and modify S a Has a value of (S) b +S a ) Rounding down and then jumping to the flow (3);
3. all characters cannot be put in, and the value of Sb is modified to be (S) b +S a ) Rounding up the/2 and then jumping to the flow (3);
4. the word size which meets the conditions cannot be found, and the word size which has the area ratio of the residual space closest to k% after all the characters are put in is selected as a calculation result;
and (5) calculating the space occupation ratio of the characters corresponding to each grid in the block according to the typesetting result in the flow (4).
And obtaining the font size corresponding to each priority and the proportion of each grid in the block according to the flow, and finally obtaining the grid size.
Further, the word size change rate functional relation comprises:
power function: f (x) = mx a Wherein m and a are empirical coefficients;
exponential function: f (x) = lb x Where l and b are empirical coefficients;
a logarithmic function: f (x) = clog (x), where c is an empirical coefficient.
By adopting the technical scheme, the invention has the beneficial effects that: according to the automatic layout device based on the character paragraph structure and the word size change rate, a client can determine the size of a block, then priority distribution can be carried out on the character paragraphs according to the requirements of the client, the layout form can be selected according to the preference of the client after the priority distribution is finished, grids in the layout tree can be automatically changed at the moment, and the problem that the work efficiency of a designer is reduced due to the fact that complicated operation is required to be carried out when the character layout is changed at present is solved.
Drawings
FIG. 1 is a flow chart of the grid size algorithm of the present invention.
Detailed Description
The invention will now be further described with reference to the accompanying drawings and specific embodiments.
Example 1
An automatic layout device based on the structure of a character paragraph and the change rate of the character size is characterized by comprising a layout generator; the automatic layout method of the layout generator is as follows:
the user self-defines and inputs contents to a layout generator, and sets the priority of the contents according to the design intention of the contents, wherein the priority setting rule is that starting from P0, the smaller the number is, the higher the representative priority is, the priority represents the relative size of the character size of the characters in the grid, and the contents with high priority can use the character size larger than the contents with low priority.
Generating a layout tree for the content according to the priority setting by a layout generator, wherein the tree node grids of the layout tree are generated correspondingly to the priority level; the user can rotate and adjust the generated nodes of the layout tree to obtain different layouts.
After the layout tree is generated in the step (three), obtaining a specific grid size according to an algorithm flow of the grid, wherein the calculation method of the grid size comprises the following flows:
the process (1) sets an initial character size range S for P0 a ~S b . Generally we will be S a Is taken as 1,S b Is 200.S a The value of (a) can also be estimated according to the size of the "block";
procedure (2) set the font size value S of P0 to S b ;
And (3) calculating the word size values of different priorities according to the word size value and the word size change rate function of the P0. The font size change rate function can use a power function, an exponential function and a logarithmic function predefined by a system, and can also be defined by a client.
In the process (4), the text contents placed in each grid are used as an independent large section according to the process (3); calculating word sizes with different priorities, putting the words together, trying to put the words into a block, and performing a circular calculation according to the putting result, wherein the circular calculation is as follows:
1. all the text can be put in and the area of the remaining space is less than or equal to k% of the total area of the "block", then we jump to flow (5). Where k is an empirical coefficient, typically 5.
2. Can put all characters in, and the area of the residual space is larger than k% of the total area of the block, and modify S a Has a value of (S) b +S a ) Rounding down and then jumping to the flow (3);
3. can not put all characters in, modify S b Has a value of (S) b +S a ) Rounding up the/2 and then jumping to the flow (3);
4. the word size which meets the conditions cannot be found, and the word size which has the area ratio of the residual space closest to k% after all the characters are put in is selected as a calculation result;
and (5) calculating the space occupation ratio of the characters corresponding to each grid in the block according to the typesetting result in the flow (4).
And obtaining the font size corresponding to each priority and the proportion of each grid in the block according to the flow, and finally obtaining the grid size.
Finally, the word size corresponding to each priority and the proportion of each grid in the block are obtained.
Further, the word size change rate functional relation includes:
a power function: f (x) = mx a Wherein m and a are empirical coefficients;
exponential function: f (x) = lb x Wherein l and b are empirical coefficients;
logarithmic function: f (x) = clog (x), where c is an empirical coefficient.
The above description is only an embodiment utilizing the technical content of the present disclosure, and any modification and variation made by those skilled in the art can be covered by the claims of the present disclosure, and not limited to the embodiments disclosed.
Claims (2)
1. An automatic layout device based on the structure of a text paragraph and the change rate of a font size is characterized by comprising a layout generator; the automatic layout method of the layout generator is as follows:
step one, a user self-defines and inputs contents to a layout generator, and sets the priority of the contents according to the design intention of the contents, wherein the priority setting rule is that starting from P0, the smaller the number is, the higher the representative priority is, the priority represents the relative size of the character size in the grid, and the content with high priority can use the character size larger than the content with low priority;
generating a layout tree for the content according to the priority setting by a layout generator, wherein the tree node grids of the layout tree are generated correspondingly to the priority level; the user can rotate and adjust the generated tree nodes of the layout tree to obtain different layouts;
after the layout tree is generated in the step (three), obtaining a specific grid size according to an algorithm flow of the grid, wherein the calculation method of the grid size comprises the following flows:
the process (1) sets an initial character size range S for P0 a ~S b ;
Procedure (2) set the font size value S of P0 to S b ;
Calculating the word size values of different priorities according to the word size value of P0 and the word size change rate function in the process (3);
the process (4) takes each grid-placed text content as an independent large segment, obtains word sizes with different priorities according to the process (3) for calculation, then puts the texts together, tries to put the texts into a 'block', and performs a circular calculation according to the putting result, wherein the circular calculation is as follows:
(1) All characters are put into the 'block', and the area of the residual space is less than or equal to k% of the total area of the 'block', then the flow (5) is skipped;
(2) All the characters are put into "block", and the area of the residual space is greater than k% of the total area of "block", modifying S a Has a value of (S) b +S a ) Rounding down and then jumping to the flow (3);
(3) All characters can not be put into 'block', S is modified b Has a value of (S) b +S a ) Rounding up and then jumping to the flow (3);
(4) The word size which meets the conditions cannot be found, and the word size which can place all the characters and has the area ratio of the residual space closest to k% is selected as a calculation result;
the flow (5) calculates the space occupation ratio of the characters corresponding to each grid in the block according to the typesetting result in the flow (4);
and obtaining the word size corresponding to each priority and the proportion of each grid in the block according to the flow, and finally obtaining the grid size.
2. The automatic layout device according to claim 1, wherein the font size change rate functional relationship comprises:
power function: f (x) = mx a Wherein m and a are empirical coefficients;
exponential function: f (x) = lb x Where l and b are empirical coefficients;
logarithmic function: f (x) = clog (x), where c is an empirical coefficient.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910421809.4A CN110222324B (en) | 2019-05-21 | 2019-05-21 | Automatic layout device based on character paragraph structure and word size change rate |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910421809.4A CN110222324B (en) | 2019-05-21 | 2019-05-21 | Automatic layout device based on character paragraph structure and word size change rate |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110222324A CN110222324A (en) | 2019-09-10 |
CN110222324B true CN110222324B (en) | 2022-11-08 |
Family
ID=67821580
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910421809.4A Active CN110222324B (en) | 2019-05-21 | 2019-05-21 | Automatic layout device based on character paragraph structure and word size change rate |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110222324B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101876967A (en) * | 2010-03-25 | 2010-11-03 | 深圳市万兴软件有限公司 | Method for generating PDF text paragraphs |
JP2011103135A (en) * | 2005-10-18 | 2011-05-26 | Fujifilm Corp | Album creating apparatus, album creating method and album creating program |
CN102841888A (en) * | 2012-09-14 | 2012-12-26 | 《中国学术期刊(光盘版)》电子杂志社 | Rapid typesetting system and method |
CN104123269A (en) * | 2014-07-16 | 2014-10-29 | 华中科技大学 | Semi-automatic publication generation method and system based on template |
CN104509078A (en) * | 2012-08-09 | 2015-04-08 | 李永贵 | Keyboard and mouse of cellular phone |
CN104516891A (en) * | 2013-09-27 | 2015-04-15 | 北大方正集团有限公司 | Layout analyzing method and system |
CN105045776A (en) * | 2015-09-07 | 2015-11-11 | 武汉大学 | Automatic page type setting method |
CN106066790A (en) * | 2016-05-25 | 2016-11-02 | 乐视控股(北京)有限公司 | A kind of method and apparatus that control halation is set |
CN106326854A (en) * | 2016-08-19 | 2017-01-11 | 掌阅科技股份有限公司 | Open fixed-layout document paragraph identification method |
CN108416827A (en) * | 2018-02-11 | 2018-08-17 | 李荣陆 | A kind of planar design autoplacement device and method analyzed based on data-driven and material |
CN108597002A (en) * | 2018-03-21 | 2018-09-28 | 李荣陆 | A kind of autoplacement device based on deeply study |
CN109062885A (en) * | 2018-07-16 | 2018-12-21 | 广州视源电子科技股份有限公司 | Method, device and equipment for adjusting layout of text box |
CN109658329A (en) * | 2018-11-30 | 2019-04-19 | 上海沐传工业设计有限公司 | A kind of poster layout design tool tree-like based on grid |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040252341A1 (en) * | 2003-06-13 | 2004-12-16 | Canon Kabushiki Kaisha | Layout apparatus, layout method, and program product |
US20140289615A1 (en) * | 2013-03-19 | 2014-09-25 | Xiaomi Inc. | Method and device for typesetting |
US20160012465A1 (en) * | 2014-02-08 | 2016-01-14 | Jeffrey A. Sharp | System and method for distributing, receiving, and using funds or credits and apparatus thereof |
US20150339841A1 (en) * | 2014-05-22 | 2015-11-26 | Microsoft Corporation | Layout animation panel |
-
2019
- 2019-05-21 CN CN201910421809.4A patent/CN110222324B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011103135A (en) * | 2005-10-18 | 2011-05-26 | Fujifilm Corp | Album creating apparatus, album creating method and album creating program |
CN101876967A (en) * | 2010-03-25 | 2010-11-03 | 深圳市万兴软件有限公司 | Method for generating PDF text paragraphs |
CN104509078A (en) * | 2012-08-09 | 2015-04-08 | 李永贵 | Keyboard and mouse of cellular phone |
CN102841888A (en) * | 2012-09-14 | 2012-12-26 | 《中国学术期刊(光盘版)》电子杂志社 | Rapid typesetting system and method |
CN104516891A (en) * | 2013-09-27 | 2015-04-15 | 北大方正集团有限公司 | Layout analyzing method and system |
CN104123269A (en) * | 2014-07-16 | 2014-10-29 | 华中科技大学 | Semi-automatic publication generation method and system based on template |
CN105045776A (en) * | 2015-09-07 | 2015-11-11 | 武汉大学 | Automatic page type setting method |
CN106066790A (en) * | 2016-05-25 | 2016-11-02 | 乐视控股(北京)有限公司 | A kind of method and apparatus that control halation is set |
CN106326854A (en) * | 2016-08-19 | 2017-01-11 | 掌阅科技股份有限公司 | Open fixed-layout document paragraph identification method |
CN108416827A (en) * | 2018-02-11 | 2018-08-17 | 李荣陆 | A kind of planar design autoplacement device and method analyzed based on data-driven and material |
CN108597002A (en) * | 2018-03-21 | 2018-09-28 | 李荣陆 | A kind of autoplacement device based on deeply study |
CN109062885A (en) * | 2018-07-16 | 2018-12-21 | 广州视源电子科技股份有限公司 | Method, device and equipment for adjusting layout of text box |
CN109658329A (en) * | 2018-11-30 | 2019-04-19 | 上海沐传工业设计有限公司 | A kind of poster layout design tool tree-like based on grid |
Non-Patent Citations (2)
Title |
---|
Exploring Automatic Fitness Evaluation for Evolutionary Typesetting;SM Rebelo;《https://xueshu.baidu.com/usercenter/paper/show?paperid=1p790gg02p5q0ak0ca780620ec582412&site=xueshu_se》;20211230;全文 * |
基于矩形Packing问题求解的页面自动排版方法;李治江;《山东农业大学学报(自然科学版)》;20160408;第47卷(第2期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110222324A (en) | 2019-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108255489B (en) | Front-end interface code generation method and device, electronic equipment and storage medium | |
CN106294664B (en) | Method and device for generating thinking guide graph | |
CN105760178A (en) | Method and device for performing adaption on interface control | |
CN104346172B (en) | A kind of irregular DIV Dynamic Distributions method | |
EP1876537A2 (en) | Document editing support device, program, and storage medium | |
CN111475875B (en) | Automatic generation method and system for tile combination gradual change paving | |
CN112614211B (en) | Method and device for text and image self-adaptive typesetting and animation linkage | |
JP4356752B2 (en) | Document editing apparatus, program, and storage medium | |
CN110222324B (en) | Automatic layout device based on character paragraph structure and word size change rate | |
CN109657203B (en) | Method and system for adjusting font size of font library | |
CN105373373B (en) | Method and device for quickly generating icon | |
CN101183358A (en) | Typesetting method and apparatus | |
CN113010762B (en) | Data enhancement method, device, storage medium and electronic equipment | |
CN108234151B (en) | Cloud platform resource allocation method | |
CN105068984A (en) | Automatic puzzling and typesetting method | |
CN116542053A (en) | Fan arrangement method, device and medium | |
CN111462280A (en) | Picture generation method and device, electronic equipment and computer storage medium | |
CN113129185B (en) | Seat table generation method, electronic equipment and storage medium | |
CN113015179B (en) | Network resource selection method and device based on deep Q network and storage medium | |
JPH10303307A (en) | Array system | |
CN103164210A (en) | Method and device of changing surface of application program interface | |
CN106372200A (en) | Method and device for displaying picture resources | |
CN112148288A (en) | Interface color setting method, device, equipment and storage medium | |
JP4883896B2 (en) | Method and apparatus for creating and editing a reactor core loading template | |
CN113377380B (en) | User interface component deployment method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |