JPH0733104B2 - Compression and decompression method for dot matrix characters - Google Patents
Compression and decompression method for dot matrix charactersInfo
- Publication number
- JPH0733104B2 JPH0733104B2 JP1-510022A JP51002289A JPH0733104B2 JP H0733104 B2 JPH0733104 B2 JP H0733104B2 JP 51002289 A JP51002289 A JP 51002289A JP H0733104 B2 JPH0733104 B2 JP H0733104B2
- Authority
- JP
- Japan
- Prior art keywords
- dot
- character
- column
- data
- dots
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Landscapes
- Dot-Matrix Printers And Others (AREA)
- Controls And Circuits For Display Device (AREA)
Description
【発明の詳細な説明】
技術分野
本発明はキャラクタジェネレータに多数のドットマトリ
クス文字を記憶するのに適したドットマトリクス文字の
圧縮方法および圧縮された文字を伸長する方法に関す
る。Description: TECHNICAL FIELD The present invention relates to a method for compressing dot-matrix characters suitable for storing a large number of dot-matrix characters in a character generator, and a method for decompressing the compressed characters.
背景技術
従来から、1つの文字を多数のドット(例えば、縦24ド
ット、横24ドット)で表現するプリンタがある。この種
のプリンタはドットプリンタと呼ばれ、その中で、ワイ
ヤを使ってドットを印字するワイヤドットプリンタが有
名である。一般に、この種のドットプリンタはドットを
印字するかどうかのデータ(以下、ドットデータと略記
する)を記憶しているキャラクタジェネレータを備え、
文字を印字するとき、このキャラクタジェネレータから
印字したい文字のドットデータを読み出し、その文字を
印字する。例えば、ワイヤを縦方向に24本並べたワイヤ
ドットプリンタの場合は、キャラクタジェネレータから
縦一列分(24ドット)のドットデータを複数回読み出し
て一つの文字を印字する。BACKGROUND ART Conventionally, there have been printers that represent a single character using a large number of dots (for example, 24 dots vertically and 24 dots horizontally). This type of printer is called a dot printer, and among them, wire dot printers that print dots using wires are well-known. Generally, this type of dot printer is equipped with a character generator that stores data on whether or not to print dots (hereinafter abbreviated as dot data),
When printing a character, the dot data for the character to be printed is read from this character generator and the character is printed. For example, in the case of a wire dot printer with 24 wires arranged vertically, the dot data for one vertical row (24 dots) is read from the character generator multiple times to print one character.
近年、プリンタには多種類の文字を印字できることが要
求されている。そのため、キャラクタジェネレータに多
数の文字を記憶する方法が発明された。この発明は日本
では特開昭60−257253号公報に記載されている。また、
アメリカではU.S.P4704040に記載されている。この発明
は、ドットの並び方(以下、ドットパターンと略記す
る)を列毎に調べ、同一のドットパターンが複数列繰り
返えされる場合は、一列分のドットデータと繰り返し回
数を示すデータをキャラクタジェネレータに記憶するこ
とにより一文字当りのデータ量を減らす文字圧縮方法で
ある。しかし、この圧縮方法では圧縮できない文字があ
る。そのような文字を第1図に示す。図を見てわかるよ
うに、同一行において、互いに隣り合う2つの列の両方
にドットが存在することはない。つまり、横方向にドッ
トが連続しない。従って、互いに隣り合う2つの列のド
ットパターンは必ず異なり、同一のドットパターンは連
続しない。この文字はプリンタの印字品位を良くするた
めと、印字速度を上げるために考え出された。そのた
め、通常の文字よりも横方向のドット数が多い。図の文
字[M]は横方向のドット数が30である。また、前述の
通り、横方向にドットが連続しない。以下、その理由を
説明する。In recent years, there has been a demand for printers to be able to print a wide variety of characters. To this end, a method has been invented for storing a large number of characters in a character generator. This invention is described in Japanese Patent Application Laid-Open No. 60-257253.
In the United States, it is described in US Pat. No. 4,704,040. This invention is a character compression method that reduces the amount of data per character by examining the arrangement of dots (hereinafter referred to as the dot pattern) for each column. If the same dot pattern is repeated multiple times, the dot data for one column and data indicating the number of repetitions are stored in a character generator. However, there are characters that cannot be compressed using this compression method. Such characters are shown in Figure 1. As can be seen from the figure, no two adjacent columns in the same row have dots. In other words, no horizontal dots are consecutive. Therefore, the dot patterns in two adjacent columns are always different, and no identical dot patterns are consecutive. This character was devised to improve printer print quality and speed. Therefore, it has more horizontal dots than normal characters. The letter [M] in the figure has 30 horizontal dots. As mentioned above, the dots are not consecutive horizontally. The reason for this is explained below.
ワイヤドットプリンタの場合、ワイヤを駆動すると、ワ
イヤは初期位置から飛び出し、所定の位置で印字用紙に
ドットを印字して再び初期位置に戻る。続けて同一のワ
イヤを駆動する場合は、ワイヤが初期位置に戻った後で
駆動する。ところで、通常の文字はドットパターンがど
のようになっているのか分らない。横方向にドットが連
続することもある。そこで、その場合でも正常に印字で
きるように、あるワイヤでドットを印字したら、そのワ
イヤが初期位置に戻った後でないと、他のワイヤであっ
ても駆動しないように制御されている。しかし、この制
御方法だと、ワイヤを効率的に駆動できず、印字速度が
上がらない。これは、あるワイヤを駆動した場合、その
ワイヤが初期位置に戻らなくても駆動できるワイヤがあ
るからである。そのワイヤとは、直前の列のドットを印
字するときに駆動されなかったワイヤである。従って、
文字のドットパターンを横方向にドットが連続しないよ
うなドットパターンとすれば、ワイヤを効率的に駆動で
き、印字速度を上げることができる。これが、前述の理
由である。In the case of a wire dot printer, when a wire is driven, it jumps out from its initial position, prints a dot on the printing paper at a specified position, and then returns to its initial position. If the same wire is driven again, it is driven after the wire has returned to its initial position. However, with normal characters, it is not clear what the dot pattern will be. Sometimes dots are continuous horizontally. Therefore, to ensure normal printing even in such cases, once a dot has been printed with a certain wire, other wires will not be driven until that wire has returned to its initial position. However, with this control method, the wires cannot be driven efficiently, and printing speed does not increase. This is because when a certain wire is driven, there are other wires that can be driven even if that wire does not return to its initial position. These wires are the wires that were not driven when printing the dots in the previous row. Therefore,
If the dot pattern of the characters is such that the dots are not consecutive in the horizontal direction, the wires can be driven efficiently and the printing speed can be increased, which is the reason mentioned above.
従って、本発明は、同一のドットパターンが連続しない
ために圧縮できない文字を簡単な方法で圧縮する方法
と、この圧縮された文字を伸長する方法を提供すること
を目的とする。SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a method for compressing characters that cannot be compressed because the same dot patterns do not occur consecutively, in a simple manner, and a method for decompressing the compressed characters.
発明の開示
本発明は、文字を圧縮する前に、ドットを追加して同一
のドットパターンが連続するような文字を創る。そし
て、この文字を圧縮してキャラクタジェネレータに記憶
しておく。文字を印字するときは、この圧縮された文字
をキャラクタジェネレータから読み出して伸長し、圧縮
する前の文字に戻す。さらに、この伸長した文字から、
圧縮するときに追加したドットを除去する。Disclosure of the Invention In the present invention, before compressing a character, dots are added to create a character with a continuous identical dot pattern. This character is then compressed and stored in a character generator. When printing a character, this compressed character is read from the character generator and expanded to restore the character before compression. Furthermore, from this expanded character,
Remove the dots added during compression.
これにより、同一のドットパターンが連続しないために
圧縮できない文字でも簡単な方法で圧縮できる。This allows characters that cannot be compressed because the same dot pattern does not occur consecutively to be compressed in a simple manner.
図面の簡単な説明
第1図は同一のドットパターンが連続しない文字の一例
を示す図、第2図は第1図の文字にドットを追加して同
一のドットパターンが連続するようにした文字を示す
図、第3図はキャラクタジェネレータの記憶データを示
す図、第4図はプリンタの制御回路を示す図、第5図は
伸長処理を示すフローチャート、第6図は追加したドッ
トを除去する制御回路を示す図である。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram showing an example of a character in which the same dot pattern is not continuous, FIG. 2 is a diagram showing a character in which dots are added to the character in FIG. 1 so that the same dot pattern is continuous, FIG. 3 is a diagram showing stored data in a character generator, FIG. 4 is a diagram showing a control circuit of a printer, FIG. 5 is a flowchart showing expansion processing, and FIG. 6 is a diagram showing a control circuit for removing the added dots.
発明を実施するための最良の形態 先ず、圧縮方法を説明する。Best Mode for Carrying Out the Invention First, the compression method will be described.
第2図は第1図の文字[M]に[○]のドットを追加し
た文字を示している。この[○]のドットは同一のドッ
トパターンを連続させるために追加しただけであり、印
字する前に除去される。この[○]のドットは同一行の
直前の列に印字ドット[●]があれば追加する。ただ
し、追加しても同一のドットパターンが連続しない場合
は追加しない。この文字[M]の場合、2列、4列〜7
列、15列、24列〜28列、および30列のドットパターンは
[○]のドットを追加すると、同一のドットパターンが
連続するので[○]のドットを追加する。しかし、8列
〜14列と17列〜23列のドットパターンはドットを追加し
ても隣の列のドットパターンと同一にならないので、こ
れらの列にはドットを追加しない。Figure 2 shows the character [M] in Figure 1 with a dot [○] added. This dot [○] is added only to make the same dot pattern continue, and is removed before printing. This dot [○] is added if there is a printing dot [●] in the column immediately preceding the same row. However, if the dot is added but the same dot pattern does not continue, it is not added. In the case of this character [M], columns 2, 4 to 7 are
Adding a dot [○] to the dot patterns in columns 8, 15, 24-28, and 30 would result in a series of identical dot patterns, so a dot [○] is added. However, adding a dot to the dot patterns in columns 8-14 and 17-23 would not make them identical to the dot patterns in the adjacent columns, so no dots are added to these columns.
ここで、第2図の文字を前述の圧縮方法によって圧縮し
た場合、キャラクタジェネレータの記憶データがどうな
るか第3図を用いて説明する。ただし、キャラクタジェ
ネレータは一つアドレスに8ビットのデータを記憶でき
るメモリである。Here, we will explain with reference to Figure 3 what happens to the data stored in the character generator when the character in Figure 2 is compressed using the compression method described above. The character generator is a memory that can store 8 bits of data per address.
第3図はキャラクタジェネレータの記憶データを示す。
ただし、印字結果を想像し易いように記憶データをドッ
トマトリクスで示す。同図において、図の上側の数字1
〜18は列番号、図の左側の数字1〜24は行番号である。
また、、、、………、、はキャラクタジ
ェネレータのアドレスであり、アドレスには1列目の
1行〜8行のデータ、アドレスには1行目の9行〜16
行のデータ、アドレスには1列目の17行〜24行のデー
タ、アドレスには2列目の1行〜8行のデータが記憶
されている。他のアドレスについても同様である。FIG. 3 shows the data stored in the character generator.
However, the stored data is shown in a dot matrix format to make it easier to imagine the printout.
The numbers 1 to 24 on the left side of the figure are row numbers.
Also, ...
The row data and address stores data from rows 17 to 24 in the first column, and the address stores data from rows 1 to 8 in the second column. The same applies to the other addresses.
キャラクタジェネレータに記憶されているデータはドッ
トデータと繰り返し回数を示すデータである。ドットデ
ータは第3図に示す各列の1行〜19行のデータである。
第3図ではドットデータを[●]と空白で示している。
[●]は、その部分のドットが印字されることを示し、
空白は、その部分のドットが印字されないことを示して
いる。キャラクタジェネレータには[●]に対応して
[1]、空白に対応して[0]の2値データが記憶され
ている。例えば、キャラクタジェネレータのアドレス
に記憶されているデータは、2進8桁の〔00110000〕
(1行目の1行〜8行のドットデータ)である。同様
に、アドレスに記憶されているのは、2進8桁の〔00
111111〕(2列目の1行〜8行のドットデータ)であ
る。一方、繰り返し回数を示すデータは第3図に示す各
列の20行〜24行のデータである。キャラクタジェネレー
タには、[◎]に対応して[1]、空白に対応して
[0]の2値データが記憶されている。繰り返し回数を
示すデータは20行のデータを最上位ビットとする2進5
桁の数で表される。例えば、第3図の1列目の繰り返し
回数を示すデータは、〔00010〕、つまり、10進数の
[2]である。同様に、2列目は、〔00011〕つまり、1
0進数の[3]である。The data stored in the character generator is dot data and data indicating the number of repetitions. The dot data is data for rows 1 to 19 of each column shown in FIG.
In FIG. 3, dot data is shown as [●] and blank spaces.
[●] indicates that a dot will be printed in that area,
A blank space indicates that no dot will be printed in that area. The character generator stores binary data: [1] for [●] and [0] for blank spaces. For example, the data stored in the character generator address is an 8-digit binary value: [00110000]
(dot data for lines 1 to 8 of the first line). Similarly, the address is stored as an 8-digit binary number [00
111111] (dot data from rows 1 to 8 of the second column). On the other hand, the data indicating the number of repetitions is the data from rows 20 to 24 of each column shown in Figure 3. The character generator stores binary data [1] corresponding to [◎] and [0] corresponding to a space. The data indicating the number of repetitions is a binary 5 notation with the data from row 20 as the most significant bit.
For example, the data indicating the number of repetitions in the first column of Figure 3 is [00010], which is a decimal number [2]. Similarly, the data in the second column is [00011], which is 1
The decimal number is [3].
次に、圧縮された文字の伸長方法を説明する。Next, a method for expanding compressed characters will be described.
第4図にプリンタの制御回路を示す。同図において、1
はプリンタの全体を制御するCPU、2はCPU1が実行する
プログラムを記憶しているROM、3はデータを記憶する
ためのRAM、4はI/Oドライバ、5は外部装置にプリンタ
を接続するためのインタフェース回路、56は印字ヘッ
ド、7は印字用紙を搬送するための改行モータ、8は印
字ヘッド6を左右にスペーシングさせるためのスペーシ
ングモータである。なお、キャラクタジェネレータは図
示していないが、ROM2またはRAM3の中にある。The control circuit of the printer is shown in FIG.
is a CPU that controls the entire printer, 2 is a ROM that stores the programs executed by CPU 1, 3 is a RAM for storing data, 4 is an I/O driver, 5 is an interface circuit for connecting the printer to an external device, 56 is a print head, 7 is a line feed motor for transporting the print paper, and 8 is a spacing motor for spacing the print head 6 left and right. Although a character generator is not shown, it is located in ROM 2 or RAM 3.
第5図は圧縮された文字を伸長するためのフローチャー
トである。このフローチャートに示す伸長処理は第4図
のCPU1がROM2に記憶されているプログラムに従って実行
する。以下、このフローチャートに従って伸長処理を説
明する。ただし、以下の説明では各種のカウンタおよび
フラグは第4図のRAM3の中にあるものとして説明する。Figure 5 is a flowchart for decompressing compressed characters. The decompression process shown in this flowchart is executed by CPU 1 in Figure 4 in accordance with a program stored in ROM 2. The decompression process will be explained below in accordance with this flowchart. However, in the following explanation, it is assumed that various counters and flags are stored in RAM 3 in Figure 4.
先ず、ステップS1において、アドレスカウンタADRCT
(1)に所定のアドレスをセットする。このアドレスは
キャラクタジェネレータのアドレスであり、読み出した
い文字のドットデータが記憶されている記憶エリアの先
頭アドレスである。例えば、第3図のアドレスであ
る。また、アドレスカウンタADRCT(2)に所定のアド
レスをセットする。このアドレスはRAM3のアドレスであ
り、伸長されたドットデータを記憶する記憶エリアの先
頭アドレスである。さらに、カラムカウンタCLMCTに[3
0]をセットする。このカラムカウンタCLMCTは一文字分
の伸長処理が終了したかどうかを判定するためのもので
あり、ここでは一文字の最後の列が30列(第2図参照)
なので[30]をセットする。さらに、フラグFに[1]
をセットする。このフラグFはキャラクタジェネレータ
から読み出した繰り出し回数を後述の繰り返しカウンタ
CYCCTにセットするかどうかを判定するためのものであ
り、[1]がセットされているときだけ、繰り返し回数
を繰り返しカウンタCYCCTにセットする。First, in step S1, the address counter ADRCT
A predetermined address is set in (1). This address is the address of the character generator, and is the top address of the memory area where the dot data of the character to be read is stored. For example, it is the address in Figure 3. Also, a predetermined address is set in the address counter ADRCT (2). This address is the address of RAM3, and is the top address of the memory area where the expanded dot data is stored. Furthermore, [3
0]. This column counter CLMCT is used to determine whether the decompression process for one character has finished. In this case, the last column of one character is column 30 (see Figure 2).
Therefore, set [30]. Furthermore, set flag F to [1].
This flag F is set to the repeat counter (described later) which counts the number of times the character is fed out from the character generator.
This is to determine whether to set the number of repetitions in the CYCCT, and only when [1] is set, the number of repetitions is set in the repeat counter CYCCT.
次に、ステップS2において、アドレスカウンタADRCT
(1)を参照してキャラクタジェネレータからドットデ
ータを読み出す。アドレスカウンタADRCT(1)に第3
図のアドレスがセットされていれば、第3図の1列目
の1行〜8行のドットデータ〔00110000〕を読み出す。
以下、アドレスカウンタADRCT(1)に第3図のアドレ
スがセットされているものとして説明する。Next, in step S2, the address counter ADRCT
(1) and reads out dot data from the character generator. The third address is written to the address counter ADRCT(1).
If the address shown in the figure is set, the dot data [00110000] of the first row to the eighth row of the first column in FIG. 3 is read out.
The following description will be given assuming that the address shown in FIG. 3 is set in the address counter ADRCT(1).
次に、ステップS3において、アドレスカウンタADRCT
(2)を参照してRAM3にこのドットデータを書き込む。
そして、アドレスカウンタADRCT(2)をインクリメン
トする。Next, in step S3, the address counter ADRCT
This dot data is written to RAM3 by referring to (2).
Then, the address counter ADRCT(2) is incremented.
次に、ステップS4において、アドレスカウンタADRCT
(1)をインクリメントする。Next, in step S4, the address counter ADRCT
Increment (1).
次に、ステップS5において、アドレスカウンタADRCT
(1)を参照してキャラクタジェネレータからドットデ
ータを読み出す。これにより、第3図の1列目の9行〜
16行のドットデータ〔00000000〕を読み出す。Next, in step S5, the address counter ADRCT
By referring to (1), dot data is read from the character generator. As a result, the 9th row of the 1st column in FIG.
Read out 16 lines of dot data [00000000].
次に、ステップS6において、アドレスカウンタADRCT
(2)を参照してRAM3にこのドットデータを書き込む。
そして、アドレスカウンタADRCT(2)をインクリメン
トする。Next, in step S6, the address counter ADRCT
This dot data is written to RAM3 by referring to (2).
Then, the address counter ADRCT(2) is incremented.
次に、ステップS7において、アドレスカウンタADRCT
(1)をインクリメントする。Next, in step S7, the address counter ADRCT
Increment (1).
次に、ステップS8において、アドレスカウンタADRCT
(1)を参照してキャラクタジェネレータからドットデ
ータを読み出す。これにより、第3図の1列目の17行〜
24行のデータ〔01100010〕を読み出す。ただし、下の5
ビット〔00010〕は繰り返し回数を示すデータである。
ここでは、繰り返し回数は2回である。Next, in step S8, the address counter ADRCT
By referring to (1), dot data is read from the character generator. As a result, the 17th row of the 1st column in Figure 3
Read the 24th row of data [01100010]. However, the bottom 5
Bits [00010] are data indicating the number of repetitions.
Here, the number of repetitions is two.
次に、ステップS9において、フラグFに[1]がセット
されているかどうかを判定する。ここでは、ステップS1
においてフラグFに[1]がセットされているので判定
結果はYESとなり、ステップS10へ進む。Next, in step S9, it is determined whether flag F is set to [1].
Since flag F is set to [1] in step S10, the result of the determination is YES, and the process proceeds to step S10.
次に、ステップS10において、フラグFに[0]をセッ
トする。Next, in step S10, flag F is set to [0].
次に、ステップS11において、ステップS8において読み
出した繰り返し回数を繰り返しカウンタCYCCTにセット
する。ここでは、繰り返し回数が2回なので[2]をセ
ットする。Next, in step S11, the number of repetitions read out in step S8 is set in the repetition counter CYCCT. In this case, since the number of repetitions is two, [2] is set.
次に、ステップS12において、アドレスカウンタADRCT
(2)を参照してRAM3にステップS8において読み出した
ドットデータを書き込む。ただし、下の5ビット(繰り
返し回数を示すデータ)を〔00000〕にして書き込む。
これにより、第2図の1列目のドットパターンがRAM3に
記憶される。そして、アドレスカウンタADRCT(2)を
インクリメントする。Next, in step S12, the address counter ADRCT
With reference to (2), the dot data read out in step S8 is written to RAM 3. However, the bottom five bits (data indicating the number of repetitions) are written as [00000].
As a result, the dot pattern of the first row in Fig. 2 is stored in RAM 3. Then, the address counter ADRCT(2) is incremented.
次に、ステップS13において、カラムカウンタCLMCTをデ
クリメントする。これにより、カラムカウンタCLMCTの
値は[29]になる。Next, in step S13, the column counter CLMCT is decremented, so that the value of the column counter CLMCT becomes [29].
次に、ステップS14において、繰り返しカウンタCYCCTの
値が[0]かどうかを判定する。ここでは、ステップS1
1において繰り返しカウンタCYCCTに[2]がセットされ
ているので判定結果はNOとなり、ステップS18へ進む。Next, in step S14, it is determined whether the value of the repeat counter CYCCT is [0].
In step S1, the repeat counter CYCCT is set to [2], so the result of the determination is NO, and the process proceeds to step S18.
次に、ステップS18において、繰り返しカウンタCYCCTを
デクリメントする。これにより、繰り返しカウンタCYCC
Tの値は[1]になる。Next, in step S18, the repeat counter CYCCT is decremented.
The value of T is [1].
次に、ステップS19において、アドレスカウンタADRCT
(1)から[2]を減算する。これにより、アドレスカ
ウンタADRCT(1)の値は元に戻る。つまり、すでに実
行済みのステップS2における値に戻る。Next, in step S19, the address counter ADRCT
[2] is subtracted from (1). As a result, the value of the address counter ADRCT (1) returns to the original value. In other words, it returns to the value at step S2, which has already been executed.
次に、再びステップS2〜ステップS12の処理を実行す
る。このとき、アドレスカウンタADRCT(1)の値は元
に戻っているので、キャラクタジェネレータから再び第
3図の1列目のドットデータが読み出され、RAM3に書き
込まれる。これにより、第2図の2列目のドットデータ
がRAM3に記憶される。ただし、ステップS9の判定結果は
NOになり、ステップS10とステップS11の処理は実行され
ない。従って、繰り返しカウンタCYCCTの値は更新され
ず、[1]のままである。Next, the processing of steps S2 to S12 is executed again. At this time, the value of the address counter ADRCT(1) is restored to the original value, so the dot data of the first column in FIG. 3 is read out from the character generator again and written to RAM 3. As a result, the dot data of the second column in FIG. 2 is stored in RAM 3. However, the result of the determination in step S9 is
The result is NO, and the processes in steps S10 and S11 are not executed. Therefore, the value of the repeat counter CYCCT is not updated and remains at [1].
次に、ステップS13〜ステップS19の処理を実行する。こ
のとき、繰り返しカウンタCYCCTの値は[1]なので、
ステップS14の判定結果はNOになる。これにより、カラ
ムカウンタCLMCTの値は[28]、繰り返しカウンタCYCCT
の値は[0]になる。また、アドレスカウンタADRCT
(1)の値は再び元に戻る。Next, the processes of steps S13 to S19 are executed. At this time, the value of the repeat counter CYCCT is [1], so
The result of the determination in step S14 is NO. As a result, the value of the column counter CLMCT is set to [28], and the value of the repeat counter CYCCT is set to [0].
The value of the address counter ADRCT becomes [0].
The value of (1) returns to the original value.
次に、再びステップS2〜ステップS12の処理を実行す
る。このとき、アドレスカウンタADRCT(1)の値は元
に戻っているので、キャラクタジェネレータから再び第
3図の1列目のドットデータが読み出され、RAM3に書き
込まれる。これにより、第2図の3列目のドットデータ
がRAM3に記憶される。ただし、ステップS9の判定結果は
NOになり、ステップS10とステップS11の処理は実行され
ない。従って、繰り返しカウンタCYCCTの値は更新され
ず、[0]のままである。Next, the processing of steps S2 to S12 is executed again. At this time, the value of the address counter ADRCT(1) has returned to the original value, so the dot data of the first column in FIG. 3 is read out from the character generator again and written to RAM 3. As a result, the dot data of the third column in FIG. 2 is stored in RAM 3. However, the result of the determination in step S9 is
The result is NO, and the processes in steps S10 and S11 are not executed. Therefore, the value of the repeat counter CYCCT is not updated and remains at [0].
次に、ステップS13〜ステップS17の処理を実行する。こ
のとき、繰り返しカウンタCYCCTの値は[0]なので、
ステップS14の判定結果はYESになる。これにより、ステ
ップS15の処理が実行されてフラグFに再び[1]がセ
ットされる。さらに、カラムカウンタCLMCTの値は[2
7]なので、ステップS16の判定結果はNOになる。これに
より、ステップS17の処理が実行されてアドレスカウン
タADRCT(1)がインクリメントされる。Next, the processes of steps S13 to S17 are executed. At this time, the value of the repeat counter CYCCT is [0], so
The result of the determination in step S14 is YES. As a result, the process in step S15 is executed, and the flag F is set to [1] again. Furthermore, the value of the column counter CLMCT is set to [2
7], the result of the determination in step S16 is NO, so the process in step S17 is executed and the address counter ADRCT(1) is incremented.
次に、再びステップS2〜ステップS12の処理を実行す
る。このとき、アドレスカウンタADRCT(1)の値は更
新されているので、キャラクタジェネレータから今度は
第3図の2列目のドットデータが読み出され、RAM3に書
き込まれる。これにより、第2図の4列目のドットデー
タがRAM3に記憶される。ただし、ステップS9の判定結果
はYESになり、ステップS10とステップS11の処理が実行
される。これにより、フラグFに[0]がセットされ、
繰り返しカウンタCYCCTに[3]がセットされる。繰り
返しカウンタCYCCTに[3]がセットされるのは、第3
図に示すように2列目の繰り返し回数が3回になってい
るからである。Next, the processing of steps S2 to S12 is executed again. At this time, the value of the address counter ADRCT(1) has been updated, so this time the dot data of the second column in FIG. 3 is read from the character generator and written to RAM3. As a result, the dot data of the fourth column in FIG. 2 is stored in RAM3. However, the result of the determination in step S9 is YES, and the processing of steps S10 and S11 is executed. As a result, flag F is set to [0],
The repeat counter CYCCT is set to [3]. The repeat counter CYCCT is set to [3] on the third
This is because the number of repetitions in the second column is three, as shown in the figure.
以下、カラムカウンタCLMCTの値が[0]になるまで各
ステップの処理を実行する。カラムカウンタCLMCTの値
が[0]になると、ステップS16の判定結果がYESにな
り、一文字分の伸長処理を終了する。その結果、RAM3に
第2図に示すドットデータが記憶される。Thereafter, the processing of each step is executed until the value of the column counter CLMCT becomes [0]. When the value of the column counter CLMCT becomes [0], the determination result of step S16 becomes YES, and the decompression processing for one character ends. As a result, the dot data shown in Figure 2 is stored in RAM 3.
次に、第3図の[○]のドットを除去する処理について
説明する。Next, the process of removing the dots [◯] in FIG. 3 will be described.
第6図は、この処理を実行する制御回路を示す。なお、
この処理は第4図に示すCPU1がROM2に記憶されているプ
ログラムに従って実行しても良い。第6図において、9
はAND回路、10はAND回路9の出力データを記憶する記憶
装置、11は記憶装置10の出力データを反転するNOT回路
である。FIG. 6 shows the control circuit that executes this process.
This process may be executed by the CPU 1 shown in FIG. 4 in accordance with a program stored in the ROM 2.
denotes an AND circuit, 10 denotes a storage device that stores the output data of the AND circuit 9, and 11 denotes a NOT circuit that inverts the output data of the storage device 10.
次に、この制御回路の動作を説明する。ただし、記憶装
置10の記憶内容は予めクリアされて[0]になっている
ものとする。また、第4図のRAM3には第2図に示す伸長
済みのドットデータが記憶されているものとする。Next, the operation of this control circuit will be explained. However, it is assumed that the contents of the memory device 10 have been cleared to [0] in advance. Also, it is assumed that the expanded dot data shown in Figure 2 is stored in RAM 3 in Figure 4.
先ず、RAM3から第2図の1列目のドットデータ(24ビッ
ト)が読み出され、AND回路9の入力端子Bに入力され
る。第3図左端の番号1〜24をビット番号とすると、3
番、4番、18番、19番のビットが[1]のデータがAND
回路9に入力される。このとき、前述の通り記憶装置10
の出力データ(24ビット)の全てのビットが[0]であ
り、NOT回路11の出力データ(24ビット)の全てのビッ
トは[1]である。そのため、AND回路9の入力端子A
には全てのビットが[1]のデータが入力されている。
従って、入力端子Bに入力されたデータと同一のデータ
がAND回路9から出力される。つまり、第2図の1列目
のドットデータが出力される。そして、この出力データ
は第4図のRAM3に記憶され、印字するとき、RAM3から読
み出され、I/Oドライバ4を介して印字ヘッド6に送ら
れる。ただし、第4図のRAM3にはこの出力データを記憶
するエリアが用意されているものとする。例えば、1つ
の印字行分のドットデータを記憶できるエリアが用意さ
れているものとする。AND回路9の出力データ、つまり
第2図の1列目のドットデータは記憶装置10にも記憶さ
れる。その結果、第2図の1列目のドットデータを反転
したデータがAND回路9の入力端子Aに入力される。つ
まり、3番、4番、18番、19番のビットが[0]のデー
タがAND回路9の入力端子Aに入力される。First, the dot data (24 bits) of the first column in FIG. 2 is read from RAM 3 and input to input terminal B of AND circuit 9. If the numbers 1 to 24 on the left side of FIG. 3 are bit numbers, then
Data with bits 1, 4, 18, and 19 set to [1] is ANDed.
At this time, as described above, the memory device 10
All bits of the output data (24 bits) of the AND circuit 9 are [0], and all bits of the output data (24 bits) of the NOT circuit 11 are [1].
The data in which all bits are [1] is input to the register.
Therefore, the same data as that input to input terminal B is output from AND circuit 9. In other words, the dot data for the first column in Figure 2 is output. This output data is then stored in RAM 3 in Figure 4, and when printing, it is read from RAM 3 and sent to print head 6 via I/O driver 4. However, it is assumed that RAM 3 in Figure 4 has an area for storing this output data. For example, it is assumed that an area is prepared that can store dot data for one printing line. The output data of AND circuit 9, that is, the dot data for the first column in Figure 2, is also stored in memory device 10. As a result, data that is the inverse of the dot data for the first column in Figure 2 is input to input terminal A of AND circuit 9. In other words, data with bits 3, 4, 18, and 19 set to [0] is input to input terminal A of AND circuit 9.
次に、RAM3から第2図の2列目のドットデータ(24ビッ
ト)が読み出され、AND回路9の入力端子Bに入力され
る。このとき、3番、4番、18番、19番のビットが
[0]のデータがAND回路9の入力端子Aに入力されて
いる。従って、AND回路9によって、第2図の2列目の
[○]のドットデータが除去される。これにより、全て
のビットが0のデータがAND回路9から出力される。以
後、このデータがRAM3に記憶されるのと、記憶装置10に
記憶されるのは前述の通りである。このようにして、AN
D回路9により、第2図の全ての列の[○]のドットデ
ータが除去される。そして、RAM3に印字用のドットデー
タが記憶される。Next, the dot data (24 bits) of the second column in Fig. 2 is read from RAM 3 and input to input terminal B of AND circuit 9. At this time, data with bits 3, 4, 18, and 19 being [0] is input to input terminal A of AND circuit 9. Therefore, the dot data of [○] in the second column in Fig. 2 is removed by AND circuit 9. As a result, data with all bits being 0 is output from AND circuit 9. Thereafter, this data is stored in RAM 3 and in storage device 10 as described above. In this way, AN
The D circuit 9 removes the dot data of [◯] in all columns in Fig. 2. Then, the dot data for printing is stored in the RAM 3.
以上は文字[M]を例にして圧縮・伸長処理を説明し
た。The compression and decompression process has been described above using the character [M] as an example.
しかし、プリンタで使用する文字のドットパターンは種
々である。例えば、アルファベットの小文字[j]のよ
うに、第3図の20行〜24行の間にドットデータが存在す
る文字もあり、繰り返し回数を示すデータが記憶できな
い。従って、この文字は圧縮しない。また、第3図の20
行〜24行の間に繰り返し回数を示すデータが記憶できな
くても圧縮した方が良い文字もある。このような文字に
ついては、1列当りのデータ(ドットデータと繰り返し
回数を示すデータ)をキャラクタジェネレータの4つの
アドレスに記憶する。つまり、ドットデータを3つのア
ドレスに、繰り返し回数を示すデータを1つのアドレス
に記憶する。However, the dot patterns of characters used in printers vary. For example, there are characters such as the lowercase letter [j] whose dot data exists between lines 20 and 24 in Figure 3, and data indicating the number of repetitions cannot be stored. Therefore, this character is not compressed.
There are some characters that are better compressed even if the data indicating the number of repetitions cannot be stored between rows 1 and 24. For such characters, the data per column (dot data and data indicating the number of repetitions) is stored in four addresses in the character generator. In other words, the dot data is stored in three addresses and the data indicating the number of repetitions is stored in one address.
このように、文字によって圧縮方法が異なる。従って、
圧縮の方法を識別する必要がある。そこで、本発明が適
用されるプリンタは文字毎に圧縮の方法を識別できるよ
うになっている。そのため、文字の管理情報を記憶した
管理テーブルを持っている。この管理テーブルは第4図
のROM2の中にある。そして、圧縮方法を識別するデータ
を記憶している。また、その文字のドットデータがキャ
ラクタジェネレータのどのアドレスを先頭にして記憶さ
れているかを示すアドレスデータ(先頭アドレス)を記
憶している。その他にも、文字に関する種々のデータを
記憶している。In this way, the compression method differs depending on the character.
It is necessary to identify the compression method. Therefore, printers to which this invention is applied are designed to be able to identify the compression method for each character. For this purpose, they have a management table that stores character management information. This management table is in ROM2 in Figure 4. It stores data that identifies the compression method. It also stores address data (starting address) that indicates which address in the character generator the dot data for that character is stored at. In addition, various other data related to the character is stored.
産業上の利用可能性
以上のように、本発明は同一のドットパターンが連続し
ないために圧縮出来ない文字を圧縮するのに適してい
る。INDUSTRIAL APPLICABILITY As described above, the present invention is suitable for compressing characters that cannot be compressed because the same dot patterns do not occur consecutively.
Claims (3)
成されたドットマトリクス文字を圧縮する方法であっ
て、 同一のドットパターンが複数列連続したドットマトリク
ス文字を創るために、同一行の直前の列にドットが存在
する列にドットを追加して同一行にドットが2列連続し
たドットマトリクス文字を創るステップと、 ドットマトリクス文字をキャラクタジェネレータに圧縮
して記憶するために、同一のドットパターンが複数列連
続する場合は、キャラクタジェネレータに一列分のドッ
トパターンと、このドットパターンの繰り返し回数とを
記憶するステップと により構成されたドットマトリクス文字の圧縮方法。[Claim 1] A method for compressing dot-matrix characters that are configured so that no two columns of dots are consecutive in the same row, comprising the steps of: adding a dot to a column in the same row where a dot already exists, in order to create a dot-matrix character with multiple columns of the same dot pattern, thereby creating a dot-matrix character with two columns of consecutive dots in the same row; and, in the case of multiple columns of the same dot pattern, storing one column of the dot pattern and the number of times this dot pattern is repeated in the character generator, in order to compress and store the dot-matrix character in a character generator.
た列のドットパターンが隣の列のドットパターンと同一
にならない場合はドットを追加しないことを特徴とする
請求の範囲第1項記載のドットマトリクス文字の圧縮方
法。[Claim 2] A method for compressing dot-matrix characters as described in claim 1, characterized in that even if a dot is added, if the dot pattern of the column to which the dot is added does not become identical to the dot pattern of the adjacent column, no dot is added.
ドットを追加して同一行にドットが2列連続したドット
マトリクス文字を創るステップと、同一のドットパター
ンが複数列連続する場合は、キャラクタジェネレータに
一列分のドットパターンと、このドットパターンの繰り
返し回数とを記憶するステップとによってキャラクタジ
ェネレータに圧縮されて記憶されたドットマトリクス文
字をキャラクタジェネレータから読み出して伸長する方
法であって、 圧縮されたドットマトリクス文字を圧縮される前のドッ
トマトリクス文字に戻すために、キャラクタジェネレー
タに記憶された繰り返し回数だけ同一のドットパターン
を読み出すステップと、 圧縮するときに追加したドットを除去するために、同一
行の直前の列にドットが存在する列のドットを除去する
ステップと により構成されたドットマトリクス文字の伸長方法。[Claim 3] A method for reading out and decompressing a dot-matrix character that has been compressed and stored in a character generator by the steps of: adding a dot to a column in which a dot exists in the column immediately preceding the same row to create a dot-matrix character with two consecutive columns of dots in the same row; and, if the same dot pattern occurs in multiple consecutive columns, storing in the character generator a dot pattern for one column and the number of times this dot pattern is repeated, wherein the method for decompressing a dot-matrix character comprises the steps of: reading out the same dot pattern the number of times stored in the character generator to restore the compressed dot-matrix character to the dot-matrix character before compression; and removing dots from a column in which a dot exists in the column immediately preceding the same row to remove the dots added during compression.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1-510022A JPH0733104B2 (en) | 1988-09-26 | 1989-09-22 | Compression and decompression method for dot matrix characters |
Applications Claiming Priority (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63-238780 | 1988-09-26 | ||
| JP23878088 | 1988-09-26 | ||
| JP1-510022A JPH0733104B2 (en) | 1988-09-26 | 1989-09-22 | Compression and decompression method for dot matrix characters |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| JPWO1990003272A1 JPWO1990003272A1 (en) | 1990-09-06 |
| JPH0733104B2 true JPH0733104B2 (en) | 1995-04-12 |
| JPH0733104B1 JPH0733104B1 (en) | 1995-04-12 |
Family
ID=26533885
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1-510022A Expired - Lifetime JPH0733104B2 (en) | 1988-09-26 | 1989-09-22 | Compression and decompression method for dot matrix characters |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0733104B2 (en) |
-
1989
- 1989-09-22 JP JP1-510022A patent/JPH0733104B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0733104B1 (en) | 1995-04-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2647226B2 (en) | Dot pattern compression method and decompression method | |
| US5199803A (en) | Method of compressing and expanding dot-matrix character | |
| JPH0552274B2 (en) | ||
| JPS6357797B2 (en) | ||
| JPH04220764A (en) | Method and apparatus for compressing character font | |
| JPS63251248A (en) | Method and device for generating character image | |
| JPS6322310B2 (en) | ||
| JP2000158720A (en) | Barcode printing device | |
| US4704040A (en) | Memory device and printing system for dot printer | |
| JPH0733104B2 (en) | Compression and decompression method for dot matrix characters | |
| JPH06222747A (en) | Font compression device and font restoration device | |
| JPS5949584A (en) | System of processing data in mixed various character sizes | |
| JPWO1990003272A1 (en) | Compression and decompression method for dot matrix characters | |
| JP2699035B2 (en) | Impact dot printer and printing method | |
| JP3013512B2 (en) | Barcode printer | |
| JPH01130957A (en) | Character controlling apparatus | |
| JPH09198500A (en) | Image data image quality improvement circuit | |
| JPH0439434B2 (en) | ||
| JPH04255369A (en) | Printing control method | |
| JP2881924B2 (en) | Data storage device | |
| JPH0630927B2 (en) | Pattern output method | |
| JPH0525673B2 (en) | ||
| JPH0570856B2 (en) | ||
| JPH0426137B2 (en) | ||
| JPH0325495A (en) | Printer |