CN105260352A - Automatic typesetting method for streaming text - Google Patents

Automatic typesetting method for streaming text Download PDF

Info

Publication number
CN105260352A
CN105260352A CN201510597702.7A CN201510597702A CN105260352A CN 105260352 A CN105260352 A CN 105260352A CN 201510597702 A CN201510597702 A CN 201510597702A CN 105260352 A CN105260352 A CN 105260352A
Authority
CN
China
Prior art keywords
page
automatically
text
line
row
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.)
Pending
Application number
CN201510597702.7A
Other languages
Chinese (zh)
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.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
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 Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN201510597702.7A priority Critical patent/CN105260352A/en
Publication of CN105260352A publication Critical patent/CN105260352A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses an automatic typesetting method for streaming texts. The method comprises the following steps: (1) automatically obtaining terminal device information; (2) automatically setting page parameters and creating a typesetting page; (3) automatically selecting a typesetting template; (4) automatically pre-composing; (5) automatically verifying a pre-composing result. A computer technology is used to traverse and examine texts while showing and rearranging an initial streaming text, the text is operated, so the text meets typesetting rules and can be shown in a standard manner.

Description

A kind of automatic composing method of stream text
Technical field
The present invention relates to computing machine, mobile terminal and type-setting domain, particularly relate to a kind of automatic composing method of stream text.
Background technology
The word that streaming typesetting refers to contain document package, numeral, chart and figure image process, content after preservation is original editor's element, user can view the typesetting style after editor by ocr software, and can self-adaptation space of a whole page size display between different zoom ratio.Performance best on the E-book reader of the small screen to initial space of a whole page automatic re-arrangement, can adjust the line feed of paragraph to adapt to the field range of single page according to screen width after amplifying.
Stream text, based on xml technology, realizes the separation of content and form, but does not consider best to present effect for different terminals, and still there will be bottom line title, individual character is embarked on journey and waited Chinese taboo problem then.Current technology is that simple convection type text is reset, and does not consider that the specification of convection type text controls.
Summary of the invention
The present invention is directed to the deficiencies in the prior art, a kind of automatic composing method of stream text is provided.
A kind of automatic composing method of stream text comprises the steps: (1) automatic acquisition terminal device information.(2) automatically set page parameter and create typesetting page.(3) automatically layout template is selected.(4) automatic pre-typesetting.(5) automatically pre-typesetting result is verified.
Further, the step (1) in the present invention comprises further: comprise terminal system type, terminal device resolution by the terminal device recognition technology automatic acquisition terminal device information based on WURFL.
Further, the step (2) in the present invention comprises further: page parameter comprises pagewidth, page height, page subfield, column gutter, top margin, bottom margin, left side distance and rightmargin.Automatically the size of pagewidth, page height and type page is set according to terminal device resolution.
Further, the step (3) in the present invention comprises further: need for terminal device information, and the mapping relations according to terminal device layout template mapping table select corresponding layout template automatically.
Further, described step (4) in the present invention comprises further: by loading type-setting document and layout template, the text node of traversal type-setting document, by the mapping relations of the same name of the style information in type-setting document Chinese version node and layout template, carries out pre-typesetting automatically on the page.
Further, the described step (5) in the present invention comprises further: carry out traversal inspection by computing machine to text, checking pre-typesetting result, automatically revises not meeting Chinese taboo situation then.Chinese prohibits that situation about then verifying comprises that individual character is embarked on journey, single file becomes page, whether bottom line title and natural paragraph meet Kinsoku, the need of first trip indentation.
Individual character is embarked on journey and is referred to that character accounts for a line within six, and a no more than Chinese character.If this line character number is within three, automatically reduces up character-spacing, this row content is reduced to lastrow; If this line character number is greater than three, automatically strengthens up character-spacing, up separable character is moved on to this row.
Single file becomes page to refer to, and whole text paragraphs of one page only have a line.Single file becomes the disposal route of page to be the paragraph line-spacing automatically adjusting page up, makes this row be reduced to page up.
Bottom line title refers to that title appears at version end, and topic is lower to text.Bottom line title generally can with changing the correction of text fragment line-spacing.Avoid the method for bottom line title to be automatically a line is gone in the contracting of the text of page up (or several pages), the text of lower one page is moved up a row simultaneously; Or automatically title is moved on to the upper end of lower one page, the text of page up (or several pages) is stretched out a few row simultaneously and supply blank position, if really can not supply, the end of page up can be allowed to have a line blank.
Kinsoku refers to that paragragh head does not allow and occurs fullstop, comma, pause mark, exclamation, question mark, colon, unquote, rear quotation marks, rear punctuation marks used to enclose the title etc., paragragh tail do not allow occur before quotation marks, left-hand bracket, front punctuation marks used to enclose the title, dash and suspension points can not from centre the separately first and section tail of the section of coming.If paragragh does not meet Kinsoku, general employing stretches row's method or method of indenting.Stretch the footprint that row's method is punctuation mark in automatically increasing by a section, stretch out the several word section of coming footline head.The method of indenting automatically is changed into by full-shape punctuation mark to split, and indentation one line position, comes upper every trade end by the punctuation mark that row is first.
First trip indentation is by distance certain for the indentation from left to right of the first row of paragraph, and each provisional capital outside first trip remains unchanged.English typesetting does not need first trip indentation, and chinese typeset wants first trip indentation two characters.First judge whether this stream text is Chinese, if Chinese, according to text font size poundage, the indentation distance of Lookup protocol two characters carries out first trip indentation.If English, do not need to carry out first trip indentation.
The present invention, while presenting initial stream text and resetting, utilizes computer technology to travel through and checks text, operate, make text meet typesetting rule to text, can specification present.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the inventive method.
Embodiment
For making above-mentioned purpose of the present invention, feature and advantage become apparent more, and below in conjunction with the drawings and specific embodiments, the present invention is described in further detail:
Fig. 1 is the process flow diagram of the method for the invention, the present invention includes following several step as shown in the figure:
Step (1): automatic acquisition terminal device information.
Terminal system type, terminal device resolution is comprised by the terminal device recognition technology automatic acquisition terminal device information based on WURFL.First terminal device recognition technology based on WURFL judges that access equipment is pc or mobile device.Automatically by the useragent field in WURFL.XML, the information such as device resolution are obtained for mobile device.
Step (2): automatically set page parameter and create typesetting page.
Page parameter comprises pagewidth, page height, page subfield, column gutter, top margin, bottom margin, left side distance and rightmargin.Automatically the size of pagewidth, page height and type page is set according to terminal device resolution.
Step (3): automatically select layout template.
Stream text is reset for screen width, and therefore layout template makes for different access device types and screen width interval.Layout template is with XLST language compilation and preserve.For terminal device information, the mapping relations according to terminal device layout template mapping table select corresponding layout template automatically.
Described layout template mapping table is as follows:
Step (4): pre-typesetting automatically.
Load type-setting document and layout template, the text node of traversal type-setting document, by the mapping relations of the same name of the style information in type-setting document Chinese version node and layout template, carries out pre-typesetting automatically on the page.Type-setting document is with xml language compilation and preserve.
Described mapping relations are as follows:
Type-setting document XML node Layout template style name
Title Title
Subtitle Subtitle
Abstract Abstract
Key Words Key Words
Author Author
Body Body
…… ……
Step (5): automatically pre-typesetting result is verified.
By computing machine, traversal inspection being carried out to text, checking pre-typesetting result, automatically revising not meeting Chinese taboo situation then.Chinese prohibits that situation about then verifying comprises that individual character is embarked on journey, single file becomes page, whether bottom line title and natural paragraph meet Kinsoku, the need of first trip indentation.
Individual character is embarked on journey and is referred to that character accounts for a line within six, and a no more than Chinese character.If this line character number is within three, automatically reduces up character-spacing, this row content is reduced to lastrow; If this line character number is greater than three, automatically strengthens up character-spacing, up separable character is moved on to this row.
Single file becomes page to refer to, and whole text paragraphs of one page only have a line.Single file becomes the disposal route of page to be the paragraph line-spacing automatically adjusting page up, makes this row be reduced to page up.
Bottom line title refers to that title appears at version end, and topic is lower to text.Bottom line title generally can with changing the correction of text fragment line-spacing.Avoid the method for bottom line title to be automatically a line is gone in the contracting of the text of page up (or several pages), the text of lower one page is moved up a row simultaneously; Or automatically title is moved on to the upper end of lower one page, the text of page up (or several pages) is stretched out a few row simultaneously and supply blank position, if really can not supply, the end of page up can be allowed to have a line blank.First line by line inspection is traveled through to the original text after pre-typesetting.Obtain current text title, text font size pixel value, the information such as the pixel of line space.When being checked through bottom line title, paying the utmost attention to and lower one page text is moved up a row.The line-spacing of one section before automatic acquisition title, reduces the line-spacing of a section above, resets one section of text above, whether circular test exists bottom line title situation, if adjust one section of line-spacing also not satisfy condition, then adjust the preceding paragraph and to fall line-spacing, until satisfy condition.
Kinsoku refers to that paragragh head does not allow and occurs fullstop, comma, pause mark, exclamation, question mark, colon, unquote, rear quotation marks, rear punctuation marks used to enclose the title etc., paragragh tail do not allow occur before quotation marks, left-hand bracket, front punctuation marks used to enclose the title, dash and suspension points can not from centre the separately first and section tail of the section of coming.If paragragh does not meet Kinsoku, general employing stretches row's method or method of indenting.Stretch the footprint that row's method is the punctuation mark automatically added in Da I Member, stretch out the several word section of coming footline head.The method of indenting automatically is changed into by full-shape punctuation mark to split, and indentation one line position, comes upper every trade end by the punctuation mark that row is first.First line by line inspection is traveled through to the original text after pre-typesetting, obtain the information such as punctuation mark full-shape half-angle, position.Not meeting Kinsoku when being checked through paragragh, automatically navigating to each punctuate position of this paragragh, the full-shape half-angle of each punctuate is adjusted.
First trip indentation is by distance certain for the indentation from left to right of the first row of paragraph, and each provisional capital outside first trip remains unchanged.English typesetting does not need first trip indentation, and chinese typeset wants first trip indentation two characters.First judge whether this stream text is Chinese, if Chinese, according to text font size poundage, the indentation distance arranging two characters carries out first trip indentation.If English, do not need to carry out first trip indentation.First concrete grammar travels through inspection line by line to original text.Judge whether this stream text is Chinese according to text attribute, if Chinese, automatically navigate to each paragragh section first, according to text font size pixel count, the indentation distance converting two characters to carries out first trip indentation.If not Chinese but English, do not need to carry out first trip indentation.
It is more than detailed description of preferred embodiments of the present invention; but those of ordinary skill in the art it is to be appreciated that; within the scope of the present invention with under spiritual guidance, various improvement is added and replaced is all possible, and these are all in the protection domain that the claims in the present invention limit.

