CN1427369A - Typesetting method of character frame - Google Patents

Typesetting method of character frame Download PDF

Info

Publication number
CN1427369A
CN1427369A CN01144491A CN01144491A CN1427369A CN 1427369 A CN1427369 A CN 1427369A CN 01144491 A CN01144491 A CN 01144491A CN 01144491 A CN01144491 A CN 01144491A CN 1427369 A CN1427369 A CN 1427369A
Authority
CN
China
Prior art keywords
textbox
width
literal
average length
show
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.)
Granted
Application number
CN01144491A
Other languages
Chinese (zh)
Other versions
CN1185594C (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.)
Inventec Corp
Original Assignee
Inventec Corp
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 Inventec Corp filed Critical Inventec Corp
Priority to CNB011444916A priority Critical patent/CN1185594C/en
Publication of CN1427369A publication Critical patent/CN1427369A/en
Application granted granted Critical
Publication of CN1185594C publication Critical patent/CN1185594C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

A method for composing text boxes includes such steps as choosing the text to be displayed, calculating its number of lines and average length of each line, determining the average line length between the maximal and minimal box widthes, setting up it to be the width of box, composing the text, substracting one from the number of lines for line feed, recording needed widthes setting up the minimal width of recorded widthes to be the display width of text box, and composing the text.

Description

