CN103353863B - A kind of text template generates method - Google Patents
A kind of text template generates method Download PDFInfo
- Publication number
- CN103353863B CN103353863B CN201310203820.6A CN201310203820A CN103353863B CN 103353863 B CN103353863 B CN 103353863B CN 201310203820 A CN201310203820 A CN 201310203820A CN 103353863 B CN103353863 B CN 103353863B
- Authority
- CN
- China
- Prior art keywords
- text
- attribute
- frame
- template
- shade
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/117—Tagging; Marking up; Designating a block; Setting of attributes
-
- 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/186—Templates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Document Processing Apparatus (AREA)
- Processing Or Creating Images (AREA)
Abstract
The present invention relates to a kind of text template and generate method, invention utilizes XML language to describe text style feature, and then achieves text style and content of text is separated;By implementing Collision Detection, take full advantage of the remaining space of irregular image, it is achieved that a lot of traditional text inaccessiable effects of pattern, also allow the layout more hommization of text.Due to the cross-platform transmission feature of XML language, the present invention makes user have more text style available, improves the reading experience of user.The present invention is applicable to the applied environments such as e-book, blog, Email, multimedia message, instant chat.
Description
Technical field
The present invention relates to Computer Graphic Demonstration field, especially relating to one can realize accurately e-text pattern
The text template controlled generates method, and the pattern template that this method generates can allow e-text content separate with pattern layout, allows
User can freely select e-text.
Background technology
Currently known dynamic electron text style (such as CSS) is all to be laid out in units of rectangular box
's.This layout method has realization simply and the advantage of the beneficially maintenance of document flow, but at a lot of personalized patterns
Comprising substantial amounts of irregular figure object in design, these object frameworks represent can waste big quantity space, the cloth that impact is overall
Office is attractive in appearance, and the most this layout mechanism also brings difficulty for its realization, affects the experience of user.Current static text
Display format is mostly based on TXT and PDF, although these forms store efficient, easy to use not being provided that and allow user
The function of self-defined text style in addition to font.Although the image processing tool such as PHOTOSHOP can allow user make
Go out the text style of complexity, but need when user needs possess certain software operative knowledge and use constantly to adjust
The position of text.
As it is shown in figure 1, background Figure 10 shown of the text display manner of routine and text 3 structure comparison is fixed and extremely
Plate, changes underaction.
State Intellectual Property Office of the People's Republic of China disclosed Publication No. on 07 01st, 2009
The patent documentation of CN101470700A, title is text template generator, text generation equipment, text inspection equipment and side thereof
Method, its text template generator includes: groove location determines unit, need in the text determining input according to constraints by
The position of the word replaced, as groove location;And target replacement determines unit, for determining replacement groove location according to constraints
Object, thus generate and include the text template of object.This scheme still has bigger restriction, and flexibility ratio is inadequate.
Summary of the invention
The present invention mainly solves that the space availability ratio existing for prior art is the highest, it is fine not to control, flexibility ratio not
The technical problem of foot etc., it is provided that a kind of text template generates method, and the text template generated by the method can not only be good
Process the text style control that the location problem of irregular figure more becomes more meticulous with offer, and can reach content of text and literary composition
The purpose that this pattern separates, user can select more personalized text style layout.
The present invention is directed to what above-mentioned technical problem was mainly addressed by following technical proposals: a kind of text template is raw
One-tenth method, the text template generated is made up of painting canvas, frame, Drawing Object, text control and framework shade figure, and these belong to
Property all form by the language definition of XML, it is achieved text style and content of text are separated, by belonging to these when loading when
Property parsing realize the layout of text style, text template generates method and comprises the following steps:
One, load blank template, in blank template, draw painting canvas according to default painting canvas width and height attributes and set
Put global context figure;
Two, set up a wide high shade figure layer and be all entered as 1;
Three, load frame, i.e. load a rectangle according to position and wide high attribute, simultaneously same position in shade figure layer
The rectangle mask information that upper loading size is identical with rectangle, all mask information in rectangle are all 0, painting of all content of text
System is limited in this rectangle frame;
Four, loading frame shade figure, the self-defined mask information of the sizes such as the storage of framework shade figure and frame;Pass through
Logic or mode be loaded in the shade figure layer above generated;
Five, loading Drawing Object, Drawing Object includes position and wide high attribute and includes two figure memory blocks, a use
Store original image, a mask information being used for storing original image;According to the high attribute in Drawing Object position and width at page
Original image is drawn in the relevant position in face, corresponding mask information is added shade figure layer, the mask information of original image simultaneously
The ALPHA information of original image can be derived from, if ALPHA value is not 0 mask information is just set to 1, it is also possible to allow editor
Self-defined to adjust the page space occupied of final image, the mask layer of Drawing Object by logic or by the way of be loaded into before
In the shade figure layer generated;
Six, loading text control, text control includes row height, between word spacing, font attribute;
Seven, outside text object or template, extract content of text, arrange really according to frame and text control simultaneously
Recognize text position and judge that text is the most writable, if writable, relevant position writing text, otherwise jumps to next
Judge that text is the most writable on unit word location, until the write of all texts terminates.
As preferably, in step 3, if preset attribute has transformation matrix, the most first conversion is used then to load in rectangle
In painting canvas, and rectangle shade figure layer is used identical conversion.
As preferably, in step 3, if preset attribute includes the inset spacing attribute of frame, then in page mask layer
One section of distance corresponding with inset spacing attribute of the width that frame is taken up room and reduced height.
As preferably, text control also includes that underscore attribute, loading text control include: according to row in the range of frame
High and frame transformation matrix attribute determines the beginning and end of every underscore;Carry out the drafting of underscore, take out underscore
Starting point do line segment towards terminal, finding out first mask information on line segment path is the pixel of 0, with this pixel as starting point,
If the pixel having mask information to be 1 on line segment path just does line segment with this for end points connection source;Continue on starting point to arrive
The pixel that terminal direction finds mask information to be 0, continues towards terminal direction finding shade letter with this location of pixels for starting point
Breath is the pixel of 1, does line segment with this position for end points connection source, the like until arrive underscore terminal.
As preferably, it is characterised in that in step 7, it is judged that whether text can write method particularly includes: if
In the range of unit word width below text position, underscore is not interrupted just write.
As preferably, in step 7, it is judged that whether text can write method particularly includes: according in unit word rectangle region
Mask pixels is all 0 writable to judge whether.Above two decision method is it is assumed that in the case of fixed word width, become
The wide situation of long word is similar with both above.
As preferably, the orientation of word is determined by the transformation matrix attribute of frame, rotates font by transporting font
Realize by the mode of matrixing.
As preferably, the attribute of frame include float attribute, float attribute comprise a Boolean and assigned direction piece
Lifting type, direction includes 4 directions and the combination in 4 directions;In the case of float attribute is arranged to open, when input literary composition
When this content exceedes the content that frame can accommodate, frame will stretch, and the direction of extension of acquiescence is to carry out to 4 directions simultaneously
Stretch.
As preferably, the template of generation includes text object attribute, text object attribute be used for store content of text with
Transmission in content of text.
The generation method of above-mentioned text template, step one, two, three, four, five can also merge into the steps:
One. loading the painting canvas with mask layer information, mask layer information therein is that editor is self-defining, and according in advance
If the high attribute of width in blank template, draw painting canvas and global context figure be set;
Two. loading frame, i.e. load a rectangle according to position and wide high attribute, the drafting of all content of text all limits
In this rectangle frame;
Three. loading Drawing Object, wherein Drawing Object only stores the original image without mask information;
Four, loading text control, text control includes row height, between word spacing, font attribute;
Five, outside text object or template, extract content of text, arrange really according to frame and text control simultaneously
Recognize text position and judge that text is the most writable, if writable, relevant position writing text, otherwise jumps to next
Judge that text is the most writable on unit word location, until the write of all texts terminates.
Remaining feature description method equivalent all and above, simply mask layer information is disposable loading.
Both the above generates method, and when certain attribute is adjusted by needs, presentation layer and mask layer will use phase
Same conversion.
This patent proposes two kinds of text template loading methods, seems effect the same, but the first template generation method
Because having taken out more structured message, it is particularly suited for edit tool.This template intelligentized can complete content of text
Drawing, and disposably generate mask layer information, improve the efficiency of editing.The mask information generated is conducive to
Template is by efficient multiplexing.
The second template generation method, because being disposably loaded with mask information, eliminates what a lot of mask information generated
Step makes template to be loaded faster.Template specifically used on can more take advantage.But second method, because only
Use and arrived a small amount of structured message so that more lack flexibly than first method when text template recurring structure adjusts
Property.
For integrity and the terseness of patent statement, below mainly with first method be the object described.
The present invention utilizes DTD or SCHEMA to define the property set for presenting text style based on XML.This property set
Including painting canvas, frame, text control, Drawing Object, framework shade figure.Because the cross-platform feature of XML language, this property set
Also there is the most cross-platform ability of presenting.Below each attribute is illustrated one by one:
Painting canvas, for controlling the size of full page, has global context figure attribute and the wide high of definition page-size belongs to
Property.Frame is placed in painting canvas the drafting scope for limiting content of text, and frame comprises position and the high attribute of width, inset spacing,
Transformation matrix attribute and a float attribute for conversion.Relevant attribute, literary composition are drawn in text control storage with received text
This control has underscore attribute, row height, between word spacing, font attribute.Wherein underscore can use standard line segment and self-defined line
Segment figure is defined, and the direction of drawing of underscore and text is determined by the transformation matrix of frame.Drawing Object is responsible for decoration figure
The drafting of picture, it has two figure memory blocks, the mask information of a storage original image one storage original image.Figure
Object also comprises the drafting for Drawing Object of position attribution and the high attribute of width.The mask information of original image joins the page
To realize the accurate control to text style in shade figure layer.Framework shade figure then stores mask information, for generation one
The most special text effect.
The substantial effect that the present invention brings is, processes the location problem of irregular figure by the way of shade, it is to avoid
Wasting space, it is provided that the text style more become more meticulous controls, and reaches the purpose that content of text is separated with text style, makes
User can select more personalized text style layout.
Accompanying drawing explanation
Fig. 1 is existing conventional text ways of presentation;
Fig. 2 is a kind of text template structural representation that the present invention generates;
Fig. 3 be the present invention generate a kind of text template time shade figure layer generate process schematic;
Fig. 4 is the text template structural representation of a kind of the simplified mode that the present invention generates;
In figure: 1, painting canvas, 2, frame, 3, text, 4, original image, 5, shade figure layer, 6, rectangle shade, 7, framework shade
Figure, 8, figure shade, 9, underscore, 10, Background.
Detailed description of the invention
Below by embodiment, and combine accompanying drawing, technical scheme is described in further detail.
Embodiment: a kind of text template of the present embodiment generates method, utilizes DTD or SCHEMA definition based on XML
For presenting the property set of text style.This property set includes painting canvas, frame, text control, Drawing Object and framework shade figure
Shape.Because the cross-platform feature of XML language, this property set also has the most cross-platform ability of presenting.Below to each attribute
Illustrate one by one:
Painting canvas, for controlling the size of full page, has global context figure attribute and the wide high of definition page-size belongs to
Property.Frame is placed in painting canvas the drafting scope for limiting content of text, and frame comprises position and the high attribute of width, inset spacing belong to
Property, for conversion transformation matrix attribute and a float attribute.The attribute that text control storage is drawn for received text, literary composition
This control has underscore attribute, row height, between word spacing, font attribute.Wherein underscore can use standard line segment and self-defined line
Segment figure is defined, and the direction of drawing of underscore and text is determined by the transformation matrix of frame.Drawing Object is responsible for decoration figure
The drafting of picture, it has two figure memory blocks: a storage original image, the mask information of another storage original image.
Drawing Object also comprises position attribution and the high attribute of width. and framework shade figure then stores mask information, is used for producing some special
Different text effect.Framework shade does not has fixed structure, can the most freely define.The shade figure layer of the page and presentation layer
Being wide high bitmap, what presentation layer stored is the message bit pattern of rgb format, the bitmap that shade figure layer is made up of 0 and 1.When
When needing to be adjusted certain attribute, presentation layer and mask layer will use identical conversion.
Fig. 2 is a kind of text template structural representation that the present invention generates;Fig. 3 is a kind of text template that the present invention generates
Time shade figure layer generate process schematic;Fig. 4 is the text template structural representation of a kind of the simplified mode that the present invention generates.Connect
The mechanism of action to each attribute that gets off illustrates one by one.
After template loads, first draw one piece of painting canvas 1 according to the wide high attribute of painting canvas and global context figure is set, building simultaneously
Found a wide high shade figure layer 5 and be all entered as 1.Then load frame 2, load one according to position and wide high attribute
Individual rectangle, just using conversion to be then loaded in painting canvas in rectangle if being provided with transformation matrix, can use after float attribute,
Also in the shade figure layer of the page, correspondingly sized rectangle shade 6 information, rectangle is loaded while painting canvas loads frame
In all mask information be all 0, if frame is provided with inset spacing attribute, in the mask layer of the page, frame is occupied sky
Between wide height reduce one section of corresponding distance.Frame has loaded and has been loaded with framework shade figure 7 to realize some special frames
Shape effects.Next loading Drawing Object, it has two figure memory blocks, and one is used for storing original image 4, and one is used for
Figure shade 8 information of storage original image.The background acquiescence of original image is transparent, high according to Drawing Object position and width
Attribute draws original image 4 in the relevant position of the page, corresponding figure shade 8 is added shade figure layer simultaneously.Original image
Mask information can be derived from the ALPHA information of figure, it is also possible to make editor self-defined to adjust what final image occupied
Page space.Next loading text control, in the range of frame, high according to row and frame transformation matrix attribute determines often
The beginning and end of bar underscore 9.Then carrying out the drafting of underscore, the starting point taking out underscore does line segment towards terminal, finds out
On line segment path, first mask information is the pixel of 0, with this pixel as starting point, if having mask information on line segment path
Be 1 pixel just do line segment with this for end points connection source.Continuing on origin-to-destination direction finds mask information to be 0
Pixel, continuing towards terminal direction finding mask information with this location of pixels for starting point is the pixel of 1, with this position for end
Point connection source do line segment, the like until arrive underscore terminal.The method for drafting of self-defined underscore and above base
This is identical, simply needs to draw out the underscore pattern of circulation according to self-defined figure, and each platform has the side of realization accordingly
Method.This template, when the plain text information display of localization, extracts plain text information then from underscore from resource file
Point starts rendering text 3, arranges according to the attribute of text control and frame and determines the drawable position of text and judge that text is
No writable.If writable, relevant position write text, otherwise jumps to judge that text is on next unit word location
No writable.There are two kinds of methods judging whether text can write, if the first is at the unit word width below text position
In the range of underscore be not interrupted just write;Also a kind of according in unit word rectangle region whether mask pixels be all 0 judge be
No writable.Above two determination methods is based on fixed word length font, and the situation for elongated font is similar to therewith.Word
Orientation by frame transformation matrix attribute determine, to font use matrixing just reached rotate font effect,
Font after conversion needs to carry out the collision detection of mask layer.
Below the type of attribute above is illustrated one by one.
The global context attribute of painting canvas is set by background color or background picture, and background color arranges the background face of painting canvas
Color, background picture arranges the background picture of painting canvas, can be the static graphics form such as JPEG or PNG., SVG, the size of painting canvas
Then represent with pixel value.The position of frame and wide high level can use pixel value or ratio value to determine, the scale of reference
Very little is the size of painting canvas, and specify when before the positional information of frame with center key word is the position of frame central point.
Frame can with frame background and frontier properties, but acquiescence be transparent.The position of Drawing Object and size can use
Pixel value or ratio value represent, the proportional sizes of reference can be size or the size of frame of painting canvas.Drawing Object
The storage of raw image storage district can be the static format such as JPEG, PNG or SVG, it is also possible to is the dynamic picture forms such as GIF.
The row height of text control can be with font height for reference to setting with pixel value.Here frame is shaped to square
Shape, other shapes can use framework shade figure to show.When frame occurs to adjust, framework shade figure also to do same
The conversion of sample.The float attribute of frame comprises a Boolean and the enumeration type of assigned direction, and float attribute acquiescence is to close
, direction includes 4 directions and the combination in 4 directions, and this attribute is mainly used to control when input content of text exceedes limit
During the content that frame can accommodate, how frame will be adjusted.In the case of float attribute is arranged to open, the stretching, extension of acquiescence
Direction is stretched to 4 directions simultaneously.
When being provided with framework shade figure, the drafting of underscore is also based on frame and framework shade figure judges
, it is ensured that underscore is in the range of both common region.The storage of framework shade figure is the sizes such as self-defining and frame
Page mask information.Framework shade figure uses logic or computing when being loaded into the mask layer above generated.
Drawing Object and framework shade figure there may be repetition on some functional realiey, and namely some effects use this
Both can realize.But the use of Drawing Object is conducive to also keeping reasonable display effect when the page adjusts
Without being stretched along with the page or extruding, additionally it is also beneficial to rearrange layout when page scroll.In addition, figure
The needs that the use of shape object shows also for dynamic pictures such as GIF, the most per second being required for is refreshed full page, is individually arranged
Have only to the effective coverage of refresh graphics object the most exactly, reduce the use to resource.Master in the use of framework shade figure
If in order to make the layout of word in frame more personalized.As shown in Figure 3.
When the length of input text has exceeded the number of words that frame can accommodate, according to the setting of frame float attribute, frame
Can extend to respective direction, it might even be possible to high for the width of painting canvas attribute is tied on frame realize full page size
Adjust.When the attribute in template occurs to adjust, corresponding mask layer information also to use identical conversion.
This template, for rich text information is transmitted when, because rich text contains various format information, is such as expressed one's feelings,
Self-defined picture, network address and email address, positional information etc., this template is newly added a text object attribute for storage format
Change text, in order to content of text and pattern can be by correct displays at the receiving terminal of template.Text object can include certainly
The information types such as definition picture, network address, email address and position.Expression and self-defined picture are treated as the figure with wide high attribute
Shape object handles.These rich text information add text after text transmitting terminal carries out semantic parsing and adds content type mark
Object is transmitted.For the process of custom images layout, different according to the difference of client realization, can be with present image
The underscore of the lastrow being expert at is coboundary and draws according to figure image width high information.Content in order to ensure rich text
Correctly resolved at receiving terminal, before the content of text of transmission joins text object, the reserved word of XML will be carried out at escape
Reason.If this template is applied to the text style editor of MMS etc., content of text is input to text style template,
Then obtain the message bit pattern processed through text template and be transmitted in the way of picture.
Explanation about some of them optional attribute: frame can also include enumerating genus for arrange Graphicxtras Frames Collection in fact
Property and arrange the attribute of frame background, underscore can also have enumerated attributes and the underscore width arranging underscore pattern in fact
Degree attribute.These attributes are arranged can the setting of reference layer stacking style table.Underscore attribute is also optional, primarily to
Loyalty presents the effect of tradition letter paper.When realizing very simple text style effect, framework shade figure layer, Drawing Object
Mask layer information is also optional.If Drawing Object does not has mask layer, it will the size positional information according to Drawing Object is raw
Becoming corresponding rectangle shade map data mining platform, wherein mask information is all 1, and adds the shade figure layer of the page to carry out collision inspection
Survey.In the case of the size such as painting canvas and frame and frame there are not transformation matrix, painting canvas and frame can merge.Painting canvas
Background color attribute can also be arranged to transparent.
The loading sequence of this patent attribute is also through careful consideration, if Drawing Object adds after being placed on text control
Load can simplify the drawing process of underscore, but the page space that Drawing Object occupies cannot effectively be adjusted.Here
Assuming that situation be Drawing Object with self-defining outer back gauge when, if text control first loads, the district of back gauge outside
In territory, underscore also can be drawn, and do not reach and indicate drawable text filed purpose with underscore.Present invention maximum
Innovative point is exactly the expression achieving complex text pattern with markup language.Traditional HTML and CSS technology is all with frame as list
Position realizes pattern, and needs manual programming or use the mode of visual programming to realize.This mode makes user only
Simple text style can be used.The PaintShops such as PHOTOSHOP can create complex text pattern, but is because lacking
Structurized graphical information makes the text style cannot be by effective multiplexing.
While the present invention has taken out the structure of complex text pattern, achieve text style by the mode of markup language
Quick multiplexing.
The realization of the present invention, because being to use most basic XML language, so ensure that the biggest autgmentability, uses FLASH
Or HTML5 adds JAVASCRIPT and can realize.
In foreseeable main application, mainly e-book, blog, Email, multimedia message, instant messaging and office are soft
The word template application aspect of part.
Using the present invention can realize two kinds of application modes in e-book, one is to be editted pattern, user by others
Downloading and directly use in the e-book downloaded, the pattern that this mode provides can be some same subjects mostly
The continuous repetition of pattern, often shows retrtieval position while one page of content, continues when translating into lower one page of content to take out literary composition
Originally showing, a kind of landscaping effect of this mode, the content with book is mated the most well;Also has one side
After formula is exactly the content of text that pattern editor has taken e-book, utilizes style editor to go for the content of every one page book and create
Make pattern, although seem and original edit mode is similar, but the method for the present invention is used on style editor
Can complete intelligentized text layout, editor does not spend the arrangement position calibrating each word, particularly in text style
The when of including a large amount of explanatory diagram pictures and decorative picture, going to treat because these images are all treated as Drawing Object, editor can
With careless dilatory figure to particular location, it is possible to the random size and location adjusting image, and do not worry that image is adjusted
After whole, overall situation text can occur anything to change, and these can be completed by template intellectuality.The most traditional text is compiled
The efficiency collecting work can improve greatly and simplify, and makes editor more thought be placed in the concrete effect of text style
It not on realization rate.Content of text is then placed on being transmitted in text object attribute.This technology can also use
On the editor of traditional print book, simply need to do a little vectorized process in font and picture.
Because often there being many words to need to process on e-book one page, use three times of bufferings just can improve the use of client
Experience.Concretely comprise the following steps: applying for that three memory storage area, first memory storage area are used for the display of video, two other is used
In having stored the Template Information drawn.After user has loaded the template content of page 1 and shown, at once the 2nd
Page content is loaded in second memory storage area.After page 1 is read, first page is loaded in the 3rd
Deposit as historical record in memory block, and the most rendered second good memory storage area is switched to first memory storage area
And it is shown to the page.Load again page 3 content to second internal memory after second memory storage area switches viewing area at once
Memory block.This mode can improve the reading experience of user.
In terms of blog applications, because Blog content length also differs, user can be allowed to select theme template in advance,
Then according to the optimal template of how many selections of user input text content.Or use several short text content template to splice
Mode for presenting final text template.Frame can also be adjusted to accommodate more text according to the float attribute of frame
Content.The self-defined picture being loaded into user in template can allow user adjust picture size, and self-defined picture is taken as band
The Drawing Object rectangle shade map data mining platform of size such as having is treated, and the mask information wherein stored is all 1.Figure can also be set
The thumbnail of sheet, and obtain complete pictorial information by clicking on thumbnail.Can add with FLASH or HTML5 in terms of blog
JAVASCRIPT realizes, it is contemplated that professional platform independence recommendation HTML5.
Other use situation is similar with situation above.When cross-platform realization, presentation layer and mask layer to apply same change
Change, in order to correct completes collision detection.
Specific embodiment described herein is only to present invention spirit explanation for example.Technology neck belonging to the present invention
Described specific embodiment can be made various amendment or supplements or use similar mode to replace by the technical staff in territory
Generation, but without departing from the spirit of the present invention or surmount scope defined in appended claims.
Although the most more employing the terms such as frame, shade, text control, but it is not precluded from using other term
Probability.Use these terms to be only used to more easily to describe and explain the essence of the present invention;It is construed as any
A kind of additional restriction is all contrary with spirit of the present invention.
Claims (10)
1. a text template generates method, it is characterised in that the text template generated is by painting canvas, frame, Drawing Object, literary composition
This control and framework shade figure composition, these attributes all form with XML language definition, to realize text style and content of text
Being separated, by the parsing of these attributes realizes the layout of text style when loading when, text template generates method bag
Include following steps:
One, load blank template, in blank template, draw painting canvas according to default painting canvas width and height attributes and arrange complete
Office's Background;
Two, set up a high shade figure layer wide with painting canvas and be all entered as 1;
Three, load frame, i.e. load a rectangle according to position and wide high attribute, add in same position in shade figure layer simultaneously
Carrying the rectangle mask information that size is identical with rectangle, all mask information in rectangle are all 0, and the drafting of all content of text is all
It is limited in this rectangle frame;
Four, loading frame shade figure, the self-defined mask information of the sizes such as the storage of framework shade figure and frame;Pass through logic
Or mode be loaded in the shade figure layer above generated;
Five, loading Drawing Object, Drawing Object includes position and wide high attribute and includes two figure memory blocks, and one is used for depositing
Storage original image, a mask information being used for storing original image;According to the high attribute in Drawing Object position and width at the page
Original image is drawn in relevant position, corresponding mask information is added shade figure layer simultaneously, the mask information source of original image
From the ALPHA information of original image, if ALPHA value is not 0 mask information is just set to 1;Or make editor self-defined to adjust
The page space that final image occupies, the mask layer of Drawing Object by logic or by the way of be loaded into the shade figure above generated
In Ceng;
Six, loading text control, text control includes row height, between word spacing, font attribute;
Seven, outside text object or template, extract content of text, confirmation literary composition is set according to frame and text control simultaneously
This position also judges that text is the most writable, if writable, write text, otherwise jump to next unit on relevant position
Judge on word location that text is the most writable, until the write of all texts terminates.
A kind of text template the most according to claim 1 generates method, it is characterised in that in step 3, if frame
Preset attribute has transformation matrix, the most first uses conversion to be then loaded in painting canvas in rectangle, and the shade figure layer of rectangle is transported
With identical conversion.
A kind of text template the most according to claim 2 generates method, it is characterised in that in step 3, if frame
Preset attribute includes the inset spacing attribute of frame, the then width in page mask layer, frame taken up room and reduced height
One section of distance corresponding with inset spacing attribute.
4. generate method according to a kind of text template described in Claims 2 or 3, it is characterised in that under text control also includes
Line attribute, loading text control includes: under in the range of frame, high according to row and frame transformation matrix attribute determines every
The beginning and end of line;Carrying out the drafting of underscore, the starting point taking out underscore does line segment towards terminal, finds out on line segment path
First mask information is the pixel of 0, with this pixel as starting point, if the pixel having mask information to be 1 on line segment path
Just do line segment with this for end points connection source;Continue on the pixel that origin-to-destination direction finds mask information to be 0, with this
Individual location of pixels is that to continue towards terminal direction finding mask information be the pixel of 1 to starting point, connects with this position for end points
Point do line segment, the like until arrive underscore terminal.
A kind of text template the most according to claim 4 generates method, it is characterised in that in step 7, it is judged that text is
No can write method particularly includes: if underscore is not interrupted and just writes in the range of the unit word width below text position
Enter.
A kind of text template the most according to claim 4 generates method, it is characterised in that in step 7, it is judged that text is
No can write method particularly includes: according to unit word wide in the range of whether mask pixels be all 0 judge whether writable.
A kind of text template the most according to claim 2 generates method, it is characterised in that the orientation of word is by frame
Transformation matrix attribute determine, rotate font and realize by font is used by the way of matrixing.
A kind of text template the most according to claim 1 generates method, it is characterised in that the attribute of frame includes floating and belongs to
Property, float attribute comprises a Boolean and the enumeration type of assigned direction, and direction includes 4 directions and the group in 4 directions
Close;In the case of float attribute is arranged to open, when inputting content of text and exceeding the content that frame can accommodate, frame will enter
Row stretches, and the direction of extension of acquiescence stretches to 4 directions simultaneously.
A kind of text template the most according to claim 1 generates method, it is characterised in that the template of generation includes text pair
As attribute, text object attribute is used for storing the content of text transmission for content of text.
10. a text template generates method, it is characterised in that the text template generated by painting canvas, frame, Drawing Object and
Text control forms, and these attributes all form with XML language definition, separated, when adding to realize text style and content of text
By the parsing of these attributes realizes the layout of text style when of load, text template generates method and comprises the following steps:
One. loading the painting canvas with mask layer information, mask layer information therein is that editor is self-defining, and according to default
Wide high attribute is drawn painting canvas in blank template and arranges global context figure;
Two. loading frame, i.e. load a rectangle according to position and wide high attribute, the drafting of all content of text is limited to this
In individual rectangle frame;
Three. loading Drawing Object, wherein Drawing Object only stores the original image without mask information;
Four, loading text control, text control includes row height, between word spacing, font attribute;
Five, outside text object or template, extract content of text, confirmation literary composition is set according to frame and text control simultaneously
This position also judges that text is the most writable, if writable, write text, otherwise jump to next unit on relevant position
Judge on word location that text is the most writable, until the write of all texts terminates.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310203820.6A CN103353863B (en) | 2013-05-29 | 2013-05-29 | A kind of text template generates method |
PCT/CN2014/075881 WO2014190826A1 (en) | 2013-05-29 | 2014-04-22 | Text template generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310203820.6A CN103353863B (en) | 2013-05-29 | 2013-05-29 | A kind of text template generates method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103353863A CN103353863A (en) | 2013-10-16 |
CN103353863B true CN103353863B (en) | 2016-09-28 |
Family
ID=49310237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310203820.6A Expired - Fee Related CN103353863B (en) | 2013-05-29 | 2013-05-29 | A kind of text template generates method |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103353863B (en) |
WO (1) | WO2014190826A1 (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103353863B (en) * | 2013-05-29 | 2016-09-28 | 徐华 | A kind of text template generates method |
CN105354174B (en) * | 2014-08-22 | 2018-04-10 | 北大方正集团有限公司 | For exporting the composition method and device of epub formatted files |
CN105468656B (en) * | 2014-09-12 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Webpage background image generation method and system |
CN105373524A (en) * | 2015-10-13 | 2016-03-02 | 百度在线网络技术(北京)有限公司 | Demonstration text editing method and apparatus |
CN107025676B (en) * | 2016-01-25 | 2021-02-02 | 阿里巴巴集团控股有限公司 | Picture template, picture generation method and related device |
CN106846443A (en) * | 2017-01-05 | 2017-06-13 | 福建天泉教育科技有限公司 | A kind of collision checking method and system |
CN107741923B (en) * | 2017-09-29 | 2021-04-20 | 苏州亿科赛卓电子科技有限公司 | Automatic pdf document underline matching method and device |
CN109657211A (en) * | 2018-12-11 | 2019-04-19 | 万兴科技股份有限公司 | The method, apparatus and intelligent terminal of line format conversion |
CN110058909B (en) * | 2019-02-26 | 2022-03-08 | 创新先进技术有限公司 | Control layout method, layout device, server and readable storage medium |
CN109978044B (en) * | 2019-03-20 | 2021-03-19 | 广州云测信息技术有限公司 | Training data generation method and device, and model training method and device |
CN109977130B (en) * | 2019-03-29 | 2021-09-28 | 珠海豹好玩科技有限公司 | Hot word display method and system |
CN112631703B (en) * | 2020-12-25 | 2023-08-01 | 北京百度网讯科技有限公司 | Method, device, equipment and storage medium for generating graphic frame |
CN115390819B (en) * | 2022-10-28 | 2023-08-22 | 南京国睿信维软件有限公司 | Method and system for deep integration of online drawing component of rich text editor |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101963955A (en) * | 2010-09-17 | 2011-02-02 | 深圳市万兴软件有限公司 | System and method for converting XML format document into Word format document |
CN101980183A (en) * | 2010-09-17 | 2011-02-23 | 深圳市万兴软件有限公司 | Method for analyzing Word file information and system thereof |
CN102567303A (en) * | 2010-12-24 | 2012-07-11 | 北京大学 | Typesetting method and device for variable official document data |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040205588A1 (en) * | 2002-07-23 | 2004-10-14 | Xerox Corporation | System and method for dynamically generating a style sheet |
JP4082351B2 (en) * | 2003-03-12 | 2008-04-30 | セイコーエプソン株式会社 | Layout system, layout program, and layout method |
CN102929847A (en) * | 2012-10-26 | 2013-02-13 | 北京乐投科技有限公司 | Character wrapping method for manufacturing of digitally published products |
CN103353863B (en) * | 2013-05-29 | 2016-09-28 | 徐华 | A kind of text template generates method |
-
2013
- 2013-05-29 CN CN201310203820.6A patent/CN103353863B/en not_active Expired - Fee Related
-
2014
- 2014-04-22 WO PCT/CN2014/075881 patent/WO2014190826A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101963955A (en) * | 2010-09-17 | 2011-02-02 | 深圳市万兴软件有限公司 | System and method for converting XML format document into Word format document |
CN101980183A (en) * | 2010-09-17 | 2011-02-23 | 深圳市万兴软件有限公司 | Method for analyzing Word file information and system thereof |
CN102567303A (en) * | 2010-12-24 | 2012-07-11 | 北京大学 | Typesetting method and device for variable official document data |
Also Published As
Publication number | Publication date |
---|---|
CN103353863A (en) | 2013-10-16 |
WO2014190826A1 (en) | 2014-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103353863B (en) | A kind of text template generates method | |
Eisenberg et al. | SVG essentials: Producing scalable vector graphics with XML | |
CN104516867A (en) | Table reordering method and table reordering system | |
US20150205797A1 (en) | Identifying a set of related visible content elements in a markup language document | |
CN101183283A (en) | Method for directly writing handwriting information | |
US8005316B1 (en) | System and method for editing image data for media repurposing | |
EP0902378A2 (en) | A font architecture and creation tool for producing richer text | |
CN101739223B (en) | Method and system to realize the transformation of document format by virtual printing | |
CN101699426A (en) | Document format conversion system and method | |
US11027201B2 (en) | Composing an image | |
CN103257986A (en) | Creating html/css representations of a geometric symbol | |
CN105740364A (en) | Page processing method and related apparatus | |
CN112614211B (en) | Method and device for text and image self-adaptive typesetting and animation linkage | |
CN102930572A (en) | Caching coverage values for rendering text using anti-aliasing techniques | |
CN104424174B (en) | Document processing system and document processing method | |
KR20160019502A (en) | Layered z-order and hinted color fonts with dynamic palettes | |
JP6298422B2 (en) | Character string processing technology for graphic display of man-machine interface | |
CN105446596A (en) | Depth based interactive 3D interface displaying system and method | |
CN107450904A (en) | The method for drafting and device of title bar | |
CN102867322A (en) | Method and device for realizing Chinese marking in three-dimensional scene | |
CN103150742A (en) | Method and device for vector graphic dynamic rendering | |
Watt | SVG unleashed | |
CN114861595B (en) | Vector line transformation-based individual font generation method | |
CN103839217A (en) | Watermark image realization method | |
Dengler et al. | Scalable vector graphics (SVG) 1.1 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 322000 A3-6454 store, third floor, Futian market, Yiwu International Trade City, Zhejiang, China Applicant after: Xu Hua Address before: 334300 No. 83 Jiefang East Road, Hengfeng County, Shangrao, Jiangxi Applicant before: Xu Hua |
|
COR | Change of bibliographic data | ||
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: 20160928 |