Claims (10)

1. an automatic composing method for stream text, is characterized in that comprising the following steps:
Step one: automatic acquisition terminal device information;
Step 2: automatically set page parameter and create typesetting page;
Step 3: automatically select layout template;
Step 4: pre-typesetting automatically;
Step 5: automatically pre-typesetting result is verified.
2. method according to claim 1, is characterized in that: described step one: automatic acquisition terminal device information comprises terminal system type, terminal device resolution.
3. method according to claim 1, is characterized in that: described step 2: page parameter comprises pagewidth, page height, page subfield, column gutter, top margin, bottom margin, left side distance and rightmargin; Automatically the size of pagewidth, page height and type page is set according to terminal device resolution.
4. method according to claim 1, is characterized in that: described step 3: for terminal device information, and the mapping relations according to terminal device layout template mapping table select corresponding layout template automatically.
5. method according to claim 1, it is characterized in that: described step 4: load type-setting document and layout template, the text node of traversal type-setting document, by the mapping relations of the style information in type-setting document Chinese version node and layout template, carries out pre-typesetting automatically on the page.
6. method according to claim 1, is characterized in that: described step 5: carry out traversal inspection by computing machine to text, checking pre-typesetting result, automatically revises not meeting Chinese taboo situation then.
7. method according to claim 6, is characterized in that: Chinese prohibits that situation about then verifying comprises that individual character is embarked on journey, single file becomes page, whether bottom line title and natural paragraph meet Kinsoku, the need of first trip indentation.
8. method according to claim 7, is characterized in that: individual character is embarked on journey and referred to that character accounts for a line within six, and a no more than Chinese character; If this line character number is within three, automatically reduces up character-spacing, this row content is reduced to lastrow; If this line character number is greater than three, automatically strengthens up character-spacing, up separable character is moved on to this row; Single file becomes page to refer to, and whole text paragraphs of one page only have a line; Single file becomes the disposal route of page to be the paragraph line-spacing automatically adjusting page up, makes this row foreshorten to page up; Bottom line title refers to that title appears at version end, and topic is lower to text; Bottom line title generally can with changing the correction of text fragment line-spacing; Avoid the method for bottom line title to be automatically a line is gone in the text contracting of page up or several pages, the text of lower one page is moved up a row simultaneously; Or automatically title is moved on to the upper end of lower one page, the text of page up or several pages is stretched out the position that a few row supplies blank simultaneously, if really can not supply, the end of page up can be allowed to have a line blank.
9. method according to claim 7, it is characterized in that: Kinsoku refers to that paragragh head does not allow and occurs fullstop, comma, pause mark, exclamation, question mark, colon, unquote, rear quotation marks, rear punctuation marks used to enclose the title, paragragh tail do not allow occur before quotation marks, left-hand bracket, front punctuation marks used to enclose the title, dash and suspension points can not from centre the separately first and section tail of the section of coming; If paragragh does not meet Kinsoku, adopt and stretch row's method or method of indenting; Stretch the footprint that row's method is the punctuation mark automatically added in Da I Member, stretch out the several word section of coming footline head; The method of indenting automatically is changed into by full-shape punctuation mark to split, and indentation one line position, comes upper every trade end by the punctuation mark that row is first.
10. method according to claim 7, is characterized in that: first trip indentation is by distance certain for the indentation from left to right of the first row of paragraph, and each provisional capital outside first trip remains unchanged; English typesetting does not need first trip indentation, and chinese typeset wants first trip indentation two characters; First judge whether this stream text is Chinese, if Chinese, according to text font size poundage, the indentation distance of Lookup protocol two characters carries out first trip indentation; If English, do not need to carry out first trip indentation.
CN201510597702.7A 2015-09-20 2015-09-20 Automatic typesetting method for streaming text Pending CN105260352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510597702.7A CN105260352A (en) 2015-09-20 2015-09-20 Automatic typesetting method for streaming text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510597702.7A CN105260352A (en) 2015-09-20 2015-09-20 Automatic typesetting method for streaming text