The composition method of textbox
Technical field
The present invention relates to a kind of composition method, be applied to various textboxs, particularly a kind of white space that reduces reaches the composition method of the textbox of best composing effect.
Background technology
General textbox, the real time translation software or the index of general software annotations and comments file or the like for example, the mode of its text composition is nothing more than being following three kinds:
1, breadth extreme method: wide and the high line number and the length decision of textbox by literal to display, the word content that shows does not enter a new line (can not surpass the maximum magnitude that textbox can show certainly), the shortcoming of this method is if when showing long literal, textbox can be wide, if when each length drop of going was very big, then white space then can seem more.
2, fixed width method: the width of textbox is fixed, the guild that length surpasses its width enters a new line automatically, the shortcoming of this method is the width setup excessive (or word content is too short) when textbox, then white space can be quite a lot of, on the other hand, when the width setup of textbox too small (or when word content long), then can cause wrap text too much, make textbox draw oversizely.
3, mean value width method: the display width of textbox is by the word content decision that will show, the average length of the literal that will show is as display width, the long row row of average length (just greater than) is done line feed to be handled, but when running into line width (length of each row just) when distribution is more inhomogeneous, then can seeming, some local white space is excessive, and some local line number is too much.
A common drawback of these composing disposal routes is foot just, can't provide one to determine best display width at the different literals content for the user, makes whole the composing handle incorrectly, causes the space of a whole page not attractive in appearance.
Summary of the invention
The object of the present invention is to provide a kind of composition method of textbox,, can calculate the display width of textbox automatically, make white space minimum behind the textbox display text, the composing best results according to different display text contents to address the above problem.
Above-mentioned purpose of the present invention is achieved in that a kind of composition method of textbox, it is characterized in that including at least the following step:
Choose the literal of required demonstration;
Calculate the line number of this literal and the average word length of this each row;
Confirm that this average length is between this textbox can the maximum and minimum widith of demonstration;
Set this average length for the width of this textbox to the processing of setting type of the literal of this demonstration;
The line number of literal that should line feed reduces delegation, and writes down its required width;
Minimum widith in the width of this record is set at the display width of this textbox; And
According to this display width should required demonstration text composition.
This shows, composition method according to textbox provided by the present invention, at first calculate the line number of the display text of wanting and the length of each row, and calculate its average length, then this average length is compared with maximal value and minimum value that textbox can show, less than the minimum value that textbox can show, the minimum value of then setting textbox is a display width as average length; As average length between maximal value and minimum value that textbox can show, then utilize average length to do the processing of setting type, and to have line feed each the style of writing word roll over row again, calculate minimum widith required when rolling over row back line number minimizing delegation (than the line number of pressing average length folding row gained), and with all literal by the some width values that the calculate processing of setting type again, be display width and select the width value of folding row back white space minimum; If average length greater than the maximal value that textbox can show, is then utilized maximal value to do to set type as width and handled, and calculating the developed width value behind each line space white region of elimination, is display width and select maximum wide value wherein; So,, calculate best display width and go to set type, can make the white space minimum after the composing, thereby obtain best composing effect at different situations.
Description of drawings
Figure 1A, Figure 1B are schematic flow sheet of the present invention;
Fig. 2 A~Fig. 2 C is the synoptic diagram of the present invention and known composition method.
Embodiment
Below in conjunction with embodiment and accompanying drawing thereof, the present invention is described in further detail.
The composition method of textbox disclosed according to the present invention, see also Figure 1A and Figure 1B, shown in Figure 1A, selected text frame literal (step 12) to display at first, and textbox shown translation content when can be real time translation software real time translation, or the index file of regular software or the like, then calculate literal line number to display and average length (step 13), (step 14) is in order to the optimum width of decision textbox then to compare breadth extreme that average length and textbox can show and minimum widith.
When average length during, then minimum widith is set at the width (step 15) of demonstration less than minimum value; When average length drops between maximal value and the minimum value, shown in Figure 1B, setting average length earlier is the width of textbox, come word content set type (step 16) with this, and the length of the line number after the processing of will setting type and each row is write down (step 17), then will set type handle after, wherein there is the line number of the part of line feed to reduce delegation's (width that increase just shows, make its line number reduce delegation), and write down each part and reduce the required width (step 18) of delegation, calculate by the white space size after these width values composings, the width of choosing the white space minimum is a display width (step 19) again; Its objective is in order effectively to reduce white space.
Last a kind of situation is shown in Figure 1B, when breadth extreme that mean value can show greater than textbox, then set the width that breadth extreme is a textbox, and with this to the word content processing (step 21) of setting type, line number after handling and the length that each is gone of setting type is write down (step 22), then calculate the developed width (removing the white space part) of every style of writing word, (step 23), be display width (step 24) with wherein maximum width setup then, in other words, just wherein the most approaching full that part of going is adjusted into the no white space of full row, and other part, line number can't increase, and white space also can relatively reduce.No matter and be which kind of situation, after final decision goes out display width, all utilize the width of this display width for textbox, literal to display set type and shown (step 25 among Figure 1A).
Then, actual giving one example done explanation, at first, see also Fig. 2 A, be the breadth extreme method of available technology adopting, it promptly is the width of textbox 40 according to maximum length, so be the width of textbox 40 with the row of first shown in scheming (first point), like this, the literal of whole textbox 40 is a four lines, 53 characters of every row, white space are 105 characters.Shown in Fig. 2 B, be the average length method that prior art adopts, calculate the average length of this four lines, be the display width of textbox 40 with this average length, the literal in the textbox 40 that obtains is seven row, 27 characters of every row, white space are 72 characters.At last, see also Fig. 2 C, be the textbox composing effect of utilizing method of the present invention to realize, because average length is in the indication range of textbox 40, so utilize the average length processing of setting type earlier, the line number of then calculating the part that line feed will wherein be arranged reduces the required width of delegation, and get wherein minimum width, and last result of calculation, the textbox 40 that obtains is the five-element, 34 characters of every row, white space are 62 characters.This shows, utilize composition method of the present invention, can obtain best composing effect so that the white space of textbox is minimum.
The present invention is a kind of composition method of textbox, utilize line number and the average length of calculating the display text of wanting, and the maximal value that can show by relatively average length and textbox and the minimum value display width of determining textbox, less than the minimum value that textbox can show, the minimum value of then setting textbox is a display width as average length; As judge average length between maximal value and minimum value that textbox can show, and then utilize average length to do the processing of setting type, and calculate the required width of line number minimizing delegation of the part that line feed is arranged, be display width and select wherein minimum width value; If average length greater than the maximal value that textbox can show, is then utilized maximal value to go to set type as width and is handled, and calculates the required width of white space of eliminating each row, is display width and select wherein maximum width value; So,, calculate best display width and go to set type, can make the white space minimum after the composing, obtain best composing effect at the situation of different word contents.
The above only is the present invention's preferred embodiment wherein, is not to be used for limiting practical range of the present invention; All equalizations of doing according to claim of the present invention change and modify, and are claim of the present invention and contain.

