The method of typesetting along word
Technical field
The invention belongs to typesetting technique, and in particular to a kind of method of typesetting along word.
Background technology
Typesetting along the line, refers to that the curvilinear path by passage along primitive boundary carries out typesetting output, active to reach
Artistic effect attractive in appearance.For Chinese character, because each Chinese character is a semantic primitive, it corresponds to a character code,
And a square font is exported into, therefore along progress during typesetting, it is only necessary to it is along curvilinear path placement by each character
Can.
However, some national writings are generally using word as a semantic primitive, corresponding to one group of continuous character code,
And one or more splicing fonts are exported into, in addition also usually can be along with complicated deformation process, therefore during typesetting
Its typesetting rule is completely different with Chinese character.The language such as Balakrishnan, A Wen, Mongolian, diverse location of its letter in a word
With different shapes, show as in different prefixes, word, suffix font, wherein head and the tail font has been respectively pen type, has received pen
Font is then row pen type in type, word, is coupled whole word usually through a center line in addition, and subalphbet also has independent type
Font;For another example the language such as Tibetan language, Sanskrit, its word has a base word, above or below base word can with Canadian dollar sound affix, and
And can have upper word adding in the top of base word, lower section can have down word adding etc..
Typesetting along if necessary to be carried out to these national writings, then need to place each word along curvilinear path.
At present, although partial software is there is provided the function of typesetting along word, but it is generally just for conventional Chinese and English character, behaviour
Make personnel will utilize these software development national writings typesetting effect when, generally require each list in typesetting main body first
Word makes character block, and the size that character block is adjusted to fit, then by the character block of each word copy to along typesetting
In word flow, so that effect along being formed.However, this method workload is big, formality is cumbersome, waste time and energy, in addition modification and
Adjust relative difficulty.
The content of the invention
The method that the present invention provides typesetting along a kind of word, this method word is carried out in units of word along row
Version, not only facilitates, efficiently, and greatly reduces typesetting workload, improves typesetting efficiency.
The method of typesetting, comprises the following steps along a kind of word that the present invention is provided:
Step 1, the typesetting main body comprising word is cut into multiple continuous independent segments in units of word;
Step 2, typesetting is carried out to the multiple continuous independent segments, build corresponding fragment sample;
Step 3, the fragment sample is respectively placed in the relevant position of primitive boundary by typesetting parameter request along.
Typesetting main body of the present invention refers to the object of typesetting along needs progress, and it can be appointing comprising word
Meaning word, sentence or paragraph.The language of the word is not particularly limited the present invention, and in concrete scheme, the word is
National writing, it can include but is not limited to Balakrishnan, Mongolian, Tibetan language or A Wen.
The method provided according to the present invention, the step 1 includes:
Word order according to the typesetting main body obtains the information of single character successively, and it is judged according to the information of adjacent character
Whether belong to same word, the continuation character for belonging to same word is divided into an independent segments, so as to form the multiple
Continuous independent segments.Character is divided into after the fragment in units of word by the present invention carries out typesetting, so as to greatly reduce
The typesetting workload of word, improves the typesetting efficiency of word, is particularly suitable for use in the typesetting of national writing.
Further, the step 1 is specifically included:
Step 1.1, the initial character of the typesetting main body is set to current character;
Step 1.2, structure blank fragment, and the blank fragment is set to current clip;
Step 1.3, the information for obtaining the current character;
Step 1.4, the last character for obtaining the current clip;If it is, being transferred to step 1.5;If no
Obtain, be transferred to step 1.6;
Step 1.5, according to the information of current character judge whether the last character of itself and the current clip belongs to
Same word;If it is, being transferred to step 1.6;If it is not, then the current clip is divided into an independent segments, simultaneously
New blank fragment is built, and the new blank fragment is set to current clip, step 1.6 is transferred to;
Step 1.6, the afterbody that the current character is placed in the current clip, become the current clip most
Latter character;
Step 1.7, the character late for obtaining the current character, if it is, the character late is arranged to
As character, and it is transferred to step 1.3;If there is no, terminate.
Character of the present invention is the general name of various words and symbol, and it includes every country word, punctuation mark, figure
Symbol, numeral etc..Information of the present invention includes the one or more in coding and languages;Wherein, the coding refers to institute
State and be encoded to the binary numeral corresponding with character, it is used to enabling a computer to recognize and storing various words;It is described
Languages refer to the species of language, such as Chinese, various nationalities' language, English, French, Russian etc..
The method provided according to the present invention, its side for whether belonging to same word is judged according to the information of adjacent national character
Method includes:
Judge that its method for whether belonging to same word includes according to the information of adjacent character:
Judge whether the languages of the adjacent character are identical, if it is not, then being determined to belong to different terms;If it is,
Continuation judges whether the coding of the adjacent character belongs to same word in the languages, if it is, being determined to belong to same
One word, if it is not, then being determined to belong to different terms.
The method provided according to the present invention, the step 2 is specifically included:
Step 2.1, the word attribute for obtaining the multiple continuous independent segments;
Step 2.2, the text according to the multiple continuous independent segments of requirement adjustment of typesetting main body word attribute to along
Word attribute;
Step 2.3, typesetting is carried out to the independent segments after adjustment, build corresponding fragment sample.
Further, the one or more in font of the word attribute including word, font size, color, artistic effect.
The method provided according to the present invention, typesetting parameter includes placement direction, places initiating terminal along the line described in step 3
One or more in point, placement order, set-point position, set-point skew.
Further, before step 3, in addition to:
Step 3.1, the requirement according to the typesetting effect to along, determine the placement direction of the fragment sample;
Step 3.2, setting language feature and word order according to typesetting main body along the line, determine the placement initiating terminal of fragment sample
Point and placement order;
Step 3.3, according to it is described placement order traversal described in fragment sample, calculate each fragment sample it is corresponding placement
Point position and set-point skew.
Further, the placement direction is tangential direction or normal direction, and the set-point position is placed to be described
Top point between set-point along linear distance, set-point skew for the fragment sample at set-point along placement direction
Adjustment distance.
Operation is simple for the methods described that the present invention is provided, and it carries out word row along efficiently in units of word
Version, can not only better conform to the custom and feature of each spoken and written languages itself, but also can greatly reduce text composition
Workload, it is also relatively easy to the modification of the space of a whole page and adjustment operation in the typesetting later stage in addition.
Brief description of the drawings
Fig. 1 is the flow chart of composition method along word of the present invention;
Typesetting main body is cut into the flow chart of multiple continuous independent segments for the present invention by Fig. 2;
Fig. 3 a- Fig. 3 c are the effect diagrams of Uighur linear typesetting;
Fig. 4 a- Fig. 4 c are the effect diagrams of typesetting along Mongolian;
Fig. 5 a- Fig. 5 c are the effect diagrams of typesetting along Tibetan language.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, accompanying drawing and implementation below in conjunction with the present invention
Example, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is the present invention
A part of embodiment, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not having
The every other embodiment obtained under the premise of creative work is made, the scope of protection of the invention is belonged to.
Embodiment 1
As shown in figure 1, the method for typesetting comprises the following steps along the word of the present invention:
Step 1, the typesetting main body comprising word is cut into multiple continuous independent segments in units of word.
Step 2, typesetting is carried out to the multiple continuous independent segments, build corresponding fragment sample.
Step 3, the fragment sample is respectively placed in the relevant position of primitive boundary by typesetting parameter request along.
In above-mentioned steps 1, the typesetting main body is to need the object of typesetting along progress, and it can include word
Any word, sentence or paragraph;The word is being collectively referred to as word and language, including word, phrase and whole vocabulary.The present invention will row
Edition owner's body is cut into multiple independent segments in units of word, and the mode of cutting is not limited, the result of cutting with reach make it is each solely
One word of vertical fragment correspondence, slit mode is such as:The phrase code database of certain spoken and written languages is pre-established, according to two
The coding information of adjacent word is compared with code database, so as to judge whether it belongs to same word.More specifically, cutting side
Formula can be:Word order according to the typesetting main body obtains the information of single character successively(Such as coding information), according to adjacent words
The information of symbol judges whether it belongs to same word, and the continuation character for belonging to same word is divided into an independent segments, from
And form the multiple continuous independent segments.
In step 2 above, typesetting is carried out to the independent segments in units of word, so that corresponding to each independent segments
Word word attribute reach it is set in advance along typesetting effect requirements so that formed be suitable for along typesetting piece
Section sample.
In above-mentioned steps 3, according to along the requirement of typesetting effect, typesetting main body along the line setting language feature and language
Sequence etc. determine fragment sample along typesetting parameter, such as placement direction, place starting endpoint, placement order, set-point position, put
Skew etc. is put, when fragment sample is placed in into the relevant position of primitive boundary by the relevant parameter of determination, you can reach predetermined
Along typesetting effect.Wherein, the pel is graphic element, such as line, rectangle, polygon, circle and camber line.
The above method is divided word in units of word, same word is in same typesetting fragment, not only not
Each character in same word can be caused scattered and make the expression confusion reigned of typesetting main body, arranged in addition in units of word
Version can also greatly reduce the workload of typesetting, so as to improve the efficiency of typesetting.
Embodiment 2
The present embodiment is illustrated with typesetting along being carried out to the typesetting main body comprising Balakrishnan.
As shown in Fig. 2 the method for typesetting comprises the following steps along the word of the present embodiment:
Step 1, the typesetting main body comprising Balakrishnan is cut into multiple continuous independent segments in units of word.
It can specifically include:
Step 101, the initial character of the typesetting main body comprising Balakrishnan is set to current character.
Step 102, structure blank fragment, and the blank fragment is set to current clip;The sky that the present embodiment is built
White tiles section is not when setting up to include the virtual clip of any character, and its purpose set up is to be used to carry to judge true through follow-up
It is set to the continuation character of same word, it turns into an entity fragment, i.e., following independent segments after character is carried.
Step 103, the information for obtaining the current character, described information include one kind or many in coding, languages, font
Kind;It is wherein described to be encoded to the binary numeral corresponding with character;The languages refer to the species of language.
Step 104, the last character for obtaining the current clip;If it is, step 105 is transferred to, if do not had
Obtain, be transferred to step 106;
Step 105, according to the information of current character judge whether the last character of itself and the current clip belongs to
Same word;If it is, being transferred to step 106;If it is not, then the current clip is divided into an independent segments, simultaneously
New blank fragment is built after the independent segments, and the new blank fragment is set to current clip, step is transferred to
Rapid 106;
Wherein, judge whether adjacent character belongs to the method for same word and include:
Judge whether the languages of the adjacent Balakrishnan character are identical, if it is not, then being determined to belong to different terms;If
It is then to continue to judge whether the coding of the adjacent character belongs to same word in the languages, if it is, being defined as category
In same word, if it is not, then being determined to belong to different terms.
Step 106, the afterbody that the current character is placed in the current clip, become the current clip most
Latter character.
Step 107, the character late for obtaining the current character, if it is, the character late is arranged to
Current character, and it is transferred to step 103;If there is no, terminate, so as to obtain multiple continuous independent segments.
Step 2, typesetting is carried out to the multiple continuous independent segments, build corresponding fragment sample.
It can specifically include:
Step 201, the word attribute for obtaining multiple continuous independent segments described in step 107, include font, the word of word
Number, color, artistic effect etc..
Step 202, the text according to the multiple continuous independent segments of requirement adjustment of typesetting main body word attribute to along
Word attribute.
Step 203, typesetting is carried out to the independent segments after adjustment, build corresponding fragment sample, wherein the typesetting
Purpose is the effect requirements for making the word attribute of the word corresponding to each independent segments reach typesetting along set in advance, from
And formed be suitable for along typesetting fragment sample.
Step 3, the fragment sample is respectively placed in the relevant position of primitive boundary by typesetting parameter request along.
It can specifically include:
Step 301, the requirement according to the typesetting effect to along, determine the placement direction of the fragment sample.
Step 302, setting language feature and word order according to the typesetting main body to along, determine the placement starting of fragment sample
End points and placement order, wherein the placement direction is tangential direction or normal direction;The language feature of Balakrishnan is from right to left
Write and read, therefore reverse horizontal version, i.e. laterally typesetting from right to left are preferably carried out in typesetting, so as to meet its language
Feature.
Step 303, according to it is described placement order traversal described in fragment sample, calculate each fragment sample it is corresponding placement
Point position and set-point skew, wherein the set-point position for it is described placement starting endpoint between set-point along line-spacing
From adjustment distance of the set-point skew for the fragment sample at set-point along placement direction.
Fig. 3 a-c are as stated above according to typesetting parameter request along difference to typesetting along typesetting main body progress
Design sketch afterwards.As shown in fig. 3 a-c, Balakrishnan typesetting main body four Balakrishnan fragments in units of word of formation of the present embodiment
Sample, wherein Fig. 3 a are illustrated that is placed in what is formed above circular sideline according to tangential direction, counterclockwise by Balakrishnan fragment sample
Typesetting design sketch along the line;Fig. 3 b are illustrated that is placed in shape on circular sideline according to tangential direction, clockwise by Balakrishnan fragment sample
Into along typesetting design sketch;Fig. 3 c are illustrated that is placed in Balakrishnan fragment sample on circular sideline according to staged, counterclockwise
Typesetting design sketch along being formed.
Embodiment 3
The present embodiment is illustrated with typesetting along being carried out to the typesetting main body being made up of Mongolian.
The method of typesetting comprises the following steps along the word of the present embodiment:
Step 1, the typesetting main body being made up of Mongolian is cut into multiple continuous independent segments in units of word.
It can specifically include:
Step 101, the initial character for the typesetting main body being made up of Mongolian is set to current character.
Step 102, structure blank fragment, and the blank fragment is set to current clip.
Step 103, the coding information for obtaining the current character.
Step 104, the last character for obtaining the current clip;If it is, step 105 is transferred to, if do not had
Obtain, be transferred to step 106;
Step 105, its volume with the last character of the current clip judged according to the coding information of current character
Whether code information belongs to same word in Mongolian;If it is, being transferred to step 106;If it is not, then the current clip is drawn
It is divided into an independent segments, while build new blank fragment after the independent segments, and by the new blank fragment
Current clip is set to, step 106 is transferred to.
Step 106, the afterbody that the current character is placed in the current clip, become the current clip most
Latter character.
Step 107, the character late for obtaining the current character, if it is, the character late is arranged to
Current character, and it is transferred to step 103;If there is no, terminate, so as to obtain multiple continuous independent segments.
Step 2 and step 3 be the same as Example 2.
Fig. 4 a-c are as stated above according to typesetting parameter request along difference to typesetting along typesetting main body progress
Design sketch afterwards.As shown in figures 4 a-c, the Mongolian typesetting main body of the present embodiment forms 14 Mongolian pieces in units of word
Section sample, wherein Fig. 4 a are illustrated that the row along the line that Mongolian fragment sample is placed according to normal direction and is formed above circular sideline
Version design sketch;Fig. 4 b are illustrated that the effect of typesetting along the line that Mongolian fragment sample is placed according to normal direction and is formed on circular sideline
Fruit is schemed;Fig. 4 c are illustrated that the typesetting design sketch along the line for being placed in Mongolian fragment sample above circular sideline according to staged.
Embodiment 4
The present embodiment is illustrated with typesetting along being carried out to the typesetting main body being made up of Tibetan language.
Composition method is by the Mongolian in embodiment 3 in addition to Tibetan language is replaced with along the word of the present embodiment, remaining step with
Embodiment 3 is identical.
Fig. 5 a-c are as stated above according to typesetting parameter request along difference to typesetting along typesetting main body progress
Design sketch afterwards.Wherein, Fig. 5 a are illustrated that is placed in what is formed above circular sideline by Tibetan language fragment sample according to tangential direction
Typesetting design sketch along the line;Fig. 5 b are illustrated that Tibetan language fragment sample be placed on circular sideline according to tangential direction formed along
Typesetting design sketch;Fig. 5 c are illustrated that the effect of typesetting along the line that Tibetan language fragment sample is placed according to staged and is formed on circular sideline
Fruit is schemed.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.