Character processing apparatus

Abstract: A character processing apparatus includes a pattern memory for storing character patterns, a shift amount memory for storing shift amount data of the character patterns stored in the pattern memory and kerning amount data between character data, a printer or display unit for outputting the character pattern, and a kerning executor for kerning the character pattern on the basis of the shift amount data and the kerning amount data which are stored in the shift amount memory when the character pattern stored in the pattern memory is output by the printer or display unit.

Description: BACKGROUND OF THE INVENTION: (a) Field of the Invention The present invention relates to a character processing apparatus for and method of outputting character data as in a liquid crystal display unit, a CRT display unit, or a printing unit (e.g., a laser beam printer, an ink-jet printer, and a thermal printer). (b) Related Background Art In one known type of character processing apparatus, characters are visually output and a shift amount of each character is equal to a full-size fixed pitch (d1). In this case, when characters having different character widths (C1 to C3) are adjacent to each other, as shown in Fig. 7, the character intervals are not equal to each other and result in poor appearance. In one method proposed to solve the above problem, predetermined values m are added to the start and end of each character width, respectively, thereby obtaining equal character shift amounts, as shown in Fig. 8. Referring to Fig. 8, when the character widths of characters " " (/ku/), " " (/u/), and " " (/ki/) are given as C1, C2, and C3, respectively, their shift amounts D1, D2, and D3 are changed to (C1 + 2m), (C2 + 2m), and (C3 + 2m). As compared with the case of Fig. 7, more natural character intervals are obtained. Even if the character shift amounts are determined as described above, however, the character intervals may be unnatural depending on a combination of characters. Fig. 9 shows an example wherein predetermined values n are added to the start and end of each character width of each of characters " " (/a/), " " (/i/), " " (/no/), and " " (/ji/), and the resultant characters are output in the same manner as in Fig. 8. As shown in Fig. 9, unnatural spaces are typically formed between the characters, depending on a combination of characters. In order to solve this problem, as shown in Fig. 10, a character box 91 is moved toward a box 90 by a distance ℓ1, a character box 92 is moved toward the box 91 by a distance ℓ2, and a box 93 is not moved, thus performing kerning. Kerning is performed manually such that a character shift amount is adjusted character by character. Alternatively, kerning is performed automatically such that combinations (kerning pairs) of all characters requiring kerning and pair shift amount adjustment data are prepared in advance. As described above, the character shift amount must be manually adjusted character by character, or kerning is performed automatically by preparing a kerning table consisting of the combinations (kerning pairs) of all characters requiring kerning and the pair shift amount adjustment data, thus posing the following problems. (1) When manual kerning is performed, skills are required, and kerning mainly depends on individual experiences. (2) Manual kerning is not efficient since each character of document data must be checked. (3) When automatic kerning is performed, an increase in the number of characters as in Japanese language causes a large increase in the number of kerning pairs. Therefore, the capacity of the kerning table is increased, and the capacity of a memory for storing the kerning table is inevitably increased. (4) Since the kerning table stores data in units of types, kerning of a combination of characters having different types cannot be performed. (5) User defined characters and the like cannot be kerned. SUMMARY OF THE INVENTION The present invention provides a character processing apparatus as set out in claim 1 and a kerning method as set out in claim 9. The remaining claims set out optional features. An embodiment of the present invention, provides a character processing apparatus wherein distances between character patterns and character sizes including space portions of the respective character patterns are stored, a minimum distance between the adjacent character patterns is calculated and is compared with a predetermined value, and the distance between the adjacent characters is adjusted when the minimum value is larger than the predetermined value, thereby automatically adjusting spacings between the characters. An embodiment of the present invention provides a character processing apparatus capable of performing full-automatic kerning without depending on experiences as compared with manual kerning. An embodiment of the present invention provides a character processing apparatus which does not require a kerning table unlike the conventional apparatus even if the number of characters is increased, thereby reducing the storage capacity of the kerning table. An embodiment of the present invention provides a character processing apparatus capable of performing kerning of all combinations of user defined characters as well as Japanese characters, characters of all other languages, and symbols. An embodiment of the present invention provides a character processing apparatus capable of freely changing kerns of characters in units of characters or character strings. Attention is drawn to US-A-3712443, which discloses a character spacing system depending on pre-assigned spacing points associated with each character. Characters are positioned so that the left-most point of one character coincides with the right-most point of the preceding character. US-A-4616219 discloses a character spacing system depending on a raster scan, in which a dot count is stored corresponding to the width of each character. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing a schematic arrangement of a character processing apparatus according to an embodiment of the present invention; Fig. 2 is a detailed block diagram of a character data unit shown in Fig. 1; Fig. 3 is a flow chart showing a control sequence of the character processing apparatus shown in Fig. 1; Fig. 4 is a detailed flow chart of step S4 shown in Fig. 3; Fig. 5 is a view showing a relationship between a character pattern and a shift amount; Fig. 6 is a view for explaining an interval between two adjacent characters in units of segments; Fig. 7 is a view showing a character string when a character shift amount is a full-size fixed pitch; Figs. 8 and 9 are views showing character strings when the character shift amount is a proportional pitch; and Fig. 10 is a view showing a character string obtained after kerning of the embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS : Preferred embodiments of the present invention will be described with reference to the accompanying drawings. [Description of Character Processing Apparatus (Fig. 1)] Figs. 1 and 2 are block diagrams showing an arrangement of a character processing apparatus of the embodiment of the present invention. Referring to Figs. 1 and 2, a host computer 1 of an external device outputs print or display data to a character processing apparatus 2. The print data sent from the host computer 1 is supplied to a data receiver 3 of the character processing apparatus 2. A data analyzer 4 analyzes that the data received by the data receiver 3 or input through a keyboard 10 (to be described later) is print (display) data or any other data. Of all data analyzed by the data analyzer 4, only the print (display) data is processed by a data processor 5, and its detailed operation will be described later with reference to Fig. 3. A character data unit 6 stores data related to characters, and its detailed arrangement will be described later with reference to Fig. 2. Of all the data analyzed by the data analyzer 4, data except for the print (display) data is processed by an instruction executor 7. An output buffer 8 temporarily stores the output data from the instruction executor 7 in the form of pixel data and outputs it to a character output unit 9. The character output unit 9 comprises a display unit for displaying data from the output buffer 8 or a printing machine (printer) for printing this data. The keyboard 10 includes numeric keys, letter keys, and the like and can set a desired kerning coefficient (to be described later). [Description of Character Data Unit (Figs. 2 and 5)] Fig. 2 is a diagram showing a detailed arrangement of a data structure of the character data unit 6. The character data unit 6 consists of a character code data section 11, a character pattern data section 12, a shift amount data section 13, and a kerning coefficient data section 14. The character code information section 11 stores codes of the respective character data. The character pattern data section 12 stores a plurality of character patterns. The shift amount data section 13 stores shift amount data of the respective character patterns stored in the character pattern data section 12. The kerning coefficient data section 14 stores kerning coefficients. This section may store reference kerning coefficients or values set at the keyboard 10. The kerning coefficients may be stored in units of characters or lines. This embodiment will be described in detail with reference to character "F" in Fig. 5. A shift amount of character "F" in Fig. 5 is represented by 25 segments and distances of segments between the character patterns. A rectangle represented by the shift amount for character "F" is a shift box. There are two different distances between the character pattern and the boundary of the shift box. The character data unit 6 stores character patterns and shift amounts in correspondence with character codes. When a character code is input from the data processor 5, the character pattern and the character shift amount which correspond to this input character code are output from the character data unit 6. [Description of Character Processing Apparatus (Figs. 1 to 6)] Fig. 3 is a flow chart showing a control sequence of the character processing apparatus 2 of this embodiment. A program for realizing the flow chart is stored in a ROM in the data processor 5. A printer is exemplified as the character output unit 9 in the following description. In step S1, data sent from the host computer 1 and received by the data receiver 3 or data from the keyboard 10 is taken in and analyzed by the data analyzer 4. It is checked in step S2 whether the input data is the print data. If NO in step S2, the flow advances to step S3, and an instruction is executed by the instruction executor 7. However, if YES in step S2, the flow advances to step S4, and the character data is read out from the character data unit 6. At the same time, a shift amount is read out from the shift amount data section 13. The data processor 5 performs data processing using the readout data and writes the processed data onto the output buffer 8. It is determined in step S5 whether character printing is performed. If YES in step S5, the flow advances to step S6. If NO in step S5, the flow returns to step S1. In step S6, the contents of the output buffer 8 are read out and sequentially output to the character output unit 9, thereby displaying the processed data at the character output unit 9. It is determined in step S7 whether character output processing is completed. If NO in step S7, the flow returns to step S1. Fig. 4 shows a detailed content of step S4 in Fig. 3 and best illustrates the characteristic feature of this embodiment. In steps S11 and S12 of Fig. 4, the first character pattern data C1 and the first shift amount data C1set are read out from the character pattern data section 12 and the shift amount data section 13, respectively. Of these readout data, only the character pattern data C1 is written onto the output buffer 8 in step S13. It is then determined in step S14 whether the next adjacent character C2 is present. If YES in step S14, the flow advances to step S15. Otherwise, the flow advances to step S28. It is determined in step S15 whether a kerning instruction is included in the data by checking if a flip-flop F1 in the data analyzer 4 is set. If it is determined that the flip-flop F1 is set and kerning is to be performed, the flow advances to step S16. Otherwise, the flow advances to step S26. In step S16, a kerning coefficient K is read out from the kerning coefficient data section 14 and stored in a memory m1 in the data processor 5. In step S17, "0" is set in a segment number n , and "1,000" is set as an initial value of a distance between two characters in units of segments. These values are respectively set in memories m2 and m3 in the data processor 5. In step S18, the value of the segment number n is incremented by one. In step S19, a distance C1max from the right end of the character pattern C1 to the right end of the shift amount character box in the designated segments is detected. In step S20, a distance C2min from the left end of the adjacent character pattern C2 to the left end of the shift amount character box is detected. The flow then advances to step S21. The values detected in steps S19 and S20 are added to each other by an arithmetic section PR in the data processor 5 to obtain a distance e between the adjacent characters on a given segment. In step S22, the distance e is compared with the distance d between the adjacent characters of the immediately preceding segment. If d > e, then d = e is set. It is determined in step S23 whether processing of all segments is completed. If NO in step S23, the flow returns to step S18. Otherwise, the flow advances to step S24. When the operations in steps S18 to S23 are completed, measurements of distances between the two adjacent characters for all segments are completed. The value of d carried into step S24 is the minimum distance between the two adjacent characters. This will be described with reference to Fig. 6. Distances 23-3 to 23-22 between the two adjacent characters are calculated for all segments, and the minimum value is given as d . The flow then advances to step S24, and the arithmetic section PR in the data processor 5 compares the predetermined kerning coefficient K with the distance d . If the value of the distance d is smaller than the coefficient K, the distance between the two adjacent characters is kept unchanged. For this purpose, the flow advances to step S26. Otherwise, the flow advances to step S25. If a distance between the two adjacent characters is smaller than the kerning coefficient K and kerning cannot be performed, the value of the shift amount C1set in step S12 is kept unchanged. If kerning can be performed, the value (d - K) is subtracted from the amount C1set to obtain a new amount C1set. In step S26, the new shift amount C1set is written onto the output buffer 8. Kerning between the two target characters is completed. In step S27, the character C2 is set as the character C1, and the flow returns to step S11. When the next character C2 is not present in step S14, the flow advances to step S28 to determine whether kerning is completed. If NO in step S28, the flow returns to step S11. However, if YES in step S28, all the operations are completed. The above operations will be described in more detail with reference to Fig. 9. Assume that the number of segments of characters is 40, the shift amounts of these characters which are stored in the shift amount data section 13 are respectively "36", "32", "28", and "34", and the kerning coefficient K is "14". A minimum distance dm between the characters " " and " " on a segment Lm is given as dm = max18 + min1 = 19. In step S24, condition d > K is satisfied. The shift amount corrected in step S25 is 31 (= 36 - (19 - 14)). As shown in Fig. 10, the value of ℓ1 becomes "5" (= 36 - 31), and the shift amount is corrected. In the above embodiment, character codes, character patterns, and shift amounts are stored in the character data unit 6, and the distance between the character pattern and the shift amount box on a given segment is obtained by a calculation. However, according to another embodiment, distances between the character patterns and the shift amount boxes may be stored in the character data unit 6 in units of character patterns. In this case, in steps S19 and S20 of Fig. 4, distances C1max and C2min between the character pattern and the shift amount box of the designated segment are read out from the character data unit 6. Fig. 5 shows horizontal distance data of letter "F". However, if vertical distance data of characters are provided, kerning can be applied to vertical composition of Japanese characters and the like in addition to horizontal composition (e.g., European languages). Extraction of the values of distances between two adjacent characters need not be performed for all segments. Such extraction can be performed for a limited number of segments. The following effects can be obtained by the embodiments described above. (1) Since kerning can be perfectly automatically performed, efficiency can be improved and experiences and skills are not required as compared with manual kerning. (2) Since a kerning table need not be used even if the number of characters to be processed is increased, a required storage capacity can be reduced. (3) Kerning can be performed for all combinations of user defined characters in addition to Japanese characters, characters of any other languages, and symbols. According to the present embodiment as has been described above, values are stored for distances between (a) the character patterns and (b) the character sizes including the space portions around the character patterns, a minimum distance between the adjacent character patterns is obtained at the time of character output and is compared with a predetermined value, and the distance between the adjacent characters is adjusted when the minimum distance is larger than the predetermined distance, thereby automatically adjusting the character spacings.

Claims: Character processing apparatus comprising: memory means (6) storing, in respect of a plurality of characters, a character pattern and size data defining the size of the area used by the character including space around it; and processing means (5) for reading the character patterns and the size data from the memory means (6) for a string of characters, and outputting the character patterns for the string of characters together with the amount of the shift from each character position to the next, characterised in that the memory means (6) stores kerning coefficient data, and if kerning is required between two characters the processing means (5) reads a kerning coefficient (K) from the memory means (6), determines the minimum distance (d) which would exist between the character patterns of the two characters if they are positioned at a spacing defined by the respective said size data, and if the minimum distance (d) is greater than the kerning coefficient (K) the processing means (5) outputs the amount of shift from the first of the two characters to the second which is reduced by the difference, minimum distance (d) minus kerning coefficient (K), compared with the amount of shift defined by the size data. Apparatus according to claim 1 in which the memory means (6) stores a kerning coefficient per character. Apparatus according to claim 1 or claim 2 comprising a keyboard (10) by which kerning coefficients may be set. Apparatus according to any one of claims 1 to 3 comprising means (4, F1) for instructing the processing means (5) whether kerning is to be performed. Apparatus according to any one of the preceding claims comprising a printer for reproducing the character string in accordance with the character patterns and shift amounts output by the processing means (5). Apparatus according to any one of claims 1 to 4 comprising a display for reproducing the character string in accordance with the character patterns and shift amounts output by the processing means (5). Apparatus according to any one of the preceding claims in which the size data comprises the length of the said area used by the character. Apparatus according to any one of the preceding claims in which the size data comprises a plurality of distances between the character pattern and edge of the said area used by the character. A method of kerning characters in a character processing apparatus, comprising reading, from a memory means (6) of the character processing apparatus, a character pattern and associated size data defining the size of the area used by the character including space around it, in respect of first and second characters which are adjacent in a character string characterised by: reading a kerning coefficient (K) from the memory means (6); determining the minimum distance (d) which would exist between the character patterns of the first and second characters if they are positioned at a spacing defined by the respective said size data and comparing the minimum distance (d) with the kerning coefficient (K) and; outputting the character patterns together with the amount of shift from each character position to the next, the amount of shift being defined by the size data if the minimum distance (d) is not greater than the kerning coefficient (K) and the amount of shift being reduced by the difference, minimum distance (d) minus kerning coefficient (K), compared with the amount of shift defined by the size data, if the minimum distance (d) is greater than the kerning coefficient (K). A method according to claim 9 in which the amount of shift and the minimum distance are horizontal. A method according to claim 9 in which the amount of shift and the minimum distance are vertical. A character printing method comprising kerning characters by a method according to any one of claims 9 to 11 and printing the output character patterns with the output amounts of shift from each character pattern to the next.

Inventors: WATANABE KIYOSHI, WATANABE, KIYOSHI
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1990
Main classification: G09G1
IPC codes: G09G5, G06F3, G06K15