Claims (9)

1, a kind of composition method of textbox is characterized in that including at least the following step:
Choose the literal of required demonstration;
Calculate the line number of this literal and the average word length of this each row;
Confirm that this average length is between maximum and minimum widith that this textbox can show;
Set this average length and be the width of this textbox, to the processing of setting type of the literal of this demonstration;
The line number of the literal of this line feed is reduced delegation, and write down its required width;
Minimum widith in the width of this record is set at the display width of this textbox; And
Set type according to the literal that this display width will this required demonstration.
2, the composition method of textbox as claimed in claim 1, it is characterized in that this sets the step that this average length is set type and handled the literal of this demonstration for the width of this textbox, also include record set type this literal line number after handling and the step of each line length.
3, the composition method of textbox as claimed in claim 1, it is characterized in that maximum that this confirms that this average length can show between this textbox and the step between the minimum widith, also include the maximum that this average length of comparison and this textbox can show and the step of minimum widith.
4, the composition method of textbox as claimed in claim 3, it is characterized in that this compares the maximum that this average length and this textbox can show and the step of minimum widith, as judge the minimum widith that this average length can show less than this textbox, then this minimum widith is set at the display width of this textbox.
5, the composition method of textbox as claimed in claim 3, it is characterized in that this compares the maximum that this average length and this textbox can show and the step of minimum widith, as judge that this average length greater than the breadth extreme that this textbox can show, then carries out the following step:
Set this breadth extreme for the width of this textbox to the processing of setting type of the literal of this demonstration;
Utilize the width that changes each row to eliminate the white space of the literal of this demonstration, and write down its required width;
Breadth extreme in the width of this record is set at the display width of this textbox; And
According to this display width will this required demonstration text composition.
6, the composition method of textbox as claimed in claim 5, it is characterized in that setting the step that this breadth extreme is set type and handled the literal of this demonstration for the width of this textbox, also include record set type this literal line number after handling and the step of each line length.
7, the composition method of textbox as claimed in claim 1 is characterized in that this textbox is a textbox that shows in real time.
8, the composition method of textbox as claimed in claim 7 is characterized in that this textbox that shows in real time is the shown textbox of a real time translation software.
9, the composition method of textbox as claimed in claim 1 is characterized in that this textbox is the explanation archives of a software.
CNB011444916A 2001-12-19 2001-12-19 Typesetting method of character frame Expired - Fee Related CN1185594C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB011444916A CN1185594C (en) 2001-12-19 2001-12-19 Typesetting method of character frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB011444916A CN1185594C (en) 2001-12-19 2001-12-19 Typesetting method of character frame

Publications (2)

Publication Number Publication Date
CN1427369A true CN1427369A (en) 2003-07-02
CN1185594C CN1185594C (en) 2005-01-19

Family

ID=4677621

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB011444916A Expired - Fee Related CN1185594C (en) 2001-12-19 2001-12-19 Typesetting method of character frame

Country Status (1)

