Method and apparatus for processing characters

Abstract: A character processing apparatus for converting data stored in a vector form into a pattern of a dot form and outputting comprises: a discriminating circuit to discriminate the number of points constructing curve data in the data of the vector form; and a selector to select the kind of curve to be generated in accordance with the number of points constructing the curve data on the basis of the discrimination result by the discriminating circuit. A Bezier curve or a B spline curve is selected as a curve to be generated.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to character processing method and apparatus having a function to convert a pattern which was encoded by a vector form into a dot form. Related Background Art Hitherto, when data of a vector form is converted into data of a dot form, such a conversion is executed by one curve generating process for all of the curve data. GB-A-2 203 613 (CANON K.K.) describes such a system in which the curve generating process adopts the Bézier cubic curve algorithm. However, in the process to generate a curve, if one curve is generated, it takes a long processing time in dependence on the number of points constructing the curve. There is a problem such that a time which is required to convert the data of the vector form into the data of the dot form is late. In accordance with the present invention there is provided character processing apparatus as set out in claim 1 and a character processing method as set out in claim 4. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing an internal construction of the invention; Fig. 2 is a flowchart showing a whole flow of the invention; Fig. 3 is a diagram showing areas assembled on a screen of a document; Fig. 4 is a flowchart showing a detailed flow of the invention; Fig. 5 is a diagram showing a state in which a curve is generated by a third order Bezier function; Fig. 6 is a diagram showing a state in which a curve is generated by a B spline function; Fig. 7 is a flowchart showing a flow in another embodiment; Fig. 8 is a diagram showing a state in which a curve is generated by a second order Bezier function; Fig. 9 is a flowchart showing a flow to calculate an arrangement position by the direction of a character train; Fig. 10 is a diagram showing a state in which arrangement positions of characters are calculated when a character train is arranged in the horizontal direction; Fig. 11 is a diagram showing a state in which arrangement positions of characters are calculated when a character train is arranged in the oblique direction; Fig. 12 is a diagram showing a state in which arrangement positions of characters are calculated when a character train is arranged in the circumferential direction; Fig. 13 is a diagram showing the relation between the vector point and the point attributes; and Fig. 14 is a diagram showing an example of providing provisional points in the case where a curve is constructed by three points. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the invention will now be described. The invention can be embodied in a system comprising a plurality of apparatuses or a single unit. The invention can be also applied to the case which is embodied by supplying a program to an apparatus, a system, or the like. Any one of the laser beam printer, bubble jet printer, thermal copy transfer printer, and the like can be used as a printer for use in the invention. Fig. 1 is a block diagram showing a fundamental construction of a Japanese word processor according to the invention. In Fig. 1, reference numeral 1 denotes a central processing unit (CPU) to control the entire apparatus and to execute arithmetic operating processes and the like; 2 indicates a read only memory (ROM) as a memory area to store a system activation program, character pattern/data, and the, like; and 3 a random access memory (RAM) used as a working area during data processing. Each of the programs shown in the accompanying flowcharts, which will be explained hereinlater, and data are stored in RAM 3 during the execution of the programs. Reference numeral 4 denotes a keyboard control section (KBC) and 5 indicates a keyboard (KB). The KBC 4 receives key input data from the keyboard 5 and transfers to the CPU 1. Reference numeral 6 denotes a display control section (CRTC); 7 a display device (CRT) to receive data from the CRTC 6 and display; and 9 an external memory device such as floppy disk device (FD), hard disk device (HD), or the like. The programs shown in the flowcharts, which will be explained hereinlater, and data are stored in the external memory device 9. Upon execution, those programs and data are referred and stored into the RAM as necessary. Reference numeral 8 denotes a disk control section (DKC) to control a data transmission or the like; 10 a printer control section (PRTC); 11 a printer (PRT); and 12 a system bus serving as a path of data among the above component elements. The operation of the embodiment with the above construction will now be described with reference to the flowchart of Fig. 2 and Fig. 3. In step 1 in Fig. 2, information which is supplied from an output device side is obtained as input parameters. As parameters which are supplied in this case, there are a size of entire output area, information of an actual output area (left edge and right edge), and the like. In step 2, there is executed a process to read information such as point No., character train, kind of modification, and the like which have already been written in an area to convert the data of a vector form assembled in a document picture plane as shown in Fig. 3 into the data of a dot form. Any one of the ruled line, table, box layout, and the like can be used as an area which is used in the embodiments. In step 3, the right and left edges of the area which is occupied by each character of a designated character train are calculated. A practical example will now be described with reference to the flowchart of Fig. 9 and Figs. 10 to 12. In step 9-1 in Fig. 9, the direction of the character train in the modification information obtained in step 2 in Fig. 2 is discriminated. If the direction of the character train is determined to be the horizontal direction, step 9-2 follows. If it is the oblique direction, step 9-3 follows. If it is the circumferential direction, step 9-4 follows. Step 9-2 relates to the case of arranging the character train in the horizontal direction as shown in Fig. 10. A size of entire lateral area to generate the character train is divided by the number of characters, thereby allowing the characters to be uniformly arranged. Then, coordinate values of the right and left edges of an area which is occupied by each character are stored. Step 9-3 relates to the case of arranging the character train in the oblique direction as shown in Fig. 11. A size of area to obliquely generate the character train is first calculated from the size of entire area to generate the character train. The area to obliquely generate the character train is uniformly divided into the small areas as many as the number of characters. Coordinate values of the right and left edges of the area which is occupied by each character are stored. Step 9-4 relates to the case of arranging the character train in the circumferential direction as shown in Fig. 12. The area to arrange the character train is similarly calculated from the entire area and the area which is occupied by each character is calculated so as to enable the characters to be uniformly arranged. The example of Fig. 12 differs from theexamples of Figs. 10 and 11 with respect to the following point. That is, in the examples of Figs. 10 and 11, the sizes of lateral areas which are occupied by the characters are uniform. However, in the case of the example of Fig. 12, those sizes differ in dependence on an angle at which the character is arranged. In step 4 in Fig. 2, the value of the lateral area which is occupied by each character and has been stored in step 3 is compared with the value of the lateral area which is used to actually generate the character and was supplied from the output device side, only the necessary data in the character train to be developed is used as it is, and the unnecessary data is converted into the space code. In step 5 in Fig. 2, the character code train which is obtained after the conversion in step 4 was executed is referred, and if the character code is a code other than the space code, the data of the vector form corresponding to the character code and the point attributes such as straight line/curve and the like which are expressed by a form as shown in Fig. 13 are read and stored into the memory device and the conversion of the x and y coordinate values as data of the vector form is executed in accordance with the size of character and the kind of modification which were read in step 2. If the character code is the space code, no process is executed. In step 6, the data of the dot form is produced on the basis of the x/y coordinate data stored in the memory device in step 5. Processes in this case will be described hereinlater with reference to the flowchart of Fig. 4 as an example. In step 7, a modifying process to add a mesh image, a background image, or the like to the data on the basis of the modification information which was read in step 2 is executed to the data which was converted into the data of the dot form. In step 8, necessary portion in the data of the dot form which was formed in step 7 is transferred to the memory device on the output side. Fig. 4 is the flowchart to explain in detail the process in step 6 in Fig. 2. In step 4-1 in Fig. 4, the point attributes obtained in step 4 in Fig. 2 are read out. In step 4-2, a check is made to see if an objective point relates to straight line data or curve data. If it relates to the straight line data, step 4-7 follows. If it relates to the curve data, step 4-3 follows. As will be understood from Fig. 13, the discrimination regarding the straight line or curve is performed in the following manner. That is, if both of the point attributes of the objective point and the next point are equal to 0, it is determined that the objective point and the next point relate to a straight line. If the point attributes of the objective point are equal to 0 and the point attributes of the next point are equal to 1, the points within a range from such a point having the point attributes of 1 to a point whose point attributes are first equal to 0 by subsequently searching the point attributes are regarded to be the points with respect to a curve. In step 4-3, the number of points constructing the curve data is calculated. Such a number can be calculated by counting the number of continuous points having the point attributes of the continuous curve data from the point having the point attributes which was determined to be a curve in step 4-1. That is, the number of points having the point attributes of 1 is counted and 2 is added to the count value. The resultant value indicates the number of points constructing the curve. In the example of Fig. 13, the points from point 2 to point 6 construct one curve (the number of points constructing the curve is equal to 5 and the number of continuous points having the point attributes of 1 is equal to 3). On the other hand, the points from point 6 to point 9 construct one curve (the number of points forming the curve is equal to 4 and the number of continuous points having the point attributes of 1 is equal to 2). In step 4-4, a check is made to see if the curve data is constructed by four points or less or by points larger than four points. If the curve is constructed by four points or less (in the example of Fig. 13, the curve between point 6 to point 9), step 4-5 follows. If the curve is constructed by points larger than four points (in the example of Fig. 13, the curve between point 2 to point 6), step 4-6 follows. In step 4-5, a curve is generated by a Bezier function in the case as shown in Fig. 5. Since the Bezier function is generated by four points, for a curve which is constructed by three points, a provisional point is provided at a proper position as shown in Fig. 14 and a curve generating process is executed by setting four points. In step 4-6, a curve is generated by a B spline function as shown in Fig. 6. In step 4-7, the necessary values in the x and y coordinate values of the curves generated in steps 4-5 and 4-6 are stored. The x and y coordinate values of the data which was determined to be the straight line data in step 4-2 are stored. In step 4-8, a check is made to see if data to be discriminated exists or not. If no data to be discriminated exists, step 4-9 follows. If any data to be discriminated still exists, the processing routine is returned to step 4-1 and the next data is processed. In step 4-9, x and y coordinate data stored in the steps until step 4-8 are read out and the data of the dot form is produced on the basis of the x and y coordinate data. [Another embodiment] The above embodiment has been described with respect to the case where a curve is generated by a third order Bezier function when the number of points constructing a curve is four or less and where a curve is generated by a B spline function when the number of points constructing the curve is larger than four. However, explanation will now be made with respect to another embodiment in which curves are generated by different curve functions in the cases where the number of points constructing a curve is equal to three, where it is equal to four, and where it is equal to a value larger than four, respectively. In the flowchart of Fig. 7, the processes in steps 4-4 to 4-6 in Fig. 4 are replaced. The operation of another embodiment will now be described with reference to the flowchart of Fig. 7 and Fig. 8. In step 7-1 in Fig. 7, if the number of points constructing a curve is equal to three, step 7-2 follows. If it is equal to four, step 7-3 follows. If it is larger than four, step 7-4 follows. In step 7-2, a curve is generated by using a second order Bezier curve function as shown in Fig. 8. In step 7-3, a curve is generated by using a third order Bezier curve function as shown in Fig. 5 in a manner similar to that described in the foregoing embodiment. In step 7-4, a curve is generated by using a B spline function as shown in Fig. 6 in a manner similar to that described in the foregoing embodiment. As subsequent processes, the processing routine advances to step 4-7 in Fig. 4 in a manner similar to the foregoing embodiment and the x and y coordinate values which were converted into the curve are stored into a designated coordinate data buffer. As mentioned above, a curve can be processed at a high speed in accordance with the number of points constructing the curve. As a final output, by generating a curve by an equivalent function, a pattern can be generated at a high speed and with a high quality. As described in detail above, according to the invention, it is possible to provide a character processing apparatus in which by using a function to generate a proper curve in accordance with the number of points constructing a curve, a pattern of a dot form can be produced at a high speed without deteriorating the output quality.

Claims: A character processing apparatus for converting character data stored in vector form into dot-pattern data and outputting the dot-pattern data, and comprising discriminating means (CPU 1, ROM 2) for detecting a curve in the stored data, and characterised in that the discriminating means also detects the number of points from which the curve is constructed, and select the type of curve to be generated in accordance with the detected number of points. Apparatus according to claim 1, wherein the discriminating means selects either a Bezier curve or a B-spline curve in accordance with the number of points detected. Apparatus according to claim 2, wherein the discriminating means selects a second order Bezier curve if the number of points is 3, a third order Bezier curve if the number of points is 4, and a B-spline curve if the number of points is greater than 4. A method of processing characters in which the character data is stored in vector form and converted into dot pattern data, the method comprising discriminating (CPU 1, ROM 2, S4-4, S7-1) for detecting a curve in the stored data, and characterised in that the number of points from which the curve is constructed is detected (step 4-3) and selecting the type of curve to be generated (step 4-4) in accordance with the detected number of points. A method according to claim 4, wherein either a Bezier curve or a B-spline curve is selected in accordance with the number of points detected. A method according to claim 5, wherein a second order Bezier curve is selected if the number of points is 3, a third order Bezier curve is selected if the number of points is 4, and a B-spline curve is selected if the number of points is greater than 4.

Inventors: YOSHIDA MASAYUKI CANON KABUSHI, YOSHIDA, MASAYUKI, YOSHIDA, MASAYUKI, CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06T11
IPC codes: G06T11, G06T9, G09G5