CN101430679B - Method and device for compressing integral symbol-occupying area - Google Patents
Method and device for compressing integral symbol-occupying area Download PDFInfo
- Publication number
- CN101430679B CN101430679B CN2007101771177A CN200710177117A CN101430679B CN 101430679 B CN101430679 B CN 101430679B CN 2007101771177 A CN2007101771177 A CN 2007101771177A CN 200710177117 A CN200710177117 A CN 200710177117A CN 101430679 B CN101430679 B CN 101430679B
- Authority
- CN
- China
- Prior art keywords
- symbol
- width
- height
- compressed
- overall area
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 230000006835 compression Effects 0.000 claims description 27
- 238000007906 compression Methods 0.000 claims description 27
- 230000001960 triggered effect Effects 0.000 claims 2
- 238000010586 diagram Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000013519 translation Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
Images
Landscapes
- Document Processing Apparatus (AREA)
Abstract
The invention discloses a method for compressing a whole region occupied by symbols and a device thereof. The method is used for improving the working efficiency of typesetting and compressing various symbols including Chinese punctuation marks, and obtaining a better typesetting result. The method for compressing the whole region occupied by the symbols comprises the following steps: computing width of circumscribed rectangles of the symbols; and compressing the whole region occupied by the symbols by comparing the width of the circumscribed rectangles of the symbols with the expected width after compressing the whole preset region occupied by the symbols. The method and the device are used for compressing various symbols, and help save space of a whole page, obtain reasonable and beautiful typesetting effect, and improve the typesetting efficiency.
Description
Technical field
The present invention relates to typesetting system field, relate in particular to method and device that a kind of overall region that symbol is taken is compressed.
Background technology
In typesetting system field, the processing meeting of Chinese punctuate is directly influenced the composing effect of whole literal.In order in limited space of a whole page length, to place more contents, need carry out to a certain degree compression to punctuate usually, and guarantee the effect of text composition.
The processing mode of in the prior art punctuate being compressed comprises:
Mode one: the punctuate compression parameters table that existing each font is provided with one group of correspondence at the program internal needle.When actual treatment, different fonts is searched out its corresponding punctuate compression parameters table, by the numerical value in this parameter list, the white space cutting with unnecessary before and after the punctuate font reaches the punctuate compression effects.
But this compress mode is loaded down with trivial details, after a product presets inner parameter, is difficult to support for follow-up emerging font, so cause punctuate compression deformation easily, needs the later stage to adjust, so can reduce work efficiency.In addition, parameter-embedded table is limited, is difficult for expanding.
Mode two: the compression parameters table of punctuate is provided in the program outside, and this parameter list can be described by an external file, and the user can be provided with the front and back compression factor parameter of punctuate to any a font, reaches gratifying effect, thereby strengthens its extendibility.
But also can there be certain deficiency in this kind mode, and it is mainly reflected on the ease for use, for a font that the compression parameters table also is not set, need be configured again, and it is not too easy to configure the compression factor value of compliant, so this kind mode greatly reduces work efficiency.
Summary of the invention
Method and device that the embodiment of the invention provides a kind of overall region that symbol is taken to compress in order to improving the various symbols that the comprise Chinese punctuate work efficiency of compression of setting type, and obtain better composing effect.
The method that a kind of overall region that symbol is taken that the embodiment of the invention provides is compressed comprises:
The width of the boundary rectangle of compute sign;
The comparison that expected width after being compressed by the overall region that the width of the boundary rectangle of described symbol and the described symbol that sets in advance are taken is carried out is compressed the overall region that described symbol takies, and is specially:
During expected width after overall region that the width of the boundary rectangle of described symbol takies more than or equal to the described symbol that sets in advance is compressed, be the width of described symbol boundary rectangle with the width adjustment of described overall region;
During expected width after overall region that the width of the boundary rectangle of described symbol takies less than the described symbol that sets in advance is compressed, with the width adjustment of described overall region is the expected width of described overall region, be specially: according to set in advance in the overall region that described symbol takies, the left side of the boundary rectangle of described symbol/right side blank compressed size in zone or compressed proportionate relationship of left and right sides white space, width to the left and right sides white space of the boundary rectangle of described symbol is adjusted, so that the width of described overall region is the expected width of described overall region.
The method that the another kind that the embodiment of the invention provides compresses the overall region that symbol takies comprises:
The height of the boundary rectangle of compute sign;
The comparison that expection after being compressed by the overall region that the height of the boundary rectangle of described symbol and the described symbol that sets in advance are taken is highly carried out is compressed the overall region that described symbol takies, and is specially:
During expection height after overall region that the height of the boundary rectangle of described symbol takies more than or equal to the described symbol that sets in advance is compressed, be the height of described symbol boundary rectangle with the height control of described overall region;
During expection height after overall region that the height of the boundary rectangle of described symbol takies less than the described symbol that sets in advance is compressed, with the height control of described overall region is the expection height of described overall region, be specially: according to set in advance in the overall region that described symbol takies, on the boundary rectangle of described symbol/compressed size of downside white space or the compressed proportionate relationship of both sides white space up and down, height to the white space of both sides up and down of the boundary rectangle of described symbol is adjusted, so that the height of described overall region is the expection height of described overall region.
The device that a kind of overall region that symbol is taken that the embodiment of the invention provides is compressed comprises:
The boundary rectangle computing unit is used for the width of the boundary rectangle of compute sign;
Compression unit, the comparison that expected width after being used for being compressed by the overall region that the width of the boundary rectangle of described symbol and the described symbol that sets in advance are taken is carried out, the overall region that described symbol takies is compressed, comprise: comparing unit, first adjustment unit and second adjustment unit, wherein:
Described comparing unit, expected width after being used for the overall region that the width of the boundary rectangle of described symbol and the described symbol that sets in advance take is compressed compares, during expected width after overall region that the width of the boundary rectangle of described symbol takies more than or equal to the described symbol that sets in advance is compressed, trigger described first adjustment unit, during expected width after overall region that the width of the boundary rectangle of described symbol takies less than the described symbol that sets in advance is compressed, trigger described second adjustment unit;
Described first adjustment unit when being used to receive the triggering of described comparing unit, is the width of described symbol boundary rectangle with the width adjustment of described overall region;
Described second adjustment unit, when being used to receive the triggering of described comparing unit, with the width adjustment of described overall region is the expected width of described overall region, be specially: according to set in advance in the overall region that described symbol takies, the left side of the boundary rectangle of described symbol/right side blank compressed size in zone or compressed proportionate relationship of left and right sides white space, width to the left and right sides white space of the boundary rectangle of described symbol is adjusted, so that the width of described overall region is the expected width of described overall region.
The device that the another kind that the embodiment of the invention provides compresses the overall region that symbol takies comprises:
The boundary rectangle computing unit is used for the height of the boundary rectangle of compute sign;
Compression unit, the comparison that expection after being used for being compressed by the overall region that the height of the boundary rectangle of described symbol and the described symbol that sets in advance are taken is highly carried out, the overall region that described symbol takies is compressed, comprise: comparing unit, first adjustment unit and second adjustment unit, wherein:
Described comparing unit, expection after being used for the overall region that the height of the boundary rectangle of described symbol and the described symbol that sets in advance take is compressed highly compares, during expection height after overall region that the height of the boundary rectangle of described symbol takies more than or equal to the described symbol that sets in advance is compressed, trigger described first adjustment unit, during expection height after overall region that the height of the boundary rectangle of described symbol takies less than the described symbol that sets in advance is compressed, trigger described second adjustment unit;
Described first adjustment unit when being used to receive the triggering of described comparing unit, is the height of described symbol boundary rectangle with the height control of described overall region;
Described second adjustment unit, when being used to receive the triggering of described comparing unit, with the height control of described overall region is the expection height of described overall region, be specially: according to set in advance in the overall region that described symbol takies, on the boundary rectangle of described symbol/compressed size of downside white space or the compressed proportionate relationship of both sides white space up and down, height to the white space of both sides up and down of the boundary rectangle of described symbol is adjusted, so that the height of described overall region is the expection height of described overall region.。
The embodiment of the invention, the width of the boundary rectangle of compute sign; The comparison that expected width after being compressed by the overall region that the width of the boundary rectangle of described symbol and the described symbol that sets in advance are taken is carried out is compressed the overall region that described symbol takies.By this technical scheme, the composing compression that has realized various symbols are carried out has improved composing efficient, and can obtain composing effect attractive in appearance rationally, has saved the space of a whole page.
Description of drawings
The method flow synoptic diagram that Fig. 1 compresses for the overall region that symbol is taken that the embodiment of the invention provides;
The position view of overall region that the symbol that Fig. 2 provides for the embodiment of the invention takies and symbol boundary rectangle;
When the punctuate that Fig. 3 provides for the embodiment of the invention is set to split, to the effect synoptic diagram of the shared overall region boil down to half-breadth of punctuate;
Fig. 4 is not for all to carry out the compression effects synoptic diagram to the shared overall region of the punctuate in the passage;
The overall region that the punctuate that the expression sentence is finished that Fig. 5 provides for the embodiment of the invention takies is not compressed, the effect synoptic diagram of the overall region boil down to half-breadth that other punctuates are taken;
The effect synoptic diagram of the overall region boil down to half-breadth that all punctuates are taken that Fig. 6 provides for the embodiment of the invention;
The apparatus structure synoptic diagram that Fig. 7 compresses for the overall region that symbol is taken that the embodiment of the invention provides.
Embodiment
The embodiment of the invention, the method and the device that provide a kind of overall region that symbol is taken to compress.In order to realize the size of the overall region that automatic compressed symbolic is shared, obtain composing effect attractive in appearance rationally, and, improve composing efficient.
Below in conjunction with accompanying drawing, the specific implementation of the embodiment of the invention is introduced.
Be that the situation of laterally setting type is an example with Chinese punctuation mark and literal in the embodiment of the invention, illustrate that the overall region that symbol is taken is compressed how to realize.
Referring to Fig. 1, the method that a kind of overall region that symbol is taken that the embodiment of the invention provides is compressed comprises:
S101, the expected width after setting in advance overall region that punctuate takies and being compressed, for example, the overall region expected width is set to half of current overall region width.
S102, the width and the lateral attitude of calculating the boundary rectangle of punctuate.
With the fullstop is example, and the position of the overall region that the boundary rectangle of punctuate and punctuate take as shown in Figure 2.
S103, judge the punctuate boundary rectangle width whether more than or equal to the expected width of the overall region of punctuate, if then carry out step S104; Otherwise, carry out step S105.
The width adjustment of S104, overall region that punctuate is taken is the width of punctuate boundary rectangle, be about to the width value of punctuate self, will follow the punctuate character afterwards width value in translation boundary rectangle right side blank zone to the left closely to left boundary rectangle left side white space.
In order to guarantee the complete of punctuation mark, at the boundary rectangle width of punctuate during, be punctuate boundary rectangle width with the overall region width adjustment of punctuate more than or equal to the expected width of overall region.
S105, with 1/2nd of the difference of the expected width of the overall region of punctuate and punctuate boundary rectangle width, as the expected width in a punctuate boundary rectangle left side/right side blank zone.
After promptly adjusting, the punctuate in overall region is placed in the middle about being.
S106, judge punctuate boundary rectangle left side white space width whether greater than the expected width of left side white space, if, execution in step S107 then; Otherwise, execution in step S108.
S107, be left side white space expected width with punctuate boundary rectangle left side white space width adjustment.
After promptly calculating the difference of expected width of the current width of punctuate boundary rectangle left side white space and left side white space, with the punctuate distance of this difference of translation to the left.
The white space width is constant on the left of S108, the maintenance punctuate boundary rectangle.
S109, expected width, punctuate boundary rectangle width according to the overall region of punctuate and handle through step S107 or S108 after punctuate boundary rectangle left side white space width, adjust the width in punctuate boundary rectangle right side blank zone.
After promptly calculating the difference of expected width in the current width in punctuate boundary rectangle right side blank zone and right side blank zone, will be immediately following the distance of this difference of translation to the left of the character after this punctuate.
The expected width of the expected width of the overall region of above-mentioned punctuate and left and right sides white space all is to be provided with according to user's needs, be not limited to a kind of situation of present embodiment, promptly except the common overall region boil down to half-breadth to punctuate, also compressible is 3/4 wide, 2/5 various width such as wide; The method of a left side/right blank width after calculating the expection compression, can also be according to the size between the white space of the left and right sides, the size according to the expection compression will need the white space of " cutting out " proportionally " to cut out ".
Punctuate is set to split, and the width adjustment that is about to the overall region that all punctuates take is original half, then adopts method that the embodiment of the invention provides to the effect of the shared overall region boil down to half-breadth of punctuate as shown in Figure 3.
Punctuate in the passage is set to whole body, be that the shared overall region of punctuate in this section literal is not all carried out compression effects as shown in Figure 4, and the method punctuate that utilizes the embodiment of the invention to provide is set to enlightenment, promptly the overall region that takies of the punctuate (as fullstop) that the expression sentence is finished is not compressed, and the effect after the overall region boil down to half-breadth that other punctuates are taken as shown in Figure 5.The method of utilizing the embodiment of the invention to provide is set to split to punctuate, and promptly the effect of the overall region boil down to half-breadth that all punctuates are taken as shown in Figure 6.By contrast to Fig. 4 and Fig. 5 and Fig. 6, as can be seen, after by the method that adopts the embodiment of the invention to provide the shared overall region of punctuate being compressed adjustment, make that the composing effect of text on the space of a whole page is more attractive in appearance, then can save the space of a whole page largely for a large amount of texts, improve the work efficiency of space of a whole page compression simultaneously.
Literal is that the situation of vertically setting type is identical with the reason of laterally setting type, and the promptly above-mentioned left and right sides is equivalent to both sides up and down, and width is equivalent to height.
Introduce the device that the embodiment of the invention provides below.
Referring to Fig. 7, the device that a kind of overall region that symbol is taken that the embodiment of the invention provides is compressed comprises:
Boundary rectangle computing unit 71 is used for the width of the boundary rectangle of compute sign.
Described compression unit 72 comprises: comparing unit 721, first adjustment unit 722 and second adjustment unit 723.
Described comparing unit 721, expected width after being used for the overall region that the width of the boundary rectangle of described symbol and the described symbol that sets in advance take is compressed compares, during expected width after overall region that the width of the boundary rectangle of described symbol takies more than or equal to the described symbol that sets in advance is compressed, trigger described first adjustment unit 722; During expected width after overall region that the width of the boundary rectangle of described symbol takies less than the described symbol that sets in advance is compressed, trigger described second adjustment unit 723.
Described first adjustment unit 722 when being used to receive the triggering of described comparing unit 721, is the width of described symbol boundary rectangle with the width adjustment of described overall region.
Described second adjustment unit 723 when being used to receive the triggering of described comparing unit 721, is the expected width of described overall region with the width adjustment of described overall region.
Preferably, when described second adjustment unit 723 receives the triggering of described comparing unit 721, according to set in advance in the overall region that described symbol takies, the left side of the boundary rectangle of described symbol/right side blank compressed size in zone or compressed proportionate relationship of left and right sides white space, width to the left and right sides white space of the boundary rectangle of described symbol is adjusted, so that the width of described overall region is the expected width of described overall region.
In like manner, the device that compresses of the another kind that provides of the embodiment of the invention overall region that symbol is taken comprises:
The boundary rectangle computing unit is used for the height of the boundary rectangle of compute sign.
Compression unit, the comparison that the expection after being used for being compressed by the overall region that the height of the boundary rectangle of described symbol and the described symbol that sets in advance are taken is highly carried out is compressed the overall region that described symbol takies.
In sum, the embodiment of the invention connects the expected width of the width of the overall region that the width of rectangle and the symbol that sets in advance take by the comparison operators extra, in the overall region that symbol is taken, the width of the left side of symbol boundary rectangle/right white space is adjusted, thereby reaches the effect of the width of the overall region that automatic compressed symbolic takies.Therefore, the technical scheme that adopts the embodiment of the invention to provide, the overall region that can be the more various symbols of the punctuate that comprises various fonts be taken is compressed, and obtaining composing effect attractive in appearance rationally, and can improve composing efficient.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101771177A CN101430679B (en) | 2007-11-09 | 2007-11-09 | Method and device for compressing integral symbol-occupying area |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101771177A CN101430679B (en) | 2007-11-09 | 2007-11-09 | Method and device for compressing integral symbol-occupying area |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101430679A CN101430679A (en) | 2009-05-13 |
CN101430679B true CN101430679B (en) | 2010-08-25 |
Family
ID=40646085
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2007101771177A Expired - Fee Related CN101430679B (en) | 2007-11-09 | 2007-11-09 | Method and device for compressing integral symbol-occupying area |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101430679B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5842517B2 (en) * | 2011-09-30 | 2016-01-13 | セイコーエプソン株式会社 | Printing apparatus and printing apparatus control method |
CN106445904A (en) * | 2016-09-30 | 2017-02-22 | 乐视控股(北京)有限公司 | Page typesetting method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0382402A2 (en) * | 1989-02-07 | 1990-08-16 | Canon Kabushiki Kaisha | Character processing apparatus |
EP0821312A2 (en) * | 1996-07-23 | 1998-01-28 | Adobe Systems Incorporated | Pointsize-variable character spacing |
CN1427369A (en) * | 2001-12-19 | 2003-07-02 | 英业达股份有限公司 | Typesetting method of text box |
CN101013418A (en) * | 2007-02-15 | 2007-08-08 | 北京大学 | Auto-adaptive typesetting method for word in textbox |
-
2007
- 2007-11-09 CN CN2007101771177A patent/CN101430679B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0382402A2 (en) * | 1989-02-07 | 1990-08-16 | Canon Kabushiki Kaisha | Character processing apparatus |
EP0821312A2 (en) * | 1996-07-23 | 1998-01-28 | Adobe Systems Incorporated | Pointsize-variable character spacing |
CN1427369A (en) * | 2001-12-19 | 2003-07-02 | 英业达股份有限公司 | Typesetting method of text box |
CN101013418A (en) * | 2007-02-15 | 2007-08-08 | 北京大学 | Auto-adaptive typesetting method for word in textbox |
Non-Patent Citations (2)
Title |
---|
曹恒来.WPS文字2005特色新功能.应用经验 93.2006,(93),44-45. |
曹恒来.WPS文字2005特色新功能.应用经验 93.2006,(93),44-45. * |
Also Published As
Publication number | Publication date |
---|---|
CN101430679A (en) | 2009-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101013418A (en) | Auto-adaptive typesetting method for word in textbox | |
CN1828580B (en) | A Typesetting Method of Matrix Text Box Adapting to Text Content | |
CN101430679B (en) | Method and device for compressing integral symbol-occupying area | |
CN104102407B (en) | A kind of parameter input method and system | |
JPH06176188A (en) | Method and device for preparing information on recognized characters | |
CN106372639B (en) | A segmentation method of printed Uyghur documents based on morphology and integral projection | |
CN111859490A (en) | Parameterization arrangement method for tire sidewall fonts | |
US8582165B2 (en) | Document processing apparatus | |
EP1494150A3 (en) | Engineering drawing data extraction | |
CN101673406B (en) | Method and device for setting font | |
JP2010140199A (en) | Information processor, display change method and display change program | |
KR20090127038A (en) | Information display device, information display method and computer readable storage medium | |
JP2003233825A (en) | Document processor | |
CN1821995B (en) | A Typesetting Method of Straight-edge Text Frame Adapting to Text Content | |
CN107128016A (en) | A kind of paper crease template | |
CN105824485B (en) | A kind of method for displaying textbox and device | |
CN206953683U (en) | A kind of paper crease template | |
CN101140567B (en) | Method and system for realizing typeset horizontally to portion words in vertical typeset words stream | |
CN207088597U (en) | A kind of cardboard cornerite apparatus for shaping | |
CN104516866B (en) | The method of typesetting along word | |
CN103495842B (en) | The improvement Processes and apparatus of winding gate tube connector hinge hole processing | |
JP4770285B2 (en) | Image processing apparatus and control program therefor | |
CN205414121U (en) | Product tears a design device | |
CN207188508U (en) | A kind of both sides flattening mechanism of aluminium strip | |
CN207171034U (en) | A kind of grooved bit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20100825 Termination date: 20191109 |