CHARACTER GENERATOR

Abstract: A character generator for generating characters which are transferred to a recording medium by a dot-matrix print head. In the character generator there is stored for each character the information required for the activation of the printing needles of the print head. The information comprises two parts, one of which contains a length description, i.a. indicating the total length of the character, and an address to the memory area in which the second part of the information is stored, the said second part constituting the graphic representation of the character. The first part of the information for all characters comprises four bytes while the second part of the information occupies a memory area adapted to the length of the character.

Description: Character generator The present invention pertains to a character generator of the kind referred to in the preamble of the appending Claim 1. One application of a character generator is in matrix printers wherein it is used to generate the character information required for the printing needles of the printer to be able . to build up different characters. Every such character consists of a number of dots in a N x M matrix. Normally, the height of the matrix is seven or nine dots while the width is determined by the horizontal resolution and may vary between 10 and 25 dots. In the character generator there is stored either the specific character together with the interspace to the following character or just the character. In the latter case the interspace is formed by use of an algorithm. The character image is stored in a memory area, the start address of which being generated by a code, for instance the ASCII-code representing the said character. For example, the area may comprise 14 bytes of which 8 bytes represent the character and 6 bytes represent the interspace. In the example referred to the character requires seven printing needles. However, some characters require nine needles which causes problems because each byte contains at a maximum eight bits, each of which representing one needle. Hence, the memory area of the character must be enlarged and the easiest way is to reserve a separate byte for the ninth needle. Another possibility is to designate to one byte the ninth needle information relating to eight consecutive columns. The following drawbacks are connected with the character generator disclosed above. 1. The memory area is always the same, even for characters that are very narrow. 2. The interspace between characters occupies needless space in the memory. However, this drawback may be eliminated if the interspace is generated by means of an algorithm. 3. Those bytes which contain only noughts frequently recur and they contain no information other than that no dot is to be printed in the specific column. 4. The drawback referred to under point 3 will be still more important in printers designed for multi-pass printing, i.e. wherein the print head passes the same line more than once. Usually, during the second, third etc. passes the character generator contains up to 70-80% bytes comprising only noughts. . 5. A few characters, such as g, j, y, etc., require a ninth needle. There are several methods available for storing the ninth needle information, ail of them, however, having the disadvantage that all characters reserve memory area for the ninth needle, while just a few actually- use the area reserved. 6. Certain character repertoires comprise characters of varying length. Either these characters have to be treated separately or must the memory area in the character generator be de¬ termined by the character of the greatest length. 7. Proportional spacing requires separate treatment of the char¬ acters, In order that not the character pitch but the character interspace, i.e. the distance between, two consecutive char¬ acters, be invariable. The object of the invention is to provide a character generator in which the drawbacks referred to above have- been eliminated. The object is achieved in a character generator having the features included in the appending claims. A more detailed description of the invention will be given below in connection with an embodiment with reference to the accompanying drawings in which Figs. 1 and 2 show the characters "P" and "g", respectively, printed by means of a dot-matrix print head. Fig. 3 shows the information to be stored in the character generator to represent the character of Fig. 1. As Fig. 3, Fig. 4 shows the information to represent the character of Fig. 2. Figs. 5 and 6 show the arrangement of the character information in a character generator according to the invention. Figs. 7 and 8 more in detail show the arrangement of the character information according to Figs. 5 and 6 with reference to the character "P". In the same way, Figs. 9 and 10 show the character information of Figs. 7 and 8 with reference to the character "g". Fig. 11, finally, is a block diagram of the character generator. The following description of the embodiment will be given with reference to the characters "P" and "g". In Fig. 1 the letter "P" is shown as printed by a dot-matrix print head comprising nine printing needles. The positions of the needles have been indicated by lines numbered 1-9 in a vertical row. Above the letter, the columns have been indicated in which the printing needles are activated. These columns have been numbered 1-14. The letter "g" is correspond¬ ingly illustrated in Fig. 2. Fig. 3 shows the arrangement, known per se, of the information relating to the character "P" in the character generator. As appears from Fig. 1, the letter "P" requires seven needles and at least one needle is to be activated in the columns 1, 3, 5, 7 and 8. This is reflected in Fig. 3 wherein the positions in which a needle is to be activated have been marked by "1". The information is collected in bytes and one byte is reserved for each column. In each byte the activated needle is represented by a "1" and the non-activated needle by a "0". For the character "P" 14 bytes are reserved, 8 bytes for the character and 6 bytes for the interspace to the following character. The character representation shown in Fig. 4 refers to the letter "g". As appears from Fig. 2 this character requires nine printing needles and since a byte comprises eight bits representing eight needles, two bytes have to be assigned to each column. In the Figure this has been indicated by 14 compartments being provided, each representing one column and comprising two bytes. The left byte in the respective compartment represents the needles 1-8 while the right byte represents the ninth needle. The above description with reference to Figs. 1-4 is an illustrative example of the prior art which shows that memory area has to be reserved for information that is used to an extent much less than would correspond to the memory area assigned to it. In the following there will be described a character generator according to the invention by which it will be possible to save memory area at unchanged performance. The information in the character generator comprises two parts of which a length information is shown in Fig. 5 and a graphic information in Fig. 6. The first part, the length information, always consists of four bytes and is addressed by the ASCII-code representing the respective character. In Fig. 5 the following abbrevi¬ ations have been used: S if S=l The character is to be treated separately (for instance a marking may be made as to national variants). LI 1-127 Indicates the total length of the character (character +■ inter¬ space), at maximum 127 columns. N if N=l Memory area to be reserved for the ninth needle. L2 0-127 Indicates the number of information containing columns of the character. L2=L1 minus the number of columns containing only noughts. A Q 000-FFFF A 16-bit address to the graphic part of the character generator wherein the compressed representation of the character is stored. ,\j _____ A OM? In the graphic part, as shown in Fig. 6, each character is represented by s memory area of varying size. The following description refers " to Fig. 6. Pl,P2...Pk This area indicates the empty columns of the character, i.e. columns in which no needles are to be activated. Each byte describes eight columns of the character, and PI describes the first eight columns, P2 the following group of eight columns etc. In the usual way "1" indicates a column in which needles are to be activated while "0" indicates an empty column. The coefficient k in Pk is calculated according to the following rule: k=l if 0 < LI < 8 k=2 if 8 < LI < 16 k=3 if 16 < LI < 24 etc. Nl,N2...N This area only exists in case the ninth needle is needed, i.e. if N=l, see the length information. Each bit indicates the presence of needle 9 in the actual column. For the calculation of k in Nk the same rule as for Pk is applicable. Gl,G2...Gn This area contains only the columns in which needles are to be activated and thus constitutes the compressed representation of the character. For the index n in Gn the relationship n=L2 applies. The representation of the letter "P" in the character generator according to the invention is illustrated in Figs. 7 and 8 * . At the top of Fig. 7 the first part of the information in the character generator is shown. A comparison with Figs. 1, 3, and 5 shows the following to be valid for the letter "P". S=Q No separate treatment. Ll=14 Corresponds binary to 000 1110. N=fl No needle No. 9. L2=5 Corresponds binary to 000 0101. In Al a 16-bit address will be found for the memory area containing the graphic representation of the character. In this memory area information is stored relating to the columns bearing information (1) and to the empty columns (0) respectively. This information is represented by columns PI and P2. The com¬ pressed graphic representation of the letter "P" is to be seen in the area Gl wherein all columns which contain information are arranged in sequence. As appears from Fig. 8 the information required for the generation of needle activating signals Is derived by combination of PI, P2, LI, L2 and Gl. In Figs. 9 and 10 there is shown the representation of the letter "g" in the character generator. For this letter the following is valid: S=0 No separate treatment. Ll=14 Corresponds binary to 000 1110. N=l Reservation to be made for needle No. 9. - L2=8 Corresponds binary to 000 1000. In A2 a 16-bit address is to be found for the memory area storing th graphic picture of the letter "g". In this area PI indicates that all columns in th character contain information, i.e. at least one needle is to be activated in all columns. P2 indicates the interspace in number of columns to the following character. N indicates that the ninth needle is to be activated in at least one of the columns. Gl indicates the compressed representation of the letter "g" for eight of the needles in each column. By combination of LI, L2, Nl, N2, PI, P2 S and Gl, as schematically indicated in Fig. 10, the information required for the generation of the needle activating signals may be derived. In comparison to the prior art, the character generator according to the invention gives a saving in memory area which with respect to the letter "P" amounts to three bytes (11 bytes to 14) and for the letter "g" amounts to 12 bytes (16 bytes to 28). In prior art character generators for each character a memory area of the same size must be reserved. Contrary hereto in the character generator in accordance with- the invention only the length information has the same area for all characters, while the graphic representation of a character only requires the memory area in bytes that corresponds to the compressed represent¬ ation of the character, i.e. the number of information carrying columns, and for those characters concerned, information relating to the ninth needle. With reference to Fig. 11 there will now be schematically described how information is taken out from the character generator and converted into needle activating signals.- For this purpose a converter O is provided which is connected to two memories Ml and M2 via address lines A and data lines D. The converter in the embodiment described, being the CPU of a microprocessor, has an input on which is applied a print order for a character, the print order being in the form of a code, viz. a seven bit ASCII-code. The converter also has an output on which needle activating signals are emitted in the shape of a nine bit code. On the data line eight bits are transferred simultaneously while the address line conveys 16-bit addresses. A print order for the letter "P" is represented on the input of the converter by the hexadecimal number 50 H which is the ASCII-code assigned to this letter. The converter converts the 50 H-code into an address (A) which is stored in the address register of the converter and points at the length information LI for the letter "P" in memory Ml. The most significant bit in LI, previously designated 5 (Fig. 5), is examined and found to be "0". Hence, no separate treatment will be- needed for the character "P". The examination proceeds with the seven least significant bits of LI and the seven bits are 000 1110, which correspond to the decimal number 14. This number indicates the width of the character to be 14 columns including the interspace (Ll=14). Then the address register is increased by 1 to point at L2 of the letter "P". The most significant bit of L2, which is N, is examined. In the example also N=Q which indicates that no "needle 9" information is included in the graphic part of the character information. The seven least significant bits of L2 are 000 0101 which correspond to the decimal number 5 Indicating that in five columns, at least one needle is to be activated. In other words the graphic part, G, comprises five bytes. Then the number of empty columns, i.e. columns in which no needles are to be activated, will be 14-5=9. Now the address register is increased by 1 and 2, respectively, to point at the address of the least and the most significant half, respectively, of the * 16-bit address which occupies two bytes after L2. The address is used by the converter as a pointer for the memory M2, i.e. the address register points at PI of the letter "P" in memory M2. From now on the converter is working in M2. As Ll=14, two bytes PI and P2 are required in the P area, see Fig. 6. Eight bits in PI and 6 bits in P2 will be used, compare Fig. 7. Now the converter knows that the G area follows on P2 because N=0 (N area is missing). PI is examined bit by bit and the least significant bit corresponds to the first column, the second bit to the second column, etc. Upon finishing the examination of PI, P2 will be examined, the least significant bit of which corresponds to the ninth column, etc. The least significant bit relating to the letter "P" is "1". That means that Gl gives the first needle information binary corresponding to 1111 1110. The second bit of PI is "0" which means that the second column of "P" has no needle information. The third bit of PI is "1" resulting in G2 giving the next needle information (in binary form 1000 1000). The remaining bits of PI are examined in the same way. With reference to the letter "P" all of the bits of P2 are "0" which means that no needles are to be activated in the character interspace. The two most significant bits of P2 will not be examined because αf the indication by LI that the character comprises 14 columns. In case the character "P" is to be written in opposite direction, i.e. from the right to the left, the procedure must be slightly modified. Accordingly the examination starts with the sixth bit of P2 followed by bit 5, bit 4 etc. Then the eighth, seventh bit, etc. of PI will be examined. In this case L2 is used to indicate that the needle information relating to the first column, as counted from the _Γ_CID right, will be found in G5 (L2=5). The following needle information is to be foun . ' in G4 etc. The presence of the "needle 9" information is indicated by N=l which mean • that the N area is of the same size as the P area. As Ll=14 two bytes are require ■ . in the P area as well as in the N area (PI, P2 and Nl, N2, respectively). Th converter now knows that the G area succeeds to N2 because N=l (N area exists). With reference to the representation of the letter "g" according to Figs. 9 • and 10 there will be indicated below the deviations caused by the demand for the "needle 9" information. Nl=l means that the N area is of the same size as the P area. Because Ll=14 two bytes will be required in the P area as well as in the N area (PI, P2 and Nl, N2, respectively). The converter now knows that the G area follows N2 as N=l (N area exists). The least significant bit of PI is 1 which means .that the eight bits in Gl together with the first bit of Nl give the needle ' .information relating to the first column (Gl = 0001 1100; first bit of N=0). The • second bit of Pl=l which means that the eight bits of G2 together with the second bit of Nl give the needle information relating to the second column (nine bits). The third bit of Pl=l which means that the eight bits of G3 together with the third bit of Nl give the needle information relating to the third column. As a summary, the following advantages may be achieved by the character generator according to the invention: 1) The size of the memory area is adapted to the length of the character. 2) The character interspace, if at all included in the character generator, is stored in compressed form. 3) "Empty columns" in which no needles are to be activated do not occupy any memory area. 4) Very wide characters, up to 127 columns, may be stored. 5) Needle No. 9 may be included in arbitrary characters. 6) Space for the ninth needle information does not need to be unnecessarily reserved. 7) Proportional spacing does not require separate treatment as far as the character generation is concerned. 8) The same graphic information can be addressed from different length descriptions offering advantages in connection with multi-pass writing wherein different characters may have identical representations in the character generator for the second, third, etc. passes.

