Output device

Abstract: An output device has storage means for storing compressed font representing characters by compressed data corresponding to dot patterns, a first generation unit for generating dot patterns based on the compressed data and a second generation unit for generating outline information of characters from the compressed data and then generating dot patterns. The first generation unit or the second ganeration unit is selected in accordance with an output condition.

Description: The present invention relates to an output device for outputting characters by using a run length font. A conventional printer for printing characters of variable size has a single character generation system and character data adapted to the character pattern generation system. In the prior art printer which processes characters ranging from a large size to a small size by the single character pattern generation system, the following disadvantages are observed. (1) In the character pattern generation method which uses a system suitable for the generation of large size characters, quality of character is degraded when characters of small size is generated. (2) In a character pattern generation method which uses a system suitable for the generation of small size characters, quality of character is degraded when characters of large size is generated. In order to generate characters of all sizes in a single system without degradation of quality, much correcting information is required. Those problems equally apply, in many cases, to different types of character editing. US Patent No. 4079458 discloses a print apparatus in which character data can be stored in different formats according to the size of data. These data format may be run length incremental encoded format, ie. compressed data format used for large size characters and dot matrix data format used for small size characters. GB Patent No. 2131660 discloses a data processing method in which character data is stored in outline (vector) format which can then be subject to rotational transformations. SUMMARY OF THE INVENTION According to the present invention a printing apparatus for printing a dot pattern, comprising: storage means for storing compressed data representing a character corresponding to a dot pattern; is characterised in that said storage means is capable of storing first and second types of compressed data which are different from each other; and said apparatus further comprises: determining means for determining, in dependence on an output condition, for example character size or rotation angle, which of the first and the second type of compressed data is to be used; and pattern generating means for generating a dot pattern using the first or second type of compressed data in accordance with the determination made by said determining means. How the invention may be carried out will now be described by way of example only and with reference to the accompanying drawings in which: BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of an embodiment of a printer in accordance with the present invention, Fig. 2 is a flow chart illustrating control to the printer in accordance with the present invention, Fig. 3 diagrammatically shows a pattern, Fig. 4 shows run length data, Fig. 5 shows a method for reducing run length data, Fig. 6 is a flow chart for converting the run length data to spline type data, Fig. 7 is a flow chart for recognizing linear data, Fig. 8 shows a pattern represented on a third order spline, Fig. 9 illustrates how to convert successive points to a straight line, Fig. 10 shows curves represented by third order spline, Fig. 11 shows third order spline data including a curve, Fig. 12 is a block diagram of another embodiment, Fig. 13 is a control flow chart for the other embodiment, Fig. 14 shows a control flow chart for the other embodiment in Figs. 1 - 11. Fig. 15 shows rotated patterns at every 90 degrees, and Fig. 16 shows rotated patterns at any angles. DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 best shows a feature of the present invention. Numeral 1 denotes a host computer which sends data, numeral 2 denotes a printer which embodies the present invention, numeral 3 denotes a data receiver for receiving the data sent from the host computer 1, numeral 4 denotes a controller which decodes and executes the data received by the data receiver 3 and which has a program area PA for storing a control program represented by a flow chart shown in Fig. 2, numeral 5 denotes a small size character pattern generator which generates character patterns when characters smaller than a reference size are to be printed, and numeral 6 denotes a small size character data storage which stores data to be used when the character patterns are generated by the pattern generator 5. The small size character data may be run length font data. Numeral 7 denotes a large size character pattern generator which generates character patterns when characters larger than the reference size are to be printed. It may be a device which generates a third order spline curve to output characters. Numeral 8 denotes a data converter which generates character data to be used by the pattern generator 7, numeral 9 denotes an output interface which sends the print data generated by the controller 4 to a printer, and numeral 10 denotes the printer which prints out the print data sent from the output interface 9. Referring to a control flow chart of Fig. 2, the control to the present embodiment is explained. The data sent from the host computer 1, which may be edit information such as character code, size or rotation is received in a step S1. In a step S2, it is determined whether it is printing of characters smaller than a reference size or not. If it is the printing of the characters smaller than the reference size, the process proceeds to a step S3, otherwise the process proceeds to a step S4. In the step S3, character patterns of a designated size are generated by the small size character pattern generator by using the run length character data stored in the data storage 6. In the step S4, whether it is the printing of characters larger than the reference size or not is determined. If it is the printing of the characters larger than the reference size, the process proceeds to a step S5, otherwise the process proceeds to a step S7. In the step S5, the character data stored in the small size character data storage 6 is converted to format to be used in their large size character pattern generator 7, by the data converter 8. Detail thereof will be explained with reference to Fig. 6. In the step S6, character patterns of the designated size are generated by the large size character pattern generator 7 by using the third order spline curve based on the data converted in the step S5. In the steps S2 and S4, the reference size is 72 points although it is not restrictive. In the step S7, whether it is a print command or not is determined. If it is the print command, the process proceeds to a step S8, otherwise the process proceeds to a step S9. In the step S8, the command executed by the controller 4 is sent to the printer 10 through the output interface 9. In the step S9, a normal process is carried out. The small size character data storage 6 stores therein the pattern information in run length form. The term run length is frequently used in a facsimile machine and it may be an MR (modified READ) code. The run length data of the pattern shown in Fig.3 is shown in Fig. 4. In Fig. 4, coordinates of points at which white dots change to black dots on x-coordinates for each y-coordinate are shown. Normally, when a character is to be generated, a point which changes to black to a point before a point which changes to white are painted black. Fig. 5 shows a method to reduce the run length data. The original pattern for the run length data is of 72-point pattern size. When character of smaller than 72-point size is to be printed, a pattern is generated in accordance with this flow chart. In a step S51, a reduction factor d is calculated. In a step S52, a counter n is cleared. In a step S53, y max is set to a maximum y of the original pattern. In a step S54, end of pattern generation is checked. If y max < n/d, it is the end of pattern generation. In a step S55, the y-coordinate of the original pattern to be used in generating the reduced pattern is calculated and it is substituted for Y(n). In a step S56, an image area to be painted black extends from a point at which data changes from white to black to a point before a point at which data changes from black to white and the data in the line Y(n) is painted in accordance with the reduction factor. The x-coordinate is represented by a rounded number, ie. a whole number or integer, obtained by dividing the x-coordinate by the reduction factor. Thus, the integer representing the black coordinate divided by the reduction factor to a point before the integer representing the white coordinate divided by the reduction factor are painted. In a step S57, the y-coordinate counter is incremented by one and the process returns to the step S54. In this manner, the small size character patterns are generated in the step S3. The step S5 of Fig. 2 is now explained with reference to a detailed flow chart of Fig. 6. In Fig. 6, the data in the form of Fig. 4 is converted to data in a third order spline form. Namely, it is interpolated by a third order spline curve based on outline information of the pattern. In a step S61, the counter n is set to "1". In a step S62, x contents of y-coordinate designated by the counter n are fetched. The x contents are fetched in the order of black, white, black, white coordinates. In the step S63, the difference between the x-coordinate and the x-coordinate at the y-coordinate which is one smaller than the current y-coordinate is calculated and it is substituted for XD. In a step S64, XD is compared with a threshold δ which is a constant determined by a resolution power of the original data. If XD > δ, (for example, (x,y)=(12,7) and (7,8)), the process proceeds to a step S66 where the discontinuity of the points is registered. Otherwise, the process proceeds to a step S65 where the continuity is registered. In a step S67, whether all x contents of the line have been processed or not is checked, and if they have been processed, the process proceeds to a step S68, otherwise the process proceeds to the step S62. In the step S68, whether all data have been processed or not is determined by the EOD code included in the x-coordinate data. If they have not been processed the process proceeds to a step S69, otherwise the process proceeds to a step S70. In this manner, closed loop data representing an outline of the character is produced. In the step S69, the counter is incremented by one and the process returns to the step S62. In the step S70, the outline points are registered as three-order spline data based on the information registered in the steps S65 and S66. The continuous data is registered as continuous data, and discontinuous data is registered to be continuous with closest other discontinuous data or discontinuous data having the same y-coordinate. Since the third-order spline development method and data format are well known, detailed explanation thereof is omitted. The steps S61 - S70 are processed in the step S5 of Fig. 2 by the data converter 8 of Fig. 1. The data registered in the step S70 is developed in the step S6 by the third order spline method. Needless to say, the expansion of data of the third order spline method is superior in quality to the expansion by the run length method. In the step S70, the discontinuous data is rendered continuous and linear data is detected. Detailed flow thereof is shown in Fig. 7. Whether it is linear or not is determined by checking whether successive dots are on a straight line or not. In Fig. 7, in a step S71, whether succesive dots are on a straight line or not is checked. In a step S72, whether it is determined as a straight line or not based on the result of the step S71 is checked, and if it is determined as the straight line, the process proceeds to a step S73. In the step S73, successive dots on the outline are registered as a straight line having a start point and an end point. In this manner, points between the start point and the end point on the same line may be omitted. Data which identifies that this portion is the straight line may be additionally registered. Data necessary for various units described above or to be described later are stored in a work memory in the controller 4 shown in Fig. 1. Fig. 8 shows a third order spline representation of the pattern shown in Fig. 3. This pattern comprises aggregation of only straight lines. Fig. 9 illustrate linearization of successive points by the algorithm shown in Fig. 7. Fig. 10 shows how non-linearized successive points are developed. In the third order spline, they are represented as a smooth curve. Fig. 11 shows an example of data which in the third order spline system which includes curved portions. In Figs. 8 to 11, circle O indicates a control point of the third order spline. In accordance with the present embodiment, the following advantages are offered. (1) Degradation of print quality due to the character size is prevented. (2) A device to store special information for improving the print quality is not necessary and the increase of cost is suppressed. (3) Appropriate development method such as speed may be used depending on the size. (4) Data compression is attained. (Another Embodiment) Another embodiment which uses one of the generation methods explained in Figs. 1 - 11 depending the type of edition (for example, rotation) is explained with reference to Fig. 14. Run length font data (which is called non-rotation data in that arbitrary rotation is not permitted) instead of the small size character data is stored into the small size character data storage 6 shown in Fig. 1. Numeral 5 denotes a non rotation character pattern generator (which converts the run length font to a dot pattern), and numeral 7 denotes a rotation character pattern generator. Steps S141, S148, S149 and S150 in Fig. 14 are similar to the steps S1, S7, S8 and S9 in Fig. 2 and the explanation thereof is omitted. In a step S142, whether it is the printing of the non-rotation character or not is determined. If it is the printing of the non-rotation character, the process proceeds to a step S144, otherwise the process proceeds to a step S143. In the step S143, if it is the printing of the character of rotation at 90 degrees pitch, that is, 90 degrees, 180 degrees or 270 degrees. If. it is the rotation at 90 degrees pitch, the process proceeds to a step S144, otherwise the process proceeds to a step S145. In the step S144, the pattern is developed in a similar manner to that shown in Fig. 5. The generation of the rotation pattern at 90 degrees pitch from the run length data can be readily done by reversing the direction of coordinates or x - y axis conversion. In a step S145, whether it is the printing of character or not is checked. If it is the printing of character, the process proceeds to a step S146, otherwise the process proceeds to a step S148. In the step S146, the pattern is converted to third order spline data in the manner shown in Fig. 6. The third order spline data can easily be rotated to any angle. In a step S147, the pattern rotated to the designated and the data converted in the step S146 are generated and printed. Fig. 15 shows an example of pattern developed in the step S144. Fig. 16 shows an example of pattern developed in the step S147. In accordance with the present embodiment, the following advantages are offered. (1) Rotation of pattern to any angle. (2) High speed development of frequently used characters at 90 degrees pitch. A configuration of other embodiment of the present invention is now explained. Fig. 12 best shows a feature of the present embodiment. Numeral 1 denotes a host computer which sends data, numeral 2 denotes a printer applicable to the present invention, and numeral 3 denotes a data receiver for receiving the data sent from the host computer 1. Numeral 4 denotes a controller which decodes and executes the data received by the data receiver 3. It has a program area PA for storing a control program shown in a flow-chart of Fig. 13. Numeral 7 denotes a large size character pattern generator which generates character patterns when data decoded by the controller 4 is a print command to print characters larger than a reference size, numeral 11 denotes a large size character data storage which stores data used to generate the pattern by the pattern generator 7, numeral 5 denotes a small size character pattern generator which generates character patterns when data decoded by the controller 4 is a print command to print characters no larger than the reference size. numeral 6 denotes a small size character data storage which stores data used to generate the pattern by the pattern generator 5, numeral 9 denotes an output interface which sends the print data generated by the controller 4 to a printer, and numeral 10 denotes the printer which prints out the print data send from the output interface 9. Referring to the control flow chart of Fig. 13, the control of the present embodiment is explained. The data sent from the host computer 1 is received in a step S1. In a step S2, whether it the printing of characters of larger than the reference size or not is checked. If it is the printing of characters of larger than the reference size, the process proceeds to a step S3, otherwise the process proceeds to step S4. In the step S3, characters of a designated size are generated by the large size character pattern generator 7 by using the character data to be printed, which is stored in the large size character data storage 11. In the step S4, whether it is the printing of characters of no larger than the reference size or not is checked, and if it is the printing of characters of no larger than the reference size, the process proceeds to a step S4 otherwise the process proceeds to a step S6. In the step S5 characters of a designated size are generated by the small size character pattern generator 5 by using character data to be printed, which is stored in the small size character data storage 6. In the steps S2 and S4, the reference size is 72 points although it is not restrictive. In a step S6, whether it is a print command or not is determined. If it is the print command, the process proceeds to a step S7, otherwise the process proceeds to a step S8. In the step S7, the command executed by the controller 4 is sent to the printer 10 through the output interface. In the step S8, a normal process is carried out. The data stored in the large size character data storage 11 and the small size character data storage 6 may be character data represented by B spline and short vector, respectively. The B spline data permits high speed generation of high quality expanded pattern. On the other hand, the short vector data (which represents characters by straight lines) is faster than the B spline data but the quality in expansion is lower. Accordingly, it is not suitable for the expansion of larger than a predetermined size but it is sufficient to generate a small size pattern. In accordance with the present embodiment, the following advantages are offered. (1) Most appropriate pattern generation method such as print quality or speed may be selected depending on the character size. The above embodiment has two character generators for the large size characters and the small size characters. More than two character generators may be provided so that a character generator having a most appropriate generation method to the particular character size may be selected. In accordance with the present invention, the run length font is stored, and the dot pattern generated from the run length font or the character outline information is derived from the run length font and then the dot pattern is generated, in accordance with the output condition such as the output size.

Claims: A printing apparatus for printing a dot pattern, comprising: storage means (6) for storing compressed data representing a character corresponding to a dot pattern; characterised in that said storage means is capable of storing first and second types of compressed data which are different from each other; and said apparatus further comprises: determining means (4) for determining, in dependence on an output condition, for example character size or rotation angle, which of the first and the second type of compressed data is to be used; and pattern generating means (5,7) for generating a dot pattern using the first or second type of compressed data in accordance with the determination made by said determining means. An apparatus according to claim 1, wherein said output condition determines the size of a pattern to be printed. An apparatus according to Claim 1, wherein said output condition comprises character editing information. An apparatus according to claim 3 wherein said output condition determines an angle of pattern rotation to be effected. An apparatus according to any preceding claim, wherein the first type of compressed data comprise run length data. An apparatus according to claim 5, wherein the second type of compressed data comprise outline data. An apparatus according to any of claims 1 to 4, wherein the first type of compressed data comprise outline data. An apparatus according to claim 7, wherein the second type of compressed data comprise outline data. An apparatus according to any of claims 1 to 6, further including means (8) for generating the second type of compressed data from the first type of compressed data in the event that said determining means determines that the second type of compressed data is to be used. A method of printing a dot pattern using a memory (6) which stores compressed data representing a character corresponding to a dot pattern; characterised in that said memory is capable of storing first and second types of compressed data which are different from each other; and in that said method further comprises: determining (S2; S142,S143), in dependence on an output condition, for example character size (S2) or rotation angle (S142,S143), which of the first and the second type of compressed data is to be used; and generating (S3,S6) a dot pattern using the first or second type of compressed data in accordance with the determination made by said determining step. A method according to claim 10, wherein said output condition determines the size of a pattern to be printed. A method according to Claim 10, wherein said output condition comprises character editing information. A method according to claim 12 wherein said output condition determines an angle of pattern rotation to be effected. A method according to any preceding claim, wherein the first type of compressed data comprise run length data. A method according to claim 14, wherein the second type of compressed data comprise outline data. A method according to any of claims 10 to 14, wherein the first type of compressed data comprise outline data. A method according to claim 16, wherein the second type of compressed data comprise outline data. A method according to any of claims 10 to 15, further including generating (S5) the second type of compressed data from the first type of compressed data in the event that said determining step (S2) determines that the second type of compressed data is to be used.

Inventors: KURUMIDA TSUNEAKI, KURUMIDA, TSUNEAKI
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1989
Main classification: G06K15
IPC codes: B41J2, G06K15, G09G5, G06T9, G06F17, G06T11, G06F3