Publications (1)

Publication Number Publication Date
CN105260352A true CN105260352A (en) 2016-01-20

Family

ID=55100048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510597702.7A Pending CN105260352A (en) 2015-09-20 2015-09-20 Automatic typesetting method for streaming text

Country Status (1)

Country Link
CN (1) CN105260352A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955947A (en) * 2016-04-29 2016-09-21 南宁职业技术学院 Automatic picture typesetting method based on typesetting template
CN107562704A (en) * 2017-08-01 2018-01-09 浙江鸿程计算机系统有限公司 A kind of method that Fastreport templates are quickly generated based on word
CN107688557A (en) * 2016-08-03 2018-02-13 北大方正集团有限公司 Composition method, composing system and terminal
CN108121693A (en) * 2016-11-29 2018-06-05 珠海金山办公软件有限公司 A kind of lantern slide beautification method and device
CN109740141A (en) * 2019-01-10 2019-05-10 成都品果科技有限公司 A method of typesetting beautification is carried out to text based on canvas
CN111797591A (en) * 2020-07-06 2020-10-20 北京字节跳动网络技术有限公司 Layout recovery method and device and electronic equipment
CN112307713A (en) * 2020-10-27 2021-02-02 广州朗国电子科技有限公司 Automatic text typesetting method and system based on Android system
CN113569532A (en) * 2021-09-22 2021-10-29 北京仁和汇智信息技术有限公司 HTML editing method and device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286211A (en) * 2007-04-12 2008-10-15 中国移动通信集团公司 Mobile office system and method
CN102081600A (en) * 2011-01-25 2011-06-01 珠海全志科技有限公司 E-book typesetting method and e-book typesetting system
CN102760157A (en) * 2012-06-05 2012-10-31 百度在线网络技术(北京)有限公司 Method, device and equipment used for generating release information corresponding to mobile terminal
CN104166641A (en) * 2014-08-06 2014-11-26 方卿 Electronic book generating method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286211A (en) * 2007-04-12 2008-10-15 中国移动通信集团公司 Mobile office system and method
CN102081600A (en) * 2011-01-25 2011-06-01 珠海全志科技有限公司 E-book typesetting method and e-book typesetting system
CN102760157A (en) * 2012-06-05 2012-10-31 百度在线网络技术(北京)有限公司 Method, device and equipment used for generating release information corresponding to mobile terminal
CN104166641A (en) * 2014-08-06 2014-11-26 方卿 Electronic book generating method and device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955947A (en) * 2016-04-29 2016-09-21 南宁职业技术学院 Automatic picture typesetting method based on typesetting template
CN105955947B (en) * 2016-04-29 2019-03-08 南宁职业技术学院 Photo automatic composing method based on layout template
CN107688557A (en) * 2016-08-03 2018-02-13 北大方正集团有限公司 Composition method, composing system and terminal
CN108121693A (en) * 2016-11-29 2018-06-05 珠海金山办公软件有限公司 A kind of lantern slide beautification method and device
CN107562704A (en) * 2017-08-01 2018-01-09 浙江鸿程计算机系统有限公司 A kind of method that Fastreport templates are quickly generated based on word
CN107562704B (en) * 2017-08-01 2020-06-23 浙江鸿程计算机系统有限公司 Method for rapidly generating Fastreport template based on word
CN109740141A (en) * 2019-01-10 2019-05-10 成都品果科技有限公司 A method of typesetting beautification is carried out to text based on canvas
CN111797591A (en) * 2020-07-06 2020-10-20 北京字节跳动网络技术有限公司 Layout recovery method and device and electronic equipment
CN111797591B (en) * 2020-07-06 2024-04-26 北京字节跳动网络技术有限公司 Layout recovery method and device and electronic equipment
CN112307713A (en) * 2020-10-27 2021-02-02 广州朗国电子科技有限公司 Automatic text typesetting method and system based on Android system
CN113569532A (en) * 2021-09-22 2021-10-29 北京仁和汇智信息技术有限公司 HTML editing method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN105260352A (en) Automatic typesetting method for streaming text
CN105159877B (en) A kind of across media automatic typesetting systems and its method
US7705848B2 (en) Method of identifying semantic units in an electronic document
US9460089B1 (en) Flow rendering of annotation characters
US10210148B2 (en) Method and apparatus for file processing
US8386943B2 (en) Method for query based on layout information
JP2016042349A (en) Automatic method for division into chapters and sections
US9535880B2 (en) Method and apparatus for preserving fidelity of bounded rich text appearance by maintaining reflow when converting between interactive and flat documents across different environments
US9886426B1 (en) Methods and apparatus for generating an efficient SVG file
CN103176956B (en) For the method and apparatus extracting file structure
CN111695414B (en) Document processing method and device, electronic equipment and computer readable storage medium
CN104516859A (en) Character correcting method and system
CN106708801B (en) Proofreading method for text
CN106776527B (en) Electronic book data display method and device and terminal equipment
US20150331837A1 (en) Text processing method and mobile terminal
CN104156345A (en) Method and device for identifying explanatory text in portable document format file
US10839206B2 (en) Information processing device and method performing character recognition on document image data masked or not based on text image count
CN111126007B (en) HTM L-based medical record document paging algorithm
WO2014050562A1 (en) Sequence correction device for paragraph region, as well as method for controlling operation thereof and program for controlling operation thereof
KR101999549B1 (en) Cell auto divide device
CN101673406A (en) Method and device for setting font
US10936893B2 (en) Information processing device and method for document image extraction, composite image generation, and OCR processing including display of reading resolution instructions based on character density
JP2007241355A (en) Image processor and image processing program
US10659648B2 (en) Printing apparatus and text input program
CN112437354B (en) Subtitle display control method and display equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160120

WD01 Invention patent application deemed withdrawn after publication