Disclosure of Invention
The invention provides a method and a device for making a character based on skeleton lines, which are used for solving the problems in the prior art.
One aspect of the present invention provides a skeleton line-based method for writing characters, including:
acquiring a basic character set, wherein the basic character set comprises at least one character;
constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point;
selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component information, and the component information describes components and component transformation information;
and converting each character in the character combination template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combination template.
In the method, the building a component library from the characters of the basic character set includes:
the components that make up the character are extracted from the base character set to form a component library.
In the method as described above, the component part information includes: component transformation information;
the converting each character of the character combination template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combination template comprises the following steps:
and acquiring the component skeleton line information of each component of the current character from the component library, processing each component according to the conversion information in the character combination template, and converting each component in the component library onto a target component of the font to be developed so as to convert each character in the character combination template into a character set of the font to be developed.
In the method, transforming each part in the part library onto a target part of a font to be developed includes:
skeleton line coordinate points P of each stroke of the components in the component library0(a0,b0) And converting the outline point P (a, b) of each stroke of the target part of the font to be developed, wherein (a, b) ═ a0,b0) Mat2+ (XOffset, YOffset), Mat2 is scaling and rotation parameter information of a two-dimensional transformation matrix description component, XOffset represents offset in X direction, YOffset represents offset in Y direction;
transforming a first stroke width of each stroke of a part in the part library into a second stroke width of each stroke of a target part of the font to be developed, wherein the second stroke width
w is the first stroke width, x is the part lateral scaling, and y is the part longitudinal scaling.
In the method, after the converting each character in the word composition template into a character set of a font to be developed according to the component skeleton line information in the component library and the component information in the word composition template, the method further includes:
integrating the basic character set and the character set of the font to be developed to form an integrated character set;
and correcting the integrated character set to form a corrected integrated character set.
Another aspect of the present invention provides a skeleton line-based character forming device, including:
the device comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for acquiring a basic character set, and the basic character set comprises at least one character;
the device comprises a building module, a processing module and a display module, wherein the building module is used for building a component library according to each character of a basic character set, the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point;
the system comprises a selection module, a character generation module and a character generation module, wherein the selection module is used for selecting a character generation template similar to the style of a font to be developed according to the style of the font to be developed, the character generation template comprises character generation character information of characters to be automatically generated, each character generation character information comprises component part information, and the component part information describes a component and component transformation information;
and the conversion module is used for converting each character in the character combination template into a character set of a font to be developed according to the component skeleton line information in the component library and the component information in the character combination template.
In the above apparatus, the building module is specifically configured to:
the components that make up the character are extracted from the base character set to form a component library.
In the apparatus as described above, the component part information includes: component transformation information;
the transformation module is specifically configured to:
and acquiring the component skeleton line information of each component of the current character from the component library, processing each component according to the conversion information in the character combination template, and converting each component in the component library onto a target component of the font to be developed so as to convert each character in the character combination template into a character set of the font to be developed.
In the above apparatus, the transformation module is specifically configured to:
acquiring component skeleton line information of each component of the current character from a component library, processing each component according to transformation information in the character combination template, and processing skeleton line coordinate points P of each stroke of the components in the component library0(a0,b0) And converting the outline point P (a, b) of each stroke of the target part of the font to be developed, wherein (a, b) ═ a0,b0) Mat2+ (XOffset, YOffset), Mat2 is scaling and rotation parameter information of a two-dimensional transformation matrix description component, XOffset represents offset in X direction, YOffset represents offset in Y direction;
transforming a first stroke width of each stroke of a part in the part library into a second stroke width of each stroke of a target part of the font to be developed, wherein the second stroke width
w is the first stroke width, x is the part lateral scaling, and y is the part longitudinal scaling.
The apparatus as described above further includes:
the integration module is used for integrating the basic character set and the character set of the font to be developed to form an integrated character set after the conversion module converts each character in the character combination template into the character set of the font to be developed according to the component skeleton line information in the component library and the component part information in the character combination template; and correcting the integrated character set to form a corrected integrated character set.
The invention has the technical effects that: acquiring a basic character set, wherein the basic character set comprises at least one character; constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point; selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component information, and the component information describes components and component transformation information; and converting each character in the character combination template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combination template. Therefore, fewer Chinese characters are designed and manufactured, less manpower is invested, the character manufacturing efficiency is improved, the character manufacturing time is reduced, and the character manufacturing cost is reduced; meanwhile, because the skeleton lines and the stroke data of the original components are directly used for word composition, the style of the font stroke shape is ensured, and the problem of stroke deformation in the existing automatic spelling process is solved, so that the style of the character in the resulting character library is more uniform, the working efficiency of character library development is improved, and the final quality of the finished product character library is ensured.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 2 is a flowchart of a skeleton line-based word-making method according to an embodiment of the present invention, and as shown in fig. 2, the method of the embodiment includes:
step 101, obtaining a basic character set, wherein the basic character set comprises at least one character.
In this embodiment, specifically, a basic character set is obtained, and the basic character set includes at least one character. Each character includes a character code, a font skeleton line and font stroke information. The base character set is the basis for later building of a component library, and the font style of the base character set will be the font style of the final library.
Specifically, a basic character set can be designed and manufactured by using Adobe illustrator software, the style of the font is determined by font design, the developed font is determined to be a GB2312 character set, and the basic character set corresponding to the GB2312 character set is determined; each character in the basic character set is designed and manufactured, wherein the character code is Unicode code, fig. 3 is a schematic diagram of a font skeleton line of a character "micro" in the skeleton line-based character-making method provided in the first embodiment of the present invention, as shown in fig. 3, the font skeleton line of the character "micro", and fig. 4 is a schematic diagram of a font stroke of the character "micro" in the skeleton line-based character-making method provided in the first embodiment of the present invention, as shown in fig. 4, the font stroke of the character "micro" is a stroke.
Step 102, constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point.
In this embodiment, specifically, a component library is constructed according to each character of the basic character set; the part library comprises at least one part, each part comprises a part identification code and part skeleton line information, and each part is composed of at least one stroke, so that the part skeleton line information comprises at least one stroke, and each stroke comprises a stroke number, a stroke width and a skeleton line coordinate point.
Step 103, selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component part information, and the component part information describes a component and component transformation information.
In the present embodiment, specifically, according to the style of the font to be developed, a character-forming template similar to the style of the font to be developed is selected, wherein the character-forming template includes character-forming information of the character to be automatically generated, each character-forming information includes character codes and component information, and the component information describes the components and component transformation information, such as offset parameter information, scaling parameter information and rotation parameter information.
Wherein the component part information includes a part identification code, part conversion information. The part transformation information describes parameter information of offset, scaling, rotation and the like of the part in the character, and is specifically expressed as follows, and a two-dimensional transformation matrix is constructed: mat 2-a 11 a12 a21 a22 for representing rotation, tilt and scale transformations of the component, XOffset for corresponding X-direction translation transformation, and YOffset for corresponding Y-direction translation transformation.
For example, the blackbody model library is selected as a group character template similar to the style of the font to be developed. The black body model library comprises character spelling templates except the GB2312 character set except the basic character set. Each character spelling template includes character codes, part codes constituting the characters, and corresponding transformation data, which is part transformation information. The component sequence of the characters is described from left to right and from top to bottom according to the structure of the Chinese character, and the component transformation information of the components describes the offset and scaling information of the components. The template information for the character "micro" is described in table 1 below.
TABLE 1 template information for the character "MICRO
And 104, converting each character in the character combination template into a character set of a font to be developed according to the information of the part skeleton line in the part library and the information of the component parts in the character combination template.
In the present embodiment, specifically, each character in the character-composing template is converted into a character set of the font to be developed according to the information of the component skeleton line in the component library in step 102 and the information of the component part in the character-composing template in step 103.
In the embodiment, a basic character set is obtained, and the basic character set comprises at least one character; constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point; selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component information, and the component information describes components and component transformation information; and converting each character in the character combination template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combination template. Therefore, fewer Chinese characters are designed and manufactured, less manpower is invested, the character manufacturing efficiency is improved, the character manufacturing time is reduced, and the character manufacturing cost is reduced; meanwhile, because the skeleton lines and the stroke data of the original components are directly used for word composition, the style of the font stroke shape is ensured, and the problem of stroke deformation in the existing automatic spelling process is solved, so that the style of the character in the resulting character library is more uniform, the working efficiency of character library development is improved, and the final quality of the finished product character library is ensured.
Fig. 5 is a flowchart of a skeleton-line-based word-making method according to a second embodiment of the present invention, where on the basis of the first embodiment, as shown in fig. 5, the method of this embodiment, step 102, specifically includes:
the components that make up the character are extracted from the base character set to form a component library.
In this embodiment, specifically, the components constituting the character are extracted from the basic character set to constitute a component library. The resulting component library will include a plurality of components. Each component comprises: the method comprises the steps of identifying a component identification code and component skeleton line information, wherein the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width, stroke information and a skeleton line coordinate point.
Specifically, parts of all characters can be automatically separated from a prepared basic character set, similarity combination is carried out, and a part is reserved for each character of the font, so that a part library is formed. Whereby each component comprises: the pen comprises a component identification code, a character-shaped skeleton line, a pen stroke and a first pen stroke width.
For example, fig. 6 is a schematic diagram of skeleton line and stroke information of units "alpha" and "" in the skeleton line-based word-making method according to the second embodiment of the present invention. The information of the components, & and are as follows in Table 2.
Information of Table 2 parts of [ & gt and
The component part information includes: part conversion information including offset parameter information, scaling parameter information, rotation parameter information of the part in the character;
step 104, specifically comprising:
and acquiring the component skeleton line information of each component of the current character from the component library, processing each component according to the conversion information in the character combination template, and converting each component in the component library onto a target component of the font to be developed so as to convert each character in the character combination template into a character set of the font to be developed.
Wherein, transform each part in the part storehouse to the target part of the typeface of waiting to develop on, include:
transforming skeleton line coordinate points P0(X0, Y0) of each stroke of the part in the part library to contour points P (X, Y) of each stroke of a target part of a font to be developed, wherein (X, Y) — (X0, Y0) × Mat2+ (XOffset, YOffset), Mat2 is parameter information of scaling, rotation and the like of a two-dimensional transformation matrix description part, XOffset represents the offset of the X direction, and YOffset represents the offset of the Y direction;
transforming a first stroke width of each stroke of a part in the part library into a second stroke width of each stroke of a target part of the font to be developed, wherein the second stroke width
w is the first stroke width, x is the part lateral scaling, and y is the part longitudinal scaling.
In this embodiment, specifically, the group character template includes character group character information to be automatically generated into characters, each character group character information includes character codes and component information, wherein the component information includes component identification codes and component transformation information, the component transformation information includes offset parameter information, scaling parameter information and rotation parameter information of components in the characters, a two-dimensional transformation matrix Mat2 ═ a11 a12 a21 a22 is constructed according to the component transformation information to represent rotation, tilt and scaling transformations of the components, and XOffset and YOffset are used to represent corresponding translation transformations.
Then, according to the component library and the character forming template, a character set of the font to be developed is generated. The method specifically comprises the following steps: and acquiring the component skeleton line information of each component of the current character from the component library, processing each component according to the conversion information in the character combination template, and converting each component in the component library onto a target component of the font to be developed so as to convert each character in the character combination template into a character set of the font to be developed. The characters included in the character set of the font to be developed are identical to the characters of the character-forming template in step 103.
Specifically, each part in the part library is transformed to a target part of the font to be developed and is divided into two parts. One part is the transformation of the skeleton line, each coordinate point of the skeleton line is transformed, and the skeleton line coordinate point P of each stroke of the parts in the part library is transformed
0(a
0,b
0) And converting the outline point P (a, b) of each stroke of the target part of the font to be developed, wherein (a, b) ═ a
0,b
0) Mat2+ (XOffset, YOffset), Mat2 is parameter information of scaling, rotation, etc. of a two-dimensional transformation matrix description component, and (a, b) ═ a can be obtained
0+a
0*XScale,b
0+b
0YScale) + (XOffset, YOffset), XScale denotes the X-direction scaling value, YScale denotes the Y-direction scaling value, XOffset denotes the X-direction offset, and YOffset denotes the Y-direction offset. The other part is the transformation of stroke, the stroke of the font has a certain width, when the stroke skeleton line is scaled and changed, the corresponding stroke width needs to be scaled and transformed at the same time, and the calculation method of the transformation of the font stroke width is as follows: setting the transverse scaling of the component as x and the longitudinal scaling of the component as y, and converting the first stroke width of each stroke of the component in the component library into the second stroke width of each stroke of the target component of the character to be developed
Wherein w is the first stroke width. Fig. 7 is a schematic diagram of an effect of automatic character-making in the character-making method based on skeleton lines according to the second embodiment of the present invention, as shown in fig. 7, the upper half is an effect after skeleton line transformation, and the lower half is a final character-making effect after stroke transformation processing is added.
After step 104, further comprising:
step 201, integrating a basic character set and a character set of a font to be developed to form an integrated character set; and correcting the integrated character set to form a corrected integrated character set.
In this embodiment, specifically, the basic character set and the character set of the font to be developed are integrated to form an integrated character set. Then, the characters can be manually checked one by one, the characters with problems are found and manually corrected, finally, the font data form a complete font library, and a corrected integrated character set is obtained.
By the scheme, the problem of scaling and deformation of the components in the original character making scheme can be solved, and only a small number of Chinese characters need to be designed and made; meanwhile, the components can be arbitrarily zoomed and cannot be deformed, so that the prototype component can be manufactured only once without simultaneously manufacturing a plurality of components, the number of the characters which are initially designed and manufactured is reduced, the working efficiency is improved, and the final quality of the finished product word stock is not influenced.
In the embodiment, a basic character set is obtained, and the basic character set comprises at least one character; constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point; selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component information, and the component information describes components and component transformation information; converting each character in the character combining template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combining template; integrating the basic character set and the character set of the font to be developed to form an integrated character set; and correcting the integrated character set to form a corrected integrated character set. Therefore, fewer Chinese characters are designed and manufactured, less manpower is invested, the character manufacturing efficiency is improved, the character manufacturing time is reduced, and the character manufacturing cost is reduced; meanwhile, because the skeleton lines and the stroke data of the original components are directly used for word composition, the style of the font stroke shape is ensured, and the problem of stroke deformation in the existing automatic spelling process is solved, so that the style of the character in the resulting character library is more uniform, the working efficiency of character library development is improved, and the final quality of the finished product character library is ensured.
Fig. 8 is a schematic structural diagram of a skeleton line-based word-making device according to a third embodiment of the present invention, and as shown in fig. 8, the device according to the present embodiment includes:
an obtaining module 31, configured to obtain a basic character set, where the basic character set includes at least one character;
the building module 32 is configured to build a component library according to each character of the basic character set, where the component library includes at least one component, each component includes component skeleton line information, the component skeleton line information includes at least one stroke, and each stroke includes a first stroke width and a skeleton line coordinate point;
a selecting module 33, configured to select a character-forming template similar to the style of the font to be developed according to the style of the font to be developed, where the character-forming template includes character-forming information for automatically generating characters, each piece of the character-forming information includes component information, and the component information describes a component and component transformation information;
and the conversion module 34 is used for converting each character in the character combination template into a character set of the font to be developed according to the component skeleton line information in the component library and the component information in the character combination template.
The skeleton-line-based word-making device of this embodiment can execute the skeleton-line-based word-making method provided by the first embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment, a basic character set is obtained, and the basic character set comprises at least one character; constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point; selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component information, and the component information describes components and component transformation information; and converting each character in the character combination template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combination template. Therefore, fewer Chinese characters are designed and manufactured, less manpower is invested, the character manufacturing efficiency is improved, the character manufacturing time is reduced, and the character manufacturing cost is reduced; meanwhile, because the skeleton lines and the stroke data of the original components are directly used for word composition, the style of the font stroke shape is ensured, and the problem of stroke deformation in the existing automatic spelling process is solved, so that the style of the character in the resulting character library is more uniform, the working efficiency of character library development is improved, and the final quality of the finished product character library is ensured.
Fig. 9 is a schematic structural diagram of a skeleton-line-based word-making device according to a fourth embodiment of the present invention, and based on the third embodiment, as shown in fig. 9, the device according to the present embodiment, a building module 32, is specifically configured to:
the components that make up the character are extracted from the base character set to form a component library.
The component part information includes: component transformation information;
the transformation module 34 is specifically configured to:
and acquiring the component skeleton line information of each component of the current character from the component library, processing each component according to the conversion information in the character combination template, and converting each component in the component library onto a target component of the font to be developed so as to convert each character in the character combination template into a character set of the font to be developed.
Specifically, the transformation module 34 is specifically configured to:
acquiring component skeleton line information of each component of the current character from a component library, processing each component according to transformation information in the character combination template, and processing skeleton line coordinate points P of each stroke of the components in the component library0(a0,b0) And converting the outline point P (a, b) of each stroke of the target part of the font to be developed, wherein (a, b) ═ a0,b0) Mat2+ (XOffset, YOffset), Mat2 is scaling and rotation parameter information of a two-dimensional transformation matrix description component, XOffset represents offset in X direction, YOffset represents Y directionThe offset of (a);
transforming a first stroke width of each stroke of a part in the part library into a second stroke width of each stroke of a target part of the font to be developed, wherein the second stroke width
w is the first stroke width, x is the part lateral scaling, and y is the part longitudinal scaling.
Further comprising:
the integration module 41 is configured to, after the conversion module 34 converts each character in the character combination template into a character set of a font to be developed according to the component skeleton line information in the component library and the component information in the character combination template, integrate the basic character set and the character set of the font to be developed to form an integrated character set; and correcting the integrated character set to form a corrected integrated character set.
The skeleton-line-based word-making device of this embodiment can execute the skeleton-line-based word-making method provided by the second embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment, a basic character set is obtained, and the basic character set comprises at least one character; constructing a component library according to characters of the basic character set, wherein the component library comprises at least one component, each component comprises component skeleton line information, the component skeleton line information comprises at least one stroke, and each stroke comprises a first stroke width and a skeleton line coordinate point; selecting a character forming template similar to the style of the font to be developed according to the style of the font to be developed, wherein the character forming template comprises character forming character information of characters to be automatically generated, each character forming character information comprises component information, and the component information describes components and component transformation information; converting each character in the character combination template into a character set of a font to be developed according to the information of the component skeleton line in the component library and the information of the component parts in the character combination template; integrating the basic character set and the character set of the font to be developed to form an integrated character set; and correcting the integrated character set to form a corrected integrated character set. Therefore, fewer Chinese characters are designed and manufactured, less manpower is invested, the character manufacturing efficiency is improved, the character manufacturing time is reduced, and the character manufacturing cost is reduced; meanwhile, because the skeleton lines and the stroke data of the original components are directly used for word composition, the style of the font stroke shape is ensured, and the problem of stroke deformation in the existing automatic spelling process is solved, so that the style of the character in the resulting character library is more uniform, the working efficiency of character library development is improved, and the final quality of the finished product character library is ensured.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.