Pattern processing method

Abstract: A pattern processing apparatus comprises: a first memory which has character pattern data as coordinate array points and stores data indicating whether the coordinate points are the points constructing an outline of a character pattern or not; a second memory which stores absolute coordinate values as a reference point in the case where the coordinate points are not the points constructing the outline of the character pattern and also stores relative coordinate values from the reference point or another outline point or the absolute coordinate values as a reference point in the case where the coordinate points are the points constructing the outline of the character pattern; a reading device for receiving a character code and for reading out the coordiante data corresponding to the character code from the first or second memory on the basis of the character code; and a pattern forming device to form a character pattern corresponding to the character code from the coordiante data. Not only thicknesses of line segments of an outline constructing a character pattern but also stroke shapes of the line segments can be controlled, so that a character pattern can be generated at a high quality.

Description: The invention relates to an apparatus and method for generating character patterns. As typical apparatuses using such a kind of character pattern generator, there are a printer, a display apparatus, and the like provided with character font data called vector fonts, outline fonts, or scalable fonts which can generate characters with various modifications or characters of many kinds of sizes. In the above apparatuses, an outline of reference character data is provided as absolute coordinates of each of the coordinate points constructing such an outline, those coordinate values are multiplied on the basis of a magnification ratio or a reduction ratio according to a designated output size, the coordinate values of the outline corresponding to the designated character output size are calculated, and a character pattern is derived. Therefore, a variation occurs in thicknesses of line segments of a character which should inherently be uniform as shown in Fig. 4B due to a quantization error or the like which occurs when a character pattern is reflected to lattice points of a dot pattern at the designated character size to be finally generated. Particularly, in the case where a character pattern has been converted into a character of a small size, there is a problem such that a deterioration in apparent quality is remarkable. Fig. 4A is a diagram showing outline character pattern data of a type style Helvetica of European language fonts. Fig. 4B is a diagram showing an example of a dot pattern when characters have been developed into dot patterns by a conventional technique. As will be obviously understood from Fig. 4B, a vertical line portion shown by reference numeral 41 of a character "H" and lateral line portions shown by reference numerals 42 and 43 of a character "E" are reproduced thinner than the other portions due to a quantization error when converting character patterns into dot patterns. To solve the above problem, therefore, there is considered a method whereby an arbitrary coordinate point on an outline constructing reference character data is used as a reference, the coordinates of the reference point are stored as absolute coordinate values, other arbitrary coordinate points on the outline are made related by relative distances from the reference point, thereby preventing the deterioration in character quality mentioned above. (See for example patent specification US-A-4 298 945). Fig. 4C shows an example of character patterns which are generated as mentioned above. That is, by controlling thicknesses of vertical and horizontal lines constructing the character patterns, the thicknesses of the line segments shown at 41 to 43 in Fig. 4B are equalized with those of the other line segments, so that a character pattern of a higher quality can be generated. In the above conventional example, however, only the thicknesses of the line segments constructing a character pattern can be controlled. To reproduce a design of a complicated stroke shape as represented by a type style such as Optima of European language fonts shown in, for example, Fig. 5A, asymmetrical unbalanced character patterns are obtained as shown in Fig. 5B and character patterns of a high quality cannot be displayed and generated. In accordance with one aspect of the present invention, there is provided a character pattern generating apparatus, comprising: means for storing x and y coordinate information of at least one reference point for a character and for storing x and y coordinate information of a plurality of outline points lying on an outline of the character each relative to the, or one of the, reference points or another of the outline points; means for scaling the coordinate information in response to a magnification ratio to produce scaled coordinate information in which the coordinates are integer rounded; means for deriving from the scaled coordinate information absolute coordinate information of the points lying on the outline of the character; and means for generating a pattern of the character from the absolute coordinate information; characterised in that: the or each reference point does not lie on the outline of the character. With such an apparatus, it is possible to control not only thicknesses of line segments constructing character patterns but also stroke shapes of the line segments, and thus character patterns of high quality can be generated. In accordance with another aspect of the invention, there is provided a corresponding character pattern generation method. Preferred features of the invention are set out in the dependent claims. A specific embodiment of the invention will now be described by way of example with reference to the accompanying drawings, in which: Fig. 1 is a block diagram showing a schematic construction of a character pattern generator of an embodiment; Fig. 2 is a diagram showing an example of a content in a directory table of the embodiment; Fig. 3A is a diagram showing an example of a data construction of a font table of a character "H" in Fig. 3B in the embodiment; Fig. 3B is a diagram showing coordinate reference points and outline points of a character "H" in the embodiment; Figs. 4A to 4C are diagrams showing an example in the case where outline character data "HE" of an European language type style has been generated by a conventional character generator; Fig. 5A is a diagram showing outline character data "HE" of an European language type style Optima; Fig. 5B is a diagram showing an example in the case where the characters "HE" of Fig. 5A have been converted into dot patterns by a conventional apparatus; Fig. 5C is a diagram showing an example in the case where the characters "HE" in Fig. 5A have been converted into the dot patterns by the character pattern generating apparatus of the embodiment; and Figs. 6A and 6B are flowcharts showing character pattern generating processes according to the character pattern generating apparatus of the embodiment. A preferred embodiment of the invention will be described in detail hereinbelow with reference to the drawings. The invention can be applied to an apparatus or can be accomplished in a system comprising a plurality of apparatuses. The invention can be also accomplished by supplying a program to an apparatus or a system. [Description of character pattern generating apparatus (Fig. 1)] Fig. 1 is a block diagram showing a schematic construction of a character pattern generating apparatus of an embodiment of the invention. In Fig. 1, reference numeral 101 denotes an input device. For example, a character code signal, a pattern generating instruction, or the like as an object to be generated is supplied from an external apparatus or the like (not shown) to the input device 101. The input device 101 includes a signal holding circuit such as buffer or flip-flop and the like. Reference numeral 102 denotes a processor to generate a character pattern of designated size and type style in accordance with the character code signal, pattern generating instruction, or the like which has been supplied from the input device 101. For instance, the processor 102 has: a central processing unit (CPU) 13 such as a microprocessor or the like; ROM 14 in which a control program of the CPU 13 and various data have been stored; RAM 15 which is used as a work area of the CPU 13; and the like. Reference numeral 103 denotes a pattern data memory. Character pattern data comprising an outline shape of a character as a set of dot coordinates and character attribute data have previously been stored in memory addresses corresponding to a character code in the memory 103. The memory 103 is constructed by a non-volatile memory such as disk, read only memory, or the like. Reference numeral 104 denotes an output device to display and output the character pattern which has been processed by the processor 102. The output device 104 has: a signal holding circuit; a parallel/serial signal converting circuit; and a printing or displaying section such as printer, display, or the like. The operations of the input device 101, pattern data memory 103, and output device 104 are controlled by the processor 102. [Description of pattern data memory (Figs. 2 and 3)] Fig. 2 is a diagram showing an example of the memory contents in a directory table 11 in the pattern data memory 103 in Fig. 1. In Fig. 2, reference numeral 21 denotes an address area which is addressed on the basis of a character code. Font data of the corresponding character code has been stored in the address area. That is, in Fig. 2, it will be understood that the font data of the character code "1" is stored from address "1000" in a font table 12 and the font data of the character code "2" is stored from address "1550" in the font table 12. Fig. 3A is a diagram showing an example of a font data of a character pattern "H" shown in Fig. 3B which has been stored in the font table 12. Fig. 3B is a diagram showing outline points and reference points of pattern data of an European language character "H". Explanation will be made hereinbelow while making the contents in the font table 12 shown in Fig. 3A and the character pattern of Fig. 3B correspond each other. The European language character "H" as shown in Fig. 3B is expressed by coordinate values of a plurality of points in which coordinate values of control points starting from the coordinate values of a coordinate point A 1 (coordinate reference point) have been vector developed as shown in Fig. 3A. Coordinate points A 1 and A 2 are coordinate reference points which are not included in the outline constructing the character. That is, a flag indicating whether the coordinate points are the points which construct the outline of the character pattern or not is set to OFF for such coordinate reference points A 1 and A 2 . Only the coordinate reference points are expressed by absolute coordinate values in the case (X, Y) of the embodiment. As shown in Fig. 3A, a coordinate point train actually constructing the outline of the character "H" is expressed by an array of the coordinate points A 3 to A 50 . The flag indicating whether the coordinate points are the points constructing the outline of the character pattern which is formed by the coordinate points or not is set to ON. Fundamentally, those character points are expressed by relative distances from the coordinate points A 1 and A 2 as coordinate reference points. However, the relation between the coordinate reference points serving as a "mother" and the coordinate points serving as "children" may have a hierarchy structure as shown by Y coordinates of, for instance, the coordinate points A 4 to A 9 and A 11 , that is, a structure such that a "child" is replaced to "mother" and "children" exist under the "mother". It is needless to say that the data of the coordinate reference points is not the data as coordinate points but can be also prepared as reference values in another form. The coordinate reference points are not necessarily included in the outline of the character. On the other hand, the number of coordinate reference points is not limited to a plural number but can be also set to one. A construction of the font table 12 in Fig. 3A will now be described. The outline point A 3 is a start point of the outline and is expressed by the relative coordinates (A 1 -50, A 1 +220) from the reference point A 1 . A portion from the outline point A 3 to the outline point A 6 is defined as one curve. The outline point A 6 is a start point of the next curve. The above point will be understood from the fact that both of end and start flags of a curve attribute flag 31 of the outline point A 6 are set to ON. A portion from the outline point A 6 to the outline point A 9 is defined as one curve and the start flag of the curve at the outline point A 9 is not set to ON. Therefore, a portion between the outline points A 9 and A 10 is defined by a straight line. In a manner similar to the above, portions among the outline points A 48 , A 49 , A 50 , and A 3 are defined by one curve and the outline of the character "H" shown in Fig. 3B is formed. Fig. 6 is a flowchart showing a generating process of a character pattern in the character pattern generating apparatus according to the embodiment. The control program to execute the above process has been stored in the ROM 14 in the processor 102. The above processing routine is started when the character code signal, pattern generating instruction, or the like is supplied from the input device 101 to the processor 102. The processing routine will now be described on the assumption that the generation of a character pattern "H" as shown in Fig. 3A has been instructed. The input character code is first read out in step S1. In step S2, an address in the font table 12 in which the font data of the input character code has been stored is read out with reference to the directory table 11. After the address was obtained as mentioned above, the font data is read out of the font table 12 in step S3. A check is made in step S4 to see if an instruction of a size change, a rotation, or the like of the character is included in the pattern generating instruction or not. If there is a size change instruction, for instance, step S5 follows and the relative coordinates (Δx, Δy) of the font data are variably magnified in accordance with the size change data. If the character rotation or the like has been instructed in step S4, the coordinates Δx and Δy are converted in accordance with the rotation data. At this time, the values of Δx and Δy are rounded to integer values in order to prevent a quantization error on the dot pattern. The processing routine advances to step S6 and the reference point coordinates (coordinate values of A 1 and A 2 in the example of Fig. 3) of the font data are stored. In step S7, the coordinate values of the start point (A 3 ) are read out and the absolute coordinates are obtained on the basis of the coordinate values of the reference points. A check is made in step S8 to see if the end flag of the curve flag of the start point has been set to ON or not. If it has been set to ON, step S9 follows and the return flag of the RAM 15 is set to ON. The processing routine advances to step S10, the coordinate values (magnified values if the coordinates have already been magnified) of the next coordinate point are read out and line segments serving as an outline are formed on the basis of the coordinate values of the previous outline point. In the next step S11, a check is made to see if the end flag of the curve attribute flag of the outline point which had been newly read out has been set to ON or not. If NO, step S12 follows and a check is made to see if all of the fonts have been read out or not. If all of the font data are not read out yet, the processing routine is returned to step S10. If the end flag has been set to ON (for example, outline point A 6 ) in step S11, step S13 follows and the coordinate values which have been read out in step S10 are set to an end point of the current curve. Then, step S14 follows and a check is made to see if the start flag of the outline point has been set to ON or not. If YES (for instance, it is set to ON in the case of the outline point A 6 ), step S15 follows and the outline point is set to a start point of the next curve. Then, the processing routine is returned to step S10. If the start flag is not set to ON in step S14, namely, if only the end flag has been set to ON (for example, like the outline point A 9 ), step S17 follows and the next outline point (A 10 ) is read out. Then, step S18 follows and the previous outline point (A 9 ) and the outline point (A 10 ) which has been read out in step S17 are connected by a straight line. Step S19 then follows and a check is made to see if the start flag of the outline point which had been read out in step S18 has been set to ON or not. If NO, a straight line portion still exists. Therefore, the processing routine is returned to step S17. If the start flag has been detected (in the case of the outline point A 10 , the start flag is set to ON), step S15 follows and the foregoing process is executed. If all of the font data has been read out in step S16 or S12 (for instance, when the outline point A 50 has been read out), a check is then made in step S20 to see if the return flag has been set to ON or not, that is, whether the first start point of the outline coincides with the end point of the outline or not. In the case of Fig. 3A, since the start point A 3 of the outline coincides with the start point, the processing routine advances to step S21 and the start point (A 3 ) and the end point (A 50 ) of the outline are connected. After the outline of the character pattern was formed as mentioned above, step S22 follows and the inside of the outline of the character pattern is painted out, thereby forming a character dot pattern. After the dot pattern was formed as mentioned above, step S23 follows and the dot pattern is stored into the RAM 15 or transferred to the output device 104 comprising a display, printer, or the like and the processing routine is finished. Fig. 5C is a diagram showing a practical output example of character patterns "HE" shown in Fig. 5A according to the embodiment. The kind of the curve used in the embodiment relates to the B spline curve. However, the kind of outline segments constructing the character can be also set to another curve (Bezier curve or the like) or a straight line. As described above, according to the embodiment, there is an effect such that a character of a complicated shape which could not be generated at a high quality hitherto can be generated at a high quality and at a character size in a wide range without deteriorating the quality even after completion of the enlargement, reduction, or modification calculation by making the thicknesses of line segments uniform and by keeping a symmetry of the line segments.

