Content of the present invention
Therefore purpose of the present invention is promptly providing a kind of technology to eliminate above-mentioned shortcoming, and can be further in view of the above technology as the basis of future development correlation technique.For example on the correlation techniques such as identification of the analysis of Chinese file and Chinese font and font.More specifically, the present invention seeks to provide a kind of method, device and computer readable media can be used to producing the stroke direction pattern is basic peripheral font data, and makes this font data to use on the output instrument of different resolution demands.
Of the present invention can the realization by following mode, the present invention discloses production method a kind of and the font image that resolution is irrelevant, and method can produce the font image and be presented on the output instrument of any one resolution of being scheduled in advance in view of the above.Each is defined by the basis by one group of basic strokes guiding pattern by the font image of generation.This kind method selects a font to be presented on the output instrument, and the acquisition basic strokes guiding pattern that prestores is built this font.This basic strokes guiding pattern that prestores includes outer showing and two kinds of implicit data informations, shows prefabricated key point and the width that data information comprises at least one stroke sign indicating number outward.And implicit data information comprises the unique point that define pattern shape and the parameter value of segment of curve, and unique point wherein, curve values, the level that reaches resolution have defined on the peripheral curve of a pattern stroke crossing information that overlaps each other.Secondly, the inventive method reaches the pattern shape that implicit data information presents corresponding each resolution level by each outer showing of being scheduled to and prestoring that these are captured in the stroke direction pattern sign indicating number.
Also comprise the pattern peripheral shape that each is produced and do the action that presents of the present invention further comprising when adopting stroke direction figure quadrat method to produce dot-matrix character font, comprises the action that presents of the picture sideline and the blacking that stains.
The information that segment of curve in the definition that further comprises the stroke direction pattern of the present invention intersects is and resolution hierarchical structure tree and corresponding closely bound up in the unique point and the curve values of each level.
The pattern shape that further comprises pattern required decision in the process of the blacking action in video picture space of the present invention, be that to set the number of levels that is prestored according to the resolution hierarchical structure relevant with definition pattern institute, that is the data information in the corresponding level that captured of video picture Spatial Dimension decision, and these data can decide its pattern shape on the video picture space according to the position of the prestore key point of this pattern on the font space.
Allow the user go to define one group of font with one group of basic strokes guiding pattern collection of the present invention further comprising with a graphic interface tool, wherein each font is with at least one stroke definition, and stroke is by at least two key points and at least one width value, and generates defined unique point, curve values and video picture degree number of levels according to the form of a stroke or a combination of strokes and produce its form of a stroke or a combination of strokes on the video picture space.This graphic interface tool allows the user capture similar pattern from one group of font, and wherein each pattern comprises a stroke at least.When if these similar patterns are made up of the overlapping crossing institute of some strokes, this instrument can allow the user define these stroke joinings according to the chosen pairing segment of curve of each different video picture degree number of levels in the mode of narrating, making these joinings that are defined to count up to entirely in the different layers group is calculated according to narrating mode, its result and can showing in the inverse process when each similar pattern shape is on picture is verified, instrument is just watched the effect of these pictures according to the user then, stroke data and they are stored at the pen type intersection data of each different video picture number of levels, show and implicit supplemental characteristic to constitute the outer of a basic pattern of definition, as the further coinage work again of this instrument is provided.
In sum, after the shortcoming of some the present font technology more than the citation, the invention provides the group word method of the stroke direction pattern of a kind of novelty and progress.Its purpose is to provide a kind of method, device and computer readable media can store the relevant data information of font peripheral shape effectively, that is employing stroke direction pattern is the peripheral font data on basis, and the data information relevant according to these peripheral shape that are stored, effectively font is presented, comprise the output action that the font blacking is become dot matrix.
Every advantage of the present invention and viewpoint can obtain more deep understanding from the preferential embodiment of following accompanying drawing and detailed description, accompanying drawing wherein has:
Specific implementation
Fig. 1 illustrates the synoptic diagram of implementing the inventive method and apparatus system.Represent among the figure that when the software operating system that disposes a visual window type, for example (Windows 95 for form 95 with the system of a printer 12 of digital machine 10 couplings of a broad sense purposes
TM), just can implement method of the present invention fully.The video picture screen of printer 12 and digital machine 10 can print off and show the quality of low resolution (as dot matrix) or high image resolution (as laser), the computer system of other forms, for example guiding principle road type or large scale system, providing under the condition of compatible windows workspace system, also can be used to implement the present invention.
The data of peripheral font that the present invention produces, be with the standard to describe archives (.pdf) of printer and the data layout of other peripheral fonts be compatible.And the peripheral font data that these can be operated on different instruments has the characteristic that produces the detailed peripheral shape of various level from one group of independent data set.
The invention provides one group of independent data set that a system produces the definition font, and the composition data of building peripheral font from these data sets that produced.This independent data set is that the font that is used for being described in each different resolutions of multilayer level generates, and native system is the generation that defines font by the information that acquisition from the data bank of predefined basic strokes produces necessary pattern collection.Each pattern comprises an independent stroke at least, perhaps comprises a plurality of crossing strokes.One group of pattern collection that basic pattern collection is a breviaty, they are the topological peripheral shape that are used for representing all patterns that appear at the type matrix font.The step that produces one group of peripheral font with the defined method of this stroke foundation pattern is shown in Fig. 2 (1), and its details will be in following description.Fig. 2 (2) demonstrates out becomes the process of peripheral basic font by the defined reconstruction stroke foundation of the program font of Fig. 2 (1).Fig. 3~Fig. 8 examples more of the present invention of demonstrating out, its details will be in following descriptions, and these examples only provide exemplary illustration to use.
The step of Fig. 2 (1) is demonstrated out and how is gone to produce the step of basic peripheral pattern from predefined stroke foundation font collection.These predefined stroke foundation font collection are defined fonts on the font space of a plurality of level resolutions by some prefabricated key points and width value.The available following equation of the definition of the basic strokes of stroke foundation font is represented:
S
i=f
i({K
j},{W
m},L), i=1,……n
S=stroke shape wherein
I=stroke sign indicating number
f
i=generation stroke sign indicating number is the algorithm of the stroke shape of i
K=input key point position
J=is the crux point coding of i at the stroke sign indicating number
W=imports width value
M=is the width sign indicating number of i at the stroke sign indicating number
L=input resolution level
Each stroke be by one group of shellfish now triangle (segment of curve) define its peripheral shape, and the leg-of-mutton now number of these shellfishes segment of curve that can capture different numbers according to the difference that different printers or video picture instrument are imported the resolution level generates the stroke shape in a font.
How Fig. 3 (1)~Fig. 3 (7) uses a kind of computer aid to define the curve values of a stroke at L level resolution if demonstrating.Type designer is created enough curve information and is used for low resolution video picture on the computer aid, and the information of enough curves describes more detailed shape and uses for the high image resolution video picture, and these curve information are stored the list data structure that becomes a tree-shaped level of correspondence.
This computer aid can at first produce their line and produce the intermediate controlled point that can move about at the line mid point between two unique points, adopt secondary Bezier curve calculating formula to produce a secondary Bezier curve section in two unique points and shellfish that intermediate controlled point constituted now in the triangle, the geometric figure that produces the secondary Bezier curve is to be accompanied by a triangle with regard to secondary Bezier curve shown in Fig. 3 (1), two end points P of leg-of-mutton head and the tail
1And P
2Be unique point, summit P
mBe the intermediate controlled point that can move about, this triangle is called shellfish triangle now again.Simultaneously, at the leg-of-mutton now bottom line P of shellfish
1P
2Mid point and summit P
mBetween connect a line segment, the Bezier curve section 145 that is then produced is by the mid point 146 of this line segment, and this line is respectively at P
1And P
2On the point and P
1P
mAnd P
2P
mTangent.
Shown in Fig. 3 (2), font design person needs to be engaged in the description program of curve structured on the CAD (computer aided design) instrument, so that the desired data structure that can reach low resolution video picture respectively in high image resolution to be provided.At first a font design person produces a shellfish triangle and Bezier curve section now between two adjacent feature points, and then according to the segment of curve subdivision rules, in each alternative Process, the segment of curve in each consideration is divided into two segments, makes two features produce more intermediate controlled point and approach the required curve shape of high image resolution gradually.For example segment partly 145 program of curve epimere if font design person wants to make shown in Fig. 3 (1), then font design person is chosen in unique point P
1Instruction with point 146 line intercropping segmentation curve, at this moment the picture intermediate controlled point that can occur moving about is on the mid point of this section line, and mobile intermediate controlled point produces shellfish triangle and the Bezier curve alternative acts of approaching with another detailed segment of curve of finishing shown in Fig. 3 (1) now.
In the process shown in Fig. 3 (2)~Fig. 3 (7), font design person specifies the curve level sign indicating number of the structuring segment of curve that is produced respectively in each pilot process, font design person can it be subdivided into a lot of little segment of curve of hierarchical structure with a curve specific definition between two unique points, level the more more can satisfy the required of high image resolution video picture, the lower segment of curve data of also available level provide low resolution video picture to use simultaneously, so the setting of curve level sign indicating number provides the problem that solves high image resolution and low resolution data and appearance, this discovery also is emphasis of the present invention place.
The node of each curve level is represented the one group of intermediate controlled point or the brotgher of node of its ratio value in this tree data structure, their level code is stored in storer, as representing the intermediate controlled point of describing this level segmentation segment of curve between two adjacent feature points or the data group of its ratio value.
Below be to describe Fig. 3 (2) according to above-mentioned explanation, font design person searches the form 147 of getting the curve level, and reaching and keying in a curve level sign indicating number at square frame 149 is 0, has an intermediate controlled point P this moment
1Appear at adjacent feature point P
AAnd P
BBetween, note that intermediate controlled P
1Be to be positioned near unique point P
A65 li of figure three (3) workspaces, this moment, the curve level was that the 0th layer of stored point data is (P
AP
1P
B).
At Fig. 3 (4) font design person being shown, to define the curve level on curve form 147 be the 1st layer situation, shown in Fig. 3 (5), and P
1Be P
AAnd P
BSome cutting curves become two sections place on the line, therefore will be at P
AAnd P
1Between segment of curve be subdivided into two sections, P wherein
0Be its appointed new intermediate controlled point respectively, and because P
1And P
BBetween curve shape in level equal on 1 to coincide font design person's requirement, so this section needn't segment again, makes that the 1st level is by segment of curve (P
AP
0P
1) and segment of curve (P
1P
3P
B) constitute.Font design person shown in Fig. 3 (6) is in the situation of curve form 147 definition curves the 2nd level, and shown in Fig. 3 (7), font design person is with P
1And P
3Between segment of curve and P
3And P
BBetween segment of curve be subdivided into two sections respectively, produced new intermediate controlled point P
2And P
4In dividing on other segment of curve, make that the 2nd curve level is by the first segment of curve (P
AP
0P
1), the second segment of curve (P
1P
2P
3), and the 3rd segment of curve (P
3P
4P
B) constitute.
Fig. 3 (8) illustrates by step such as above-mentioned Fig. 3 (2)~defined entire curve section of Fig. 3 (7) (code equals 0), and it is stroke code 0 a stored part data information, shows the data structure of this stroke code at this segment of curve.Stroke code 0 is the key point that is defined on form (341,31) and (38,344) by two, and two width reference values 10 and 20 are the data information of its external appearance.Its inner implicit data information comprises unique point and structuring curve values, and wherein Fig. 3 (8) code is that two adjacent feature points of 0 and 1 are that spatial relationship value according to they and key point and width is a data storing.Adjacent feature point P shown in Fig. 3 (2)~figure three (7)
AAnd P
BBetween the segment of curve code be 0, be to P with each node
AP
B(P
AAnd P
BLine) distance proportion is stored for their data, and tree structure 143 wherein is that the tabulation mode with Infix mark 144 stores.In tree structure 143, two unique point P
AAnd P
BBetween the structuring segment of curve be that triangular apex (intermediate controlled point) is to the data storing of the ratio value of bottom line now with shellfish, the structuring level is then represented the acquisition scope of respectively this data information of resolution from low to high, for example the node P of the superiors of tree structure 143
1Being returned in the 0th level is that to belong to the curve level be 0 node (referring to Fig. 3 (2)~Fig. 3 (3)), so P
AP
1P
BIt is the segment of curve of corresponding the 0th level.In like manner, the second layer of tree structure 143 joint P
0And P
3By being returned in the 1st level, they are that to belong to the curve level be 1 node (referring to Fig. 3 (4)~Fig. 3 (5)), so P
AP
0P
1And P
1P
3P
BBe the segment of curve of corresponding the 1st level, on this level, be to use P
0And P
3Ratio value.The rest may be inferred, when the node ratio value of a curve level build finish after, it will be used to produce corresponding intermediate controlled point and their shellfish triangle or Bezier curve section now according to number of levels.The ratio value of intermediate controlled point is an Infix mark 144 of once being finished and be stored into the wire tabulation according to the demand minute level of resolution by construction as can be known in view of the above, so, the segment of curve performance of this mode, it is the use that video picture on the different resolutions space just can be provided with minimum storage area, the Infix mark 144 of very middle wire tabulation is a kind of storing mode of tree structure 143, other wire mark, also suitable equally as Postfix or Prefix mark.
When the curve data of every level after step is finished shown in Fig. 3 (2)~Fig. 3 (7), font design person just specifies each number of levels to go the scope of corresponding certain dot matrix size, the synoptic diagram of its situation as shown in figure 15, therefore the font video picture of any point matrix size all has the curved layer progression of a correspondence, can automatically find out to be fit to the curve data value that this size is used.For example, if the curve data of a certain segment of curve provides when hanging down the less dot matrix size of resolution video picture use, after the curve data difference video picture of using an intermediate controlled point (number of levels equals 0) and a plurality of intermediate controlled points (number of levels is greater than 0), observe effect effect about the same or the former (low layer progression) that they produce when better, then font design person can determine that certainly specifying the corresponding curved layer progression of this dot matrix size is 0, because can make the time of calculated curve shape minimum and be adapted at the computing of video picture most like this.
Shown in Fig. 3 (9), font design person selects the instruction 150 of Add Level on the drop down list of the key frame of deviser's computer aid, and each is stored the scope of the dot matrix size of level to do setting.Shown in Fig. 3 (10), select Add Level instruction 150 just to augment a folded AddLevel form 152 thereon, comprise the block 154 of a set point matrix size scope in it, and the viewing area 156 of a number of levels correspondingly-sized scope.Example in Fig. 3 (10), font design person keys in dot matrix and is of a size of 24 in the zone 154 li, and therefore, shown in Fig. 3 (11), it is 0 curve numerical value that the size below can all dot matrix sizes of indication 24 * 24 viewing area 156 in reaching is all used number of levels.In Fig. 3 (11) lining, font design person imports next peak matrix scope=64 154 li of blocks, and therefore, shown in Fig. 3 (12), it is that 1 dot matrix range of size is by 25 to 64 that viewing area 156 just illustrates respective layer progression.At last in Fig. 3 (12) lining, behind font design person's input point matrix chi) the zone, so form of a stroke or a combination of strokes 189b can remain on the video picture grid of delegation.
Figure 11 (1) illustrates another and is engaged in the skill that starts the hint action, the font shown in Figure 11 (1) left side for example, and for keeping the cleaning of this font in the form of a stroke or a combination of strokes of straight pen direction, its vertical stroke all need have the width of two pixels.But because the straight pen position is that leap is between two neighbor grids usually, make the straight pen scope system that has be activated to occupy a pixel style, the straight pen scope that has then is to be activated (referring to the startup of blacking action) to occupy two pixel grids, and this kind causes the situation of inconsistent straight pen width just shown in the dot-matrix character font on Figure 11 (1) the right.Consistance for the width of straight pen when dot matrix is exported that keep some approximately equal width, must determine width range that each straight pen is shared and the pixel grid number that occupies earlier, if this grid number that is determined is odd number, then with the center that key point moves to the grid that this point is located in that is labeled of each stroke; If otherwise even number then moves on the hithermost mesh lines.Shown in Figure 11 (2), when the key point of all straight pens all is moved on the hithermost mesh lines of they difference, just can keep the consistance of the straight pen width of this dot-matrix character font.
As mentioned above; when font shows its dot-matrix character font at low resolution; the horizontal parallel in the yi word pattern or the stroke of vertical parallel; usually can be accompanied by phenomenon superimposed or that separate; and cause the unbalanced video picture of parallel strokes; for example the by-level stroke can be because up and down superimposed other horizontal strokes or intermediate vertical stroke can superimposed other vertical stroke in the left and right sides, and cause font to produce unbalanced phenomenon in this superimposed part.Fig. 9~Figure 11 illustrates phenomenon and the solution of the present invention that this problem may take place.
Three horizontal strokes 420,422,424 shown in Figure 12 (1), superimposed is to occur on two horizontal strokes 420 and 422, this situation is can not be received, because these three strokes all should separately be shown in the video picture respectively.Following rule can solve the above-mentioned superimposed problem that; (1) stroke that goes up most can up be moved lattice.(pixel grid), (2) stroke under can be allowed to toward moving down lattice.Therefore, Gui Ze settlement procedure is in view of the above: if discover superimposed situation is arranged, whether the stroke under at first checking can be toward moving down lattice, otherwise, check whether the stroke that goes up most can up move lattice, whether the method for checking is to check that sign key point with stroke moves up and down can cause with other strokes superimposed, superimposed inspection system to be learnt by the plus-minus program that it indicates after key point moves by the stroke width value.The employed rule of example of Figure 12 (1) is that at least one lattice of spacing and the stroke 426 of horizontal strokes has a grid at least outstanding bottom.Figure 12 (2) illustrates according to said procedure and moves up and down three resulting results of horizontal vertical stroke.
Three vertical stroke 430,432,434 shown in Figure 13 (1), unbalanced distribution is to occur in the center of stroke 432 near stroke 434 (distance is lattice) and than the situation away from stroke 430 (apart from being two lattice), this situation is can not be received, because these three strokes should keep being symmetrical in its video picture.Following rule can be in order to solve asymmetry problem: (1) checks between two strokes that whether less white point space can be extended, if then whether (2) bigger white point space can be reduced, makes that the white point space that dwindles is consistent with the smaller.Above-mentioned method of checking is to check the sign key point move left and right of stroke, and the distribution of being subtracted each other by width value between two strokes is learnt again.The employed rule system of the example of Figure 13 (1) makes that toward the lattice that move to right the white point space length of 432 of it and strokes is two pixels with stroke 434, therefore obtain and stroke 432 and its left side stroke 430 between have identical white point space.If the right stroke 434 can not move to right (generation meeting and other strokes have intersect and outstanding on one side situation), then left side stroke 430 can rely on that stroke 432 is moved lattice and the white point space that dwindles them, shown in Figure 13 (2) according to the resulting result of above-mentioned rule.
Figure 14 (1) illustrates the situation that four parallel vertical strokes are answered consistent inconsistent dot-matrix character font video picture may take place.Shown in the font of Figure 14 (1) left side, white point spacing between white point spacing between two strokes 442 and 446 and two strokes 440 and 442 is all three pixel grids, but the white point spacing between two strokes 446 and 448 but is two pixel grids, the handling procedure of the foregoing straight pen symmetry of the solution of this kind situation, Figure 14 (2) illustrate the situation that right pen 448 is moved right lattice and make the video picture symmetry of straight pen.
Cause an overlapping situation that links together of the parallel strokes in the pattern through regular meeting when hanging down the resolution video picture, perhaps cause a plurality of parallel strokes situation of uneven distribution singularly.For example the middle stroke of a pattern is because the relation that rounds up makes its more close left side stroke and away from the right side stroke, perhaps forms narrow or presents than the form of a stroke or a combination of strokes of broad.These phenomenons can improve through re-moving the position of stroke key point.In other words, when a pattern on a low resolution font space during video picture, it forms stroke may produce the pattern of distortion.Generation for fear of the distortion pattern, the stroke data that they are formed also need have the action of hint, and this corrigendum information can make can the action of fine setting key point position in the level of resolution level that begins to produce twisting situation and lower resolution.The mode that corrigendum information system decides key point to move according to the effect in the video picture of different resolution level institute, its mode comprise the edge that position with key point moves to grid element center or moves to grid.
The font generating technique is the reverse process process of font constructing technology.When the font on a pattern basis is required video picture, at first whether decision will start hint information according to the resolution level, if the key point that then each is labeled will start the time moves to the edge of grid element center or grid from its dot matrix grid (pixel) that is located in, each key point that is not labeled just not is moved; Characteristic point position just goes calculating to try to achieve according to key point position that newly obtains and width value then, and between every pair of adjacent feature point according to being stored the ratio value of intermediate controlled point, remove to calculate the segment of curve between them, segment of curve is coupled together the peripheral shape that just obtains the form of a stroke or a combination of strokes, be whether the predetermined regular deactivation pixel of basis is stain with a kind of blacking technology with form of a stroke or a combination of strokes peripheral shape institute area surrounded blacking technology at last, the rule that the present invention adopts is a basis; If the area of pixel is contained the person of being more than half by form of a stroke or a combination of strokes district; Perhaps when if the central point of pixel drops in the form of a stroke or a combination of strokes zone, this pixel blacking that then will export instrument.Certainly the blacking technology of other forms also can be in order to finish the generation of font.
As for this part thing system of hint information just starting below the resolution level at, which is determined by the font design personnel.For example if the font design personnel specify the level 1 of Fig. 3 (2)~Fig. 3 (13) for starting the level of hint information, then all sign key points that are lower than level 1 (comprising level 1) will show that its hint moves in every relevant calculating, in other words the curve data value that the key point position after usefulness moves is recomputated characteristic point position and calculated suitable level, and position that just can mobile key point when being higher than the video picture of level 1, concern the calculated curve data value according to the key point of former construction and the position of unique point, and the situation that font presents according to number of levels can be as shown in figure 15, make the font video picture of any point matrix size that the curved layer progression of one correspondence all be arranged, can automatically find out and be fit to the curve data value that this size is used.
Figure 16~Figure 18 illustrates via some fonts output examples after the method processing of the present invention, Figure 16 is phaneroplasm font some dot-matrix character fonts at 24 * 24 low resolutions, Figure 17 is the output (annotate: 48 reach the processing that following output all contains the hint action) of 48 * 48 resolutions, and Figure 18 is the output (annotating: need not hint the processing of action) of 128 * 128 resolutions.
In case after preferential embodiment of the present invention was disclosed and is described in detail, significantly, the personage who is familiar with this skill just was not difficult to make every change according to spirit of the present invention and scope, reaches the purpose the same with the present invention.