Country Link
CN (1) CN1185594C (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920811B (en) * 2006-08-31 2010-05-26 北京北大方正电子有限公司 Character typesetting method
CN101430679B (en) * 2007-11-09 2010-08-25 北大方正集团有限公司 Method and device for compressing integral symbol-occupying area
CN102082930A (en) * 2009-11-30 2011-06-01 新奥特(北京)视频技术有限公司 Method and device for replacing caption text
CN102681980A (en) * 2011-03-17 2012-09-19 珠海全志科技股份有限公司 Typesetting processing method and device based on original document
CN102902678A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Text content typesetting method and terminal
CN104424172A (en) * 2013-09-04 2015-03-18 北大方正集团有限公司 Typesetting method, typesetting device and typesetting system
CN105159868A (en) * 2015-09-01 2015-12-16 广东欧珀移动通信有限公司 Text display method and system
CN106095374A (en) * 2016-06-23 2016-11-09 Tcl集团股份有限公司 The method and system that a kind of word size adaptation various countries language shows
CN106649245A (en) * 2015-10-30 2017-05-10 方正国际软件(北京)有限公司 Page layout method and apparatus
CN106873925A (en) * 2015-12-10 2017-06-20 北京国双科技有限公司 The display methods and device of label text
CN111079396A (en) * 2019-12-20 2020-04-28 方正国际软件(北京)有限公司 Typesetting method and device for characters in irregular unit grid

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920811B (en) * 2006-08-31 2010-05-26 北京北大方正电子有限公司 Character typesetting method
CN101430679B (en) * 2007-11-09 2010-08-25 北大方正集团有限公司 Method and device for compressing integral symbol-occupying area
CN102082930B (en) * 2009-11-30 2015-09-30 新奥特(北京)视频技术有限公司 A kind of method that captioned test is replaced and device
CN102082930A (en) * 2009-11-30 2011-06-01 新奥特(北京)视频技术有限公司 Method and device for replacing caption text
CN102681980A (en) * 2011-03-17 2012-09-19 珠海全志科技股份有限公司 Typesetting processing method and device based on original document
CN102681980B (en) * 2011-03-17 2014-08-13 珠海全志科技股份有限公司 Typesetting processing method and device based on original document
CN102902678A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Text content typesetting method and terminal
CN102902678B (en) * 2011-07-26 2015-09-16 腾讯科技(深圳)有限公司 Content of text composition method and terminal
CN104424172A (en) * 2013-09-04 2015-03-18 北大方正集团有限公司 Typesetting method, typesetting device and typesetting system
CN104424172B (en) * 2013-09-04 2018-05-18 北大方正集团有限公司 A kind of composition method, apparatus and system
CN105159868A (en) * 2015-09-01 2015-12-16 广东欧珀移动通信有限公司 Text display method and system
CN106649245A (en) * 2015-10-30 2017-05-10 方正国际软件(北京)有限公司 Page layout method and apparatus
CN106873925A (en) * 2015-12-10 2017-06-20 北京国双科技有限公司 The display methods and device of label text
CN106095374A (en) * 2016-06-23 2016-11-09 Tcl集团股份有限公司 The method and system that a kind of word size adaptation various countries language shows
CN111079396A (en) * 2019-12-20 2020-04-28 方正国际软件(北京)有限公司 Typesetting method and device for characters in irregular unit grid
CN111079396B (en) * 2019-12-20 2023-06-16 方正国际软件(北京)有限公司 Chinese typesetting method and typesetting device for irregular unit cell

Also Published As

Publication number Publication date
CN1185594C (en) 2005-01-19

Similar Documents

Publication Publication Date Title
CN1185594C (en) Typesetting method of character frame
CN101452444B (en) Rapid editing and typesetting method for handwriting information
JP3048330B2 (en) Apparatus and method for extracting articles from documents
CN101876967B (en) Method for generating PDF text paragraphs
DE69916225T2 (en) Method and system for maintaining freeform ink annotations on changing views
US6915484B1 (en) Text reflow in a structured document
CN100356377C (en) Document display method
US6415305B1 (en) Method for displaying editable characters in a divided table cell
US5835920A (en) Dynamic page reduction
US8995768B2 (en) Methods and devices for processing scanned book's data
US20080282149A1 (en) Automated Paragraph Layout
CN1199197A (en) Method and apparatus for prints
CN110765739B (en) Method for extracting form data and chapter structure from PDF document
EP0132456A1 (en) Method and device to check the sentence quality of printed matter, in particular for newspapers
CN109783810A (en) A kind of text handling method, device and computer readable storage medium
Pasternack et al. America's front pages: A 10-year update
CN113962193A (en) Table typesetting method and device, electronic equipment and storage medium
CN113438543A (en) Matching method, device and equipment for converting document into video and storage medium
JPH08255255A (en) Document information layout device and document information display device
JP4018973B2 (en) Automatic allocation method and apparatus for newspaper advertisement
KR20190011422A (en) Cell auto divide device
JP3048942B2 (en) String display device
WO2018077488A9 (en) Method for representing text on a display
JP3560841B2 (en) Topic extraction method and apparatus, and recording medium recording topic extraction program
JP2677442B2 (en) Method of capturing illustrations in editing machine and editing machine

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20050119

Termination date: 20101219