Claims: A character pattern generating apparatus, comprising: means (103) for storing x and y coordinate information of at least one reference point (A1, A2) for a character and for storing x and y coordinate information of a plurality of outline points (A3 to A50) lying on an outline of the character each relative to the, or one of the, reference points or another of the outline points; means (102) for scaling the coordinate information in response to a magnification ratio to produce scaled coordinate information in which the coordinates are integer rounded; means (102) for deriving from the scaled coordinate information absolute coordinate information of the points lying on the outline of the character; and means (102) for generating a pattern of the character from the absolute coordinate information; characterised in that: the or each reference point does not lie on the outline of the character. An apparatus as claimed in claim 1, wherein the, or at least one of the, reference points lies within the outline of the character. An apparatus as claimed in claim 1 or 2, wherein the, or at least one of the, reference points lies outside the outline of the character. An apparatus as claimed in any preceding claim, wherein the storing means stores, for each point, an indication as to whether that point is a reference point or an outline point. An apparatus as claimed in any preceding claim, wherein the storing means stores, for each outline point, an indication as to which of the other points to which the coordinate information for that outline point is relative. An apparatus according to any preceding claim, further comprising means (104) for outputting the character pattern generated by said generating means. An apparatus according to claim 6, wherein said output means comprises a printer. An apparatus according to claim 6, wherein said output means comprises a display device. An apparatus as claimed in any preceding claim, wherein the or each reference point for the character is located at a, or a respective, point of symmetry of the character, or of a respective portion of the character. An apparatus as claimed in claim 9, wherein the character is the letter "H", having such reference points at the centres of the uprights of the letter. An apparatus as claimed in any preceding claim, wherein the storing means is arranged to store such reference point coordinate information and such outline point coordinate information for a plurality of different characters in a character set, and further comprising means (101) for inputting code information for selecting desired characters in the set whose pattern is to be generated. A character pattern generating method, comprising the steps of: using stored x and y coordinate information of at least one reference point (A1, A2) and stored x and y coordinate information of a plurality of outline points (A3 to A50) lying on an outline of the character each relative to the, or one of the, reference points or another of the outline points; scaling (S5) the coordinate information in response to a magnification ratio to produce scaled coordinate information in which the coordinates are integer rounded; deriving (S7) information absolute coordinate information of the points lying on the outline of the character; and generating (S22) a pattern of the character from the absolute coordinate information; characterised in that: the or each reference point whose coordinate information is used does not lie on the outline of the character. A method as claimed in claim 12, wherein the, or at least one of the, reference points lies within the outline of the character. A method as claimed in claim 12 or 13, wherein the, or at least one of the, reference points lies outside the outline of the character. A method as claimed in any of claims 12 to 14, further comprising using, for each point, a stored indication as to whether that point is a reference point or an outline point. A method as claimed in any of claims 12 to 15, further comprising using, for each outline point, a stored indication as to which of the other points to which the coordinate information for that outline point is relative. A method according to any of claims 12 to 16, further comprising the step of outputting (S23) the character pattern generated in said generating step. A method according to claim 17, wherein said output step is performed using a printer. A method according to claim 17, wherein said output step is performed using a display device. A method as claimed in any of claims 12 to 19, wherein the or each reference point for the character is located at a, or a respective, point of symmetry of the character, of a respective portion of the character. A method as claimed in claim 20, wherein the character is the letter "H" having such reference points at the centres of the uprights of the letter. A method as claimed in any of claims 12 to 21, wherein such reference point coordinate information and such outline point coordinate information is stored for a plurality of different characters in a character set, and further comprising the step of inputting code information for selecting a desired character in the set whose pattern is to be generated.

Inventors: WATANABE KIYOSHI, WATANABE, KIYOSHI, Watanabe, Kiyoshi, c/o CANON K.K.
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06T11
IPC codes: G06K15, G09G5, G06T11