Invention content
The present invention provide it is a kind of word method and apparatus are done based on skeleton line, to solve the problems of the prior art.
What it is an aspect of the present invention to provide a kind of based on skeleton line does word method, including:
Basic character set is obtained, basic character concentration includes at least one character;
According to each character of basic character set, part library is built, wherein part library includes at least one component, each
A component includes component skeleton line information, and component skeleton line information includes at least one stroke, each stroke includes the first stroke
Touch width and skeleton line coordinate points;
According to the style of font to be developed, similar with the style of font to be developed group of character matrix plate is selected, wherein group type matrix
Plate includes the character group word information that will automatically generate character, each character group word information includes building block information, described
Building block information describes component and component information converting;
According to the component skeleton line information in part library and the building block information in group character matrix plate, character matrix plate will be organized
In each character transformation be font to be developed character set.
In method as described above, each character according to basic character set builds part library, including:
Each component for extracting composition character is concentrated from basic character, with component parts library.
In method as described above, building block information includes:Component information converting;
Building block information in the component skeleton line information and group character matrix plate according in part library, will organize word
Each character transformation of template is the character set of font to be developed, including:
The component skeleton line information that each component of current character is obtained from part library, believes according to the transformation in group character matrix plate
Breath is handled for each component, and each component in part library is transformed on the target component of font to be developed, will
Each character transformation in group character matrix plate is the character set of font to be developed.
In method as described above, each component by part library transforms on the target component of font to be developed,
Including:
By the skeleton line coordinate points P0 (x0, y0) of each stroke of the component in part library, it is converted into the mesh of font to be developed
On the profile point P (x, y) for marking each stroke of component, wherein (x, y)=(x0, y0) * Mat2+ (XOffset, YOffset),
Mat2 is the parameter informations such as scaling, the rotation of a two-dimensional transform matrix description component, and XOffset indicates the offset of X-direction,
YOffset indicates the offset of Y-direction;
By the first style of writing width of each stroke of the component in part library, it is transformed to each of the target component of font to be developed
Second style of writing width of stroke, wherein the second style of writing widthW is the first style of writing width, and x is that component laterally scales
Ratio, y are component longitudinal direction scaling.
In method as described above, in the component skeleton line information according in part library and group character matrix plate
Building block information, by each character transformation in group character matrix plate be font to be developed character set after, further include:
The character set of basic character set and font to be developed is integrated, constitutes and integrates character set;
It is modified to integrating character set, to constitute revised integration character set.
Another aspect of the present invention be to provide it is a kind of word device is done based on skeleton line, including:
Acquisition module, for obtaining basic character set, basic character concentration includes at least one character;
Module is built, for each character according to basic character set, builds part library, wherein part library includes at least
One component, each component include component skeleton line information, and component skeleton line information includes at least one stroke, each pen
Picture includes the first style of writing width and skeleton line coordinate points;
Selecting module selects similar with the style of font to be developed group of type matrix for the style according to font to be developed
Plate, wherein group character matrix plate includes the character group word information that will automatically generate character, each character group word information includes composition
Component information, the building block information describe component and component information converting;
Conversion module, for being believed according to the component skeleton line information in part library and the building block in group character matrix plate
Breath, by the character set that each character transformation in group character matrix plate is font to be developed.
In device as described above, the structure module is specifically used for:
Each component for extracting composition character is concentrated from basic character, with component parts library.
In device as described above, building block information includes:Component information converting;
The conversion module, is specifically used for:
The component skeleton line information that each component of current character is obtained from part library, believes according to the transformation in group character matrix plate
Breath is handled for each component, and each component in part library is transformed on the target component of font to be developed, will
Each character transformation in group character matrix plate is the character set of font to be developed.
In device as described above, the conversion module is specifically used for:
The component skeleton line information that each component of current character is obtained from part library, believes according to the transformation in group character matrix plate
Breath is handled for each component, by the skeleton line coordinate points P0 (x0, y0) of each stroke of the component in part library, transformation
To the profile point P (x, y) of each stroke of the target component of font to be developed, wherein (x, y)=(x0, y0) * Mat2+
(XOffset, YOffset), Mat2 are the parameter informations such as scaling, the rotation of a two-dimensional transform matrix description component, XOffset
Indicate that the offset of X-direction, YOffset indicate the offset of Y-direction;
By the first style of writing width of each stroke of the component in part library, it is transformed to each of the target component of font to be developed
Second style of writing width of stroke, wherein the second style of writing widthW is the first style of writing width, and x is that component laterally scales
Ratio, y are component longitudinal direction scaling.
In device as described above, further include:
Module is integrated, is used in the conversion module according to the component skeleton line information and group character matrix plate in part library
In building block information, by each character transformation in group character matrix plate be font to be developed character set after, by basic character
The character set of collection and font to be developed is integrated, and is constituted and is integrated character set;It is modified to integrating character set, is corrected with constituting
Integration character set afterwards.
The solution have the advantages that:By obtaining basic character set, basic character concentration includes at least one character;Root
According to each character of basic character set, part library is built, wherein part library includes at least one component, each component includes
Component skeleton line information, component skeleton line information include at least one stroke, each stroke includes the first style of writing width and bone
Stringing coordinate points;According to the style of font to be developed, similar with the style of font to be developed group of character matrix plate is selected, wherein group
Character matrix plate includes the character group word information that will automatically generate character, each character group word information includes building block information,
Building block information describes component and component information converting;According to the component skeleton line information and group type matrix in part library
Building block information in plate, by the character set that each character transformation in group character matrix plate is font to be developed.To design and produce
Less chinese character puts into less manpower, improves character producing efficiency, reduces and do the word time, reduce do word at
This;Simultaneously as directly carrying out a group word using the skeleton line of primitive part and stroke brush stroke data, font pen shape wind both ensure that
Lattice, while also improving the problem of stroke deforms during existing automatic mosaic so that result character library font style is more unified,
The working efficiency for improving character library exploitation, ensure that the final mass of finished product character library.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Fig. 2 is the flow chart for doing word method based on skeleton line that the embodiment of the present invention one provides, as shown in Fig. 2, this reality
The method for applying example includes:
Step 101 obtains basic character set, and basic character concentration includes at least one character.
In the present embodiment, specifically, obtaining basic character set, on the basis, character concentration includes at least one character.
Each character includes character code, glyph skeleton line and font style of writing information.The basis character set is to build part library below
Basis, the font style of the basis character set will be the font style of final character library.
Specifically, Adobe illustrator Software for Design can be used to make basic character set, font design determines
Font style determines that exploitation font is GB2312 character set, the corresponding basic character set of basic character set GB2312 character set;If
Each character that basic character is concentrated is counted and makes, wherein character code is encoded using Unicode, and Fig. 3 is that the present invention is implemented
The schematic diagram for the glyph skeleton line for doing character micro-in word method based on skeleton line that example one provides, as shown in figure 3, character
The glyph skeleton line of micro-, Fig. 4 are the word for doing character micro-in word method based on skeleton line that the embodiment of the present invention one provides
The schematic diagram of shape style of writing, as shown in figure 4, character micro-font style of writing.
Step 102, each character according to basic character set build part library, wherein part library includes at least one portion
Part, each component include component skeleton line information, and component skeleton line information includes at least one stroke, each stroke includes
First style of writing width and skeleton line coordinate points.
In the present embodiment, specifically, according to each character of basic character set, part library is built;Wherein, it is wrapped in part library
At least one component is included, each component includes component identification code, component skeleton line information, each component is by least one pen
Draw and constitute, to which, component skeleton line information includes at least one stroke, each stroke include style of writing number, style of writing width and
Skeleton line coordinate points.
Step 103, according to the style of font to be developed, select similar with the style of font to be developed group of character matrix plate,
In, group character matrix plate includes the character group word information that will automatically generate character, each character group word information includes building block
Information, building block information describe component and component information converting.
In the present embodiment, it specifically, according to the style of font to be developed, selects similar with the style of font to be developed
Group character matrix plate, wherein group character matrix plate includes the character group word information that will automatically generate character, each character group word packet
Character code, building block information are included, building block information describes component and component information converting, such as offset parameter letter
Breath, zooming parameter information, rotation parameter information.
Wherein building block information includes component identification code, component information converting.Component information converting describes the character
In the parameter informations such as offset, scaling and the rotation of component, be specifically expressed as follows, construct a two-dimensional transform matrix:Mat2
=A11A12A21A22 indicates corresponding X-direction for indicating the rotation, inclination and scale transformation of component using XOffset
Translation transformation, YOffset indicate the translation transformation of corresponding Y-direction.
For example, selection blackbody model library is similar with the style of font to be developed group of character matrix plate.Blackbody model library
It include the character spelling template other than the basic character set of GB2312 character set removal.Each character spelling template includes that character is compiled
Code, the component coding of composition character and corresponding transformation data, the transformation data are component information converting.The component sequence of character
It is described from left to right, from top to bottom according to the structure of Chinese character, the component information converting of component describes the offset of the component, scaling
Information.The Template Information of character micro-is described as follows table 1.
The Template Information of 1 character micro-of table
Step 104, according in part library component skeleton line information and group character matrix plate in building block information, will
Each character transformation in group character matrix plate is the character set of font to be developed.
In the present embodiment, specifically, according to the component skeleton line information and step 103 in part library in step 102
Building block information in middle group of character matrix plate, to which the character set that each character transformation in character matrix plate is font to be developed will be organized.
For the present embodiment by obtaining basic character set, basic character concentration includes at least one character;According to basic character
Each character of collection builds part library, wherein part library includes at least one component, each component includes component skeleton line
Information, component skeleton line information include at least one stroke, each stroke includes the first style of writing width and skeleton line coordinate points;
According to the style of font to be developed, similar with the style of font to be developed group of character matrix plate is selected, wherein group character matrix plate includes will
The character group word information of character is automatically generated, each character group word information includes building block information, building block information
Describe component and component information converting;According to the component skeleton line information in part library and the composition portion in group character matrix plate
Part information, by the character set that each character transformation in group character matrix plate is font to be developed.To design and produce less Chinese Character
Symbol, puts into less manpower, improves character producing efficiency, reduce and do the word time, reduce and do word cost;Simultaneously as
A group word directly is carried out using the skeleton line of primitive part and stroke brush stroke data, both ensure that font pen shape style, while also changing
The problem of stroke deforms during existing automatic mosaic has been apt to it so that result character library font style is more unified, improves character library
The working efficiency of exploitation ensure that the final mass of finished product character library.
Fig. 5 is the flow chart provided by Embodiment 2 of the present invention that do word method based on skeleton line, in the base of embodiment one
On plinth, as shown in figure 5, step 102 the method for the present embodiment specifically includes:
Each component for extracting composition character is concentrated from basic character, with component parts library.
In the present embodiment, specifically, each component for extracting composition character is concentrated from basic character, with component parts library.
The part library obtained from will include multiple components.Each component includes:Component identification code, component skeleton line information, component
Skeleton line information includes at least one stroke, each stroke includes the first style of writing width, style of writing information and skeleton line coordinates
Point.
Specifically, the component for splitting all characters automatically can be concentrated from ready-made basic character, then carry out phase
Merge like property, the character of each font retains a component, forming member library.To which each component includes:Component identification code,
Glyph skeleton line, style of writing and the first style of writing width.
For example, Fig. 6 be component " Ren " provided by Embodiment 2 of the present invention that do in word method based on skeleton line and
The schematic diagram of the skeleton line and style of writing information of " Quan ".Information such as the following table 2 of component " Ren " and " Quan ".
The information of 2 component of table " Ren " and " Quan "
Building block information includes:Component information converting, component information converting include the offset ginseng of the component in character
Number information, zooming parameter information, rotation parameter information;
Step 104, it specifically includes:
The component skeleton line information that each component of current character is obtained from part library, believes according to the transformation in group character matrix plate
Breath is handled for each component, and each component in part library is transformed on the target component of font to be developed, will
Each character transformation in group character matrix plate is the character set of font to be developed.
Wherein, each component in part library is transformed on the target component of font to be developed, including:
By the skeleton line coordinate points P0 (x0, y0) of each stroke of the component in part library, it is converted into the mesh of font to be developed
On the profile point P (x, y) for marking each stroke of component, wherein (x, y)=(x0, y0) * Mat2+ (XOffset, YOffset),
Mat2 is the parameter informations such as scaling, the rotation of a two-dimensional transform matrix description component, and XOffset indicates the offset of X-direction,
YOffset indicates the offset of Y-direction;
By the first style of writing width of each stroke of the component in part library, it is transformed to each of the target component of font to be developed
Second style of writing width of stroke, wherein the second style of writing widthW is the first style of writing width, and x is that component laterally scales
Ratio, y are component longitudinal direction scaling.
In the present embodiment, specifically, group character matrix plate includes the character group word information that will automatically generate character, each
Character group word information includes character code, building block information, wherein building block information includes component identification code, component change
Information is changed, component information converting includes offset parameter information, zooming parameter information, the rotation parameter letter of the component in character
Breath, constructs two-dimensional transform matrix Mat2=A11A12A21A22, for indicating the rotation of component, inclining according to component information converting
Oblique and scale transformation, corresponding translation transformation is indicated with XOffset and YOffset.
Then, according to part library, group character matrix plate, the character set of font to be developed is generated.It specifically includes:It is obtained from part library
The component skeleton line information for taking each component of current character is carried out according to the information converting in group character matrix plate for each component
Processing, each component in part library is transformed on the target component of font to be developed, and each character that will be organized in character matrix plate becomes
It is changed to the character set of font to be developed.The character that the character set of font to be developed includes, with the group character matrix plate in step 103
Character is consistent.
Specifically, each component in part library is transformed to and is divided into two parts on the target component of font to be developed.One
Part is the transformation of skeleton line, is converted to each coordinate points of skeleton line, by each stroke of the component in part library
Skeleton line coordinate points P0 (x0, y0) is converted on the profile point P (x, y) of each stroke of the target component of font to be developed,
In, (x, y)=(x0, y0) * Mat2+ (XOffset, YOffset), Mat2 are the contractings of a two-dimensional transform matrix description component
The parameter informations such as put, rotate, can obtain (x, y)=(x0+x0*XScale, y0+y0*YScale)+(XOffset,
YOffset), XScale indicates that the scale value of X-direction, YScale indicate that the scale value of Y-direction, XOffset indicate the inclined of X-direction
It moves, YOffset indicates the offset of Y-direction.Another part is the transformation of style of writing, and the style of writing of font works as pen there are certain width
When picture skeleton line zooms in and out variation, need corresponding style of writing width being carried out at the same time scale transformation, the transformation of font style of writing width
Computational methods it is as follows:If component transverse direction scaling is x, component longitudinal direction scaling is y, by each of the component in part library
First style of writing width of stroke is transformed to the second style of writing width of each stroke of the target component of font to be developed
Wherein, w is the first style of writing width.Fig. 7 does doing automatically in word method to be provided by Embodiment 2 of the present invention based on skeleton line
The effect diagram of word, as shown in fig. 7, top half is effect after skeleton line transformation, lower half portion is the increase in style of writing transformation
Treated finally does word effect.
After step 104, further include:
Step 201 integrates the character set of basic character set and font to be developed, constitutes and integrates character set;To whole
It closes character set to be modified, to constitute revised integration character set.
In the present embodiment, specifically, finally, the character set of basic character set and font to be developed is integrated, structure
At integration character set.It is then possible to which character carries out hand inspection one by one, it is found that problematic character is manually modified, finally
Font data is formed into a complete character library, obtains revised integration character set.
By this programme, original the problem of doing component scaling deformation in word scheme can be improved, it is only necessary to design and produce few
The Chinese character of amount;Simultaneously as component can be zoomed in and out arbitrarily, and will not be deformed, such prototype part can only make one
Secondary, multiple without making simultaneously, which reduces the quantity that initial designs make character, improve work efficiency, no
Influence the final mass of finished product character library.
For the present embodiment by obtaining basic character set, basic character concentration includes at least one character;According to basic character
Each character of collection builds part library, wherein part library includes at least one component, each component includes component skeleton line
Information, component skeleton line information include at least one stroke, each stroke includes the first style of writing width and skeleton line coordinate points;
According to the style of font to be developed, similar with the style of font to be developed group of character matrix plate is selected, wherein group character matrix plate includes will
The character group word information of character is automatically generated, each character group word information includes building block information, building block information
Describe component and component information converting;According to the component skeleton line information in part library and the composition portion in group character matrix plate
Part information, by the character set that each character transformation in group character matrix plate is font to be developed;By basic character set and font to be developed
Character set integrated, constitute integrate character set;It is modified to integrating character set, to constitute revised integration character
Collection.To design and produce less chinese character, less manpower is put into, improves character producing efficiency, is reduced when doing word
Between, it reduces and does word cost;Simultaneously as directly carrying out a group word using the skeleton line of primitive part and stroke brush stroke data, both
It ensure that font pen shape style, while also improving the problem of stroke deforms during existing automatic mosaic so that result character library
Font style is more unified, improves the working efficiency of character library exploitation, ensure that the final mass of finished product character library.
Fig. 8 is the structural schematic diagram for doing word device based on skeleton line that the embodiment of the present invention three provides, as shown in figure 8,
Device provided in this embodiment, including:
Acquisition module 31, for obtaining basic character set, basic character concentration includes at least one character;
Module 32 is built, for according to each character of basic character set, building part library, wherein part library include to
A few component, each component includes component skeleton line information, and component skeleton line information includes at least one stroke, each
Stroke includes the first style of writing width and skeleton line coordinate points;
Selecting module 33 selects similar with the style of font to be developed group of word for the style according to font to be developed
Template, wherein group character matrix plate includes the character group word information that will automatically generate character, each character group word information includes group
At component information, building block information describes component and component information converting;
Conversion module 34, for according to the component skeleton line information in part library and the building block in group character matrix plate
Information, by the character set that each character transformation in group character matrix plate is font to be developed.
Word device can perform that the embodiment of the present invention one provides to the doing based on skeleton line of the present embodiment based on skeleton line
Word method is done, realization principle is similar, and details are not described herein again.
For the present embodiment by obtaining basic character set, basic character concentration includes at least one character;According to basic character
Each character of collection builds part library, wherein part library includes at least one component, each component includes component skeleton line
Information, component skeleton line information include at least one stroke, each stroke includes the first style of writing width and skeleton line coordinate points;
According to the style of font to be developed, similar with the style of font to be developed group of character matrix plate is selected, wherein group character matrix plate includes will
The character group word information of character is automatically generated, each character group word information includes building block information, building block information
Describe component and component information converting;According to the component skeleton line information in part library and the composition portion in group character matrix plate
Part information, by the character set that each character transformation in group character matrix plate is font to be developed.To design and produce less Chinese Character
Symbol, puts into less manpower, improves character producing efficiency, reduce and do the word time, reduce and do word cost;Simultaneously as
A group word directly is carried out using the skeleton line of primitive part and stroke brush stroke data, both ensure that font pen shape style, while also changing
The problem of stroke deforms during existing automatic mosaic has been apt to it so that result character library font style is more unified, improves character library
The working efficiency of exploitation ensure that the final mass of finished product character library.
Fig. 9 is the structural schematic diagram for doing word device based on skeleton line that the embodiment of the present invention four provides, in embodiment three
On the basis of, as shown in figure 9, device provided in this embodiment, builds module 32, is specifically used for:
Each component for extracting composition character is concentrated from basic character, with component parts library.
Building block information includes:Component information converting;
Conversion module 34, is specifically used for:
The component skeleton line information that each component of current character is obtained from part library, believes according to the transformation in group character matrix plate
Breath is handled for each component, and each component in part library is transformed on the target component of font to be developed, will
Each character transformation in group character matrix plate is the character set of font to be developed.
Specifically, conversion module 34 are specifically used for:
The component skeleton line information that each component of current character is obtained from part library, believes according to the transformation in group character matrix plate
Breath is handled for each component, by the skeleton line coordinate points P0 (x0, y0) of each stroke of the component in part library, transformation
To the profile point P (x, y) of each stroke of the target component of font to be developed, wherein (x, y)=(x0, y0) * Mat2+
(XOffset, YOffset), Mat2 are the parameter informations such as scaling, the rotation of a two-dimensional transform matrix description component, XOffset
Indicate that the offset of X-direction, YOffset indicate the offset of Y-direction;
By the first style of writing width of each stroke of the component in part library, it is transformed to each of the target component of font to be developed
Second style of writing width of stroke, wherein the second style of writing widthW is the first style of writing width, and x is that component laterally scales
Ratio, y are component longitudinal direction scaling.
Further include:
Module 41 is integrated, is used in conversion module 34 according to the component skeleton line information and group character matrix plate in part library
In building block information, by each character transformation in group character matrix plate be font to be developed character set after, by base word
The character set of symbol collection and font to be developed is integrated, and is constituted and is integrated character set;It is modified to integrating character set, is repaiied with constituting
Integration character set after just.
The present embodiment based on skeleton line do word device can perform it is provided by Embodiment 2 of the present invention based on skeleton line
Word method is done, realization principle is similar, and details are not described herein again.
For the present embodiment by obtaining basic character set, basic character concentration includes at least one character;According to basic character
Each character of collection builds part library, wherein part library includes at least one component, each component includes component skeleton line
Information, component skeleton line information include at least one stroke, each stroke includes the first style of writing width and skeleton line coordinate points;
According to the style of font to be developed, similar with the style of font to be developed group of character matrix plate is selected, wherein group character matrix plate includes will
The character group word information of character is automatically generated, each character group word information includes building block information, building block information
Describe component and component information converting;According to the component skeleton line information in part library and the composition portion in group character matrix plate
Part information, by the character set that each character transformation in group character matrix plate is font to be developed;By basic character set and word to be developed
The character set of body is integrated, and is constituted and is integrated character set;It is modified to integrating character set, to constitute revised integration character
Collection.To design and produce less chinese character, less manpower is put into, improves character producing efficiency, is reduced when doing word
Between, it reduces and does word cost;Simultaneously as directly carrying out a group word using the skeleton line of primitive part and stroke brush stroke data, both
It ensure that font pen shape style, while also improving the problem of stroke deforms during existing automatic mosaic so that result character library
Font style is more unified, improves the working efficiency of character library exploitation, ensure that the final mass of finished product character library.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer read/write memory medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or
The various media that can store program code such as person's CD.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, it will be understood by those of ordinary skill in the art that:It still may be used
With technical scheme described in the above embodiments is modified or equivalent replacement of some of the technical features;
And these modifications or replacements, various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution spirit and
Range.