Abstract:
A method of generating character patterns to be printed on a printer, wherein each character is divided into line segments in the X or Y axis direction or 45°-angle direction on the X/Y coordinates. Segments are processed in pairs of contiguous, linked lines. The method eliminates the need for storing positional data for the node of linked lines, whereby the capacity of memory for storing numerous complex character patterns can be saved.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a method of generating character patterns and, more particularly, to a method of printing characters on a plotter or printer which prints characters by moving its pen in accordance with a control signal produced by a microprocessor or the like, wherein the amount of data necessary for printing the characters is reduced by a data compression method. 
     Generally, in printing characters in accordance with the control signals, each character is expressed as a group of straight lines or vectors, and, according to the conventional method, each straight line to be drawn needs two pieces of descriptive data, i.e., a start point and an end point. FIG. 1 shows a flowchart of the conventional method of generating character patterns, in which the coordinates of the start and end points for each straight line are read from a data table according to the ASCII code entered to the printer or plotter and the pen is moved to draw each segment of character in accordance with the two coordinates stored for each line. This prior art method, however, needs data for the start and end points of every straight line, thus using a large amount of data storage when printing a complex character, and therefore the number of character types handled by the printer or plotter is limited due to its finite memory capacity. In addition, handling a large amount of data results in a long processing time, which consequently reduces printing speed. 
     SUMMARY OF THE INVENTION 
     The present invention overcomes the foregoing prior art deficiencies, and one object of the invention is to provide a method of generating character patterns wherein even a complex character can be printed using less data than that required by the conventional method. 
     According to the present invention, two contiguous straight lines lined at their juncture in any of eight possible directions, i.e., upward, downward, rightward, leftward, and combinations thereof as shown in FIG. 2, can be expressed by two pieces of data for the extreme start and end points. More particularly, as shown in FIG. 3, for printing the character &#34;2&#34;, for example, the conventional method needs data corresponding to the nodes of each straight line (points P0 through P6) in order to draw the character. Whereas, according to the inventive method of generating character patterns, the two linked lines, P0-P2 and P2-P3 can be drawn by designating the coordinates of just two points, P0 and P3, and similarly, linked lines P3-P4-P5 can be drawn by designating the coordinates of points P3 and P5, when the line starting at the start point is an inclined line and the line ending at the end point is a vertical or horizontal line. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a flowchart showing the conventional method of generating character patterns; 
     FIG. 2 is an explanatory chart showing the pen movement directions related to the present invention; 
     FIG. 3 is a chart showing a printed character pattern according to one embodiment of the invention; 
     FIG. 4 is a block diagram of the printing system embodied by the inventive method of generating character patterns; and 
     FIG. 5 is a flowchart showing the method of generating character patterns according to the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The present invention will now be described in detail with reference to FIGS. 3, 4 and 5. The arrangement of FIG. 4 includes an input unit 1, a memory 2, a start point register 3 for storing the coordinates of a start point, an end point register 4 for storing the coordinates of an end point, a first calculator 5 for calculating a coordinate on the x axis, the second calculator 6 for calculating a coordinate on the Y axis, oscillators 7 and 8 for generating pulses synchronized with each other, comparators 9 and 10, counters 11 and 12, a NOR gate 13, a drive circuit 14, and a printer 15. 
     The input signal which is encoded as data code ASCII or JIS code carries information corresponding to the characters to be printed, i.e., it is used to produce coordinates representing line segments constituting each character, and it is decoded by the input unit 1 and stored in the end point register 4. At this time, coordinate data stored in the memory 2 is transferred to the start point register 3. 
     Initially, the memory 2 is empty, and the start point register 3 is loaded with the data (0, 0). Subsequently, the contents of the end point register 4 are transferred to the memory 2. 
     Data (X 1 , Y 1 ) stored in the start point register 3 and data (X 2 , Y 2 ) stored in the end point register 4 are subjected to a first calculation: dX=|X 2  -X 1  |, and a determination is made of the polarity of (X 2  -X 1 ) by the first calculator 5, they are also subjected to a second calculation: dY=|Y 2  -Y 1  |, and determination of the polarity of (Y 2  -Y 1 ) by the second calculator 6. 
     The resultant value dX from the first calculator 5 is delivered to the comparator 9, and at the same time the counter 11 is set. The polarity signal from the first calculator 5 is given to the drive circuit 14. The comparator 9 compares dX from the first calculator 5 with the value from the counter 11, and activates the oscillator 7 so that a certain number of pulses counted by the counter 11 are supplied to the drive circuit 14 until the inputs of the comparator 9 coincide with each other. Similarly, dY calculated by the second calculator 6 is processed by the comparator 10 and oscillator 8, and a number of pulses corresponding to the value of dY are fed to the drive circuit 14. When the oscillator control signals from the comparators 9 and 10 go low to deactivate respective oscillators, the NOR gate 13 provides a high output, that clears the start point register 3 and end point register 4. At this point the start point register 3 fetches the contents of the memory 2 and the end point register 4 fetches next coordinate data from the input unit 1. 
     In FIG. 3, in positioning a start point P 0  (X 0 , Y 0 ), where X 0  &gt;0 and Y 0  &gt;0, the start point register 3 contains (0,0), the end point register 4 contains (X 0 , Y 0 ), the first calculator 4 provides dX=X 0  with determination of a positive drive polarity, and the second calculator 6 provides dY=Y 0  with determination of a positive drive polarity. Accordingly, the drive circuit 14 is supplied with X 0  pulses in the positive X direction and Y 0  pulses in the positive Y direction, and it moves the pen on the printer 15 by the respective number of pulses in the positive X and Y directions to complete the initial positioning. 
     Subsequently, for drawing the two linked lines P 0  -P 2  and P 2  -P 3 , the coordinate data coordinates (X 0  +3,Y 0  +4) of point P 3  is transferred from the input unit 1 to the end point register 4, and at the same time the start point register 3 is loaded with coordinates (X 0 ,Y 0 ) of the previous end point P 0 . In this case, dX=3 and dY=4 with the polarity being positive for both directions. In consequence, the drive circuit 14 is supplied with 3 pulses from the oscillator 7 and 4 pulses from the oscillator 8 in a synchronized relationship. Up to the third pulse, both the X and Y axes have outputs with the positive polarity, and the drive circuit 14 provides positive drive signals for the printer 15 so that the pen is moved in the composed vector direction as shown by the line P 0  P 2  in FIG. 3. The fourth pulse is given only to the Y axis drive, and in the next step the pen is moved along the line P 2  P 3 . 
     Subsequently, for drawing linked lines P 3  -P 4  -P 5 , data for coordinates (X 0  +1,Y 0  +5) of point P 5  is loaded through the input unit 1 to the end point register 4, and calculation takes place with respect to the contents (X 0  +3,Y 0  +4) of the start point register 3. The result is dX=2 and dY=1 with the negative polarity determined by the first calculator 5 and the positive polarity by the second calculator 6. 
     Further, linked lines P 3  -P 4  -P 5  can be drawn in the same way as described above. It will be seen that the line P 5  P 6  and line P 0  P 1  can be drawn by entering the coordinates of points P 5  and P 1 , respectively, in the same way as of the conventional method. 
     According to the present invention, in drawing character &#34;2&#34; as shown in FIG. 3, coordinate data for points P 2  and P 4  are not required, and thus characters can be printed using less data than that of the conventional method.