Claims: Claims 1. A character generator for a dot-matrix print head comprising nine printing needles arranged in at least one column, characterized by a first memory storing for each character a length information comprising the tσtal length of the character in columns and an address identifying in a second memory the memory area storing a graphic representation of the said character, the said representation indicating the columns in which printing needles are to be activated and in the respective column which of the needles are to be operated, wherein the length information for all characters occupies a memory area of the same size, while the graphic representation for each character has assigned to it a memory area adapted to the length of the character. 2. * A character generator according to Claim 1, characterized in that for each character the length information has an address in the first memory that is indicated by a code, for instance the code referred to as ASCII. 3. A character generator according to Claim 1 or Claim 2, character- i z e d in that the length information comprises four bytes, one of which describes the total length of the character with or without the interspace to the following character, the second of which indicates the number of columns in which printing needles are to be activated, -and the two remaining bytes form a 16-bit start address identifying the graphic representation of the character in the second memory. 4. A character generator according to Claim 3, characterized in that either of the two bytes carrying non-address information has one bit indicating the eventual separate treatment of the specific character. 5. A character generator according to Claim 3 or Claim 4, cha racter- i z e d in that either of the two bytes carrying non-address information has one bit indicating if memory area in the second memory is to be reserved for the ninth needle. 6. A character generator according to any of the preceding claims, char¬ acterized in that the graphic representation comprises a first area in which each byte is indicative of empty and information carrying columns, respectively, for a group of eight columns of the character and a second area comprising those columns of the character in which printing needles are to be activated. 7. A character generator according to Claim 6, characterized in that the graphic representation for the characters requiring a ninth needle have a third area indicating those columns in which the ninth needle is to be activated.

Inventors: ROZSA KALMAN
Applicants: FACIT AB, ROZSA KALMAN
Application year: 1981
Main classification: G06K15
IPC codes: B41J2, G06K15