JPH0749222B2 - Filling method inside closed curve - Google Patents
Filling method inside closed curveInfo
- Publication number
- JPH0749222B2 JPH0749222B2 JP63278299A JP27829988A JPH0749222B2 JP H0749222 B2 JPH0749222 B2 JP H0749222B2 JP 63278299 A JP63278299 A JP 63278299A JP 27829988 A JP27829988 A JP 27829988A JP H0749222 B2 JPH0749222 B2 JP H0749222B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- attribute data
- written
- vector
- pixel
- 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 - Fee Related
Links
Landscapes
- Controls And Circuits For Display Device (AREA)
- Dot-Matrix Printers And Others (AREA)
Description
「産業上の利用分野」 この発明は、特に、高品質の文字のプリントアウトを行
う印字システム等において用いて好適な閉曲線内の塗り
潰し方法に関する。 「従来の技術」 近年、レーザプリンタの発達と共に、明朝体,ゴシック
体等種々の文字フォントによる高品質の文字を印字でき
るシステムが開発されつつある。そして、このような印
字システムにおいては、種々の文字フォントによる文字
が印字できるだけでなく、文字サイズも任意に設定でき
ることが要望される。しかし、従来のこの種のシステム
においては、文字フォントをピクセルデータでもつこと
が普通であり、このため、2倍、1/2倍等の簡単なサイ
ズ変更はできるが、3.5倍,5倍,1/7倍等任意の倍率によ
る拡大,縮小を、印字品質を損なうことなく行うのは不
可能であった。 他方、種々の文字フォントによる文字を任意のサイズで
印字できるようにする方法として、文字フォントをアウ
トライン(輪郭線)ベクトルによってもつ方法が知られ
ている。この方法において文字の拡大,縮小を行う場合
は、予めベクトルデータを演算によって拡大または縮小
し、この演算によって得られたベクトルデータを輪郭線
のピクセルデータに変換し、次いで、輪郭線の内部を塗
り潰して文字とする。この方法によれば、いかなる倍率
による拡大,縮小を行っても、印字品質を損なうことが
ない。そして、この発明は、特に上述した文字の輪郭線
内部の塗り潰しに用いて好適な塗り潰し方法に関するも
のである。 次に、従来から知られている塗り潰し方法について説明
する。 (1)パリティチェック法 第11図において、符号1は印刷用紙の1ページのピクセ
ル数に等しい記憶容量を有する画像メモリ、2はこの画
像メモリ1内にデータ“1"によって書き込まれた画像の
輪郭線である。この輪郭線2の内部を塗り潰す場合、パ
リティチェック法は、画像メモリ1に書かれた輪郭線の
極大値あるいは極小値から順に水平走査をしていく。そ
して、輪郭線(データ“1")が検出された場合、以後、
データ“1"を逐次書き込み、次に輪郭線が検出された場
合に書き込みを停止し、次に輪郭線が検出されると、再
びデータ“1"を書き込み、この処理を繰り返す。このよ
うな処理により、例えば図の破線L1の位置の走査におい
ては、範囲H1およびH2に“1"が書き込まれる(塗り潰し
が行なわれる)。 (2)追跡法 第12図において、符号3は画像メモリ内に書き込まれた
輪郭線、SEは輪郭線3内の任意の一点(シードという)
である。この追跡法は、まず、シードSEから矢印Y1方向
へ画像メモリの走査を行って輪郭線3を検出する。次
に、輪郭線3の1つ内側のピクセルP1に対応する画像メ
モリの記憶位置に例えばデータ「2」を書き込む。以
下、輪郭線3に沿って、輪郭線3の内側のピクセルP2,P
3……に対応する記憶位置に順次「2」を書き込んで行
く。そして、輪郭線3に沿う全周についてデータ「2」
の書き込みが終了すると、次に、データ「2」が書き込
まれたピクセル間を塗り潰すすなわち、この場合、デー
タ「2」を書き込む。この塗り潰しの際に、例えば別の
輪郭線4を検出した場合(矢印Y2の走査参照)は、この
輪郭線4の周囲(この場合、外側)にデータ「2」を書
き込んだ後、再びデータ「2」→「2」間の塗り潰しを
行う。 (3)セグメント法 第13図において、符号5は画像メモリ内に描かれた輪郭
線、SEはシードである。このセグメント法は、まず、シ
ードSEから矢印Y3方向へ塗り潰しを行う。そして、輪郭
線5のピクセルPaを検出した場合は、その上の輪郭線ピ
クセルのアドレスをスタックアドレスST1として一時記
憶メモリ内に記憶させ、次いで、ピクセルPaの下の輪郭
線ピクセルPbから矢印Y4方向へ塗り潰しを行う。そし
て、輪郭線ピクセルPcを検出すると、次に、その下のピ
クセルPdから矢印Y5方向の塗り潰しを行い、以下、この
動作を繰り返して図に示すエリアE1の塗り潰しを行う。
また、この塗り潰しの過程において、輪郭線ピクセル間
の連続性、すなわち、ピクセルPa,Pb,Pe……の連続性お
よびピクセルPc,Pd……の連続性を各々チェックしてい
く。そして、上述した連続性がくずれた場合、すなわち
ピクセルPkを検出した場合は、次のピクセルのアドレス
をスタックアドレスST2としてメモリに記憶させ、次い
でピクセルPlから再び塗り潰しを行う。そして、図に示
すエリアE2の塗り潰しが終了した時点で、メモリからス
タックアドレスST2を読み出し、そのアドレスが示すピ
クセルから塗り潰しを行ってエリアE3の塗り潰しを行
う。次に、スタックアドレスST1が示すピクセルから上
方へ塗り潰しを行ってエリアE4を塗り潰す。 以上が従来から知られている塗り潰し方法である。 「発明が解決しようとする課題」 しかしながら、上述した各塗り潰し方法にはいずれも種
々の欠点があり、このため、実際上、文字の塗り潰しに
は使用できない。 すなわち、まず、(1)パリティチェック法には次の欠
点がある。第14図において、ピクセルP1,P2は各々輪郭
線6上の頂点(極大点)であり、かつ、共に水平ライン
L2上の点であるとする。この場合、ラインL2を走査しつ
つ塗り潰しを行うと、図に示す範囲Haを塗り潰してしま
う。これを防ぐためには、ピクセルP1,P2が頂点である
ことを検出する必要がある。しかしながら、この頂点の
検出は、必ず1つ前のラインの各ピクセルデータを読み
出し、ラインL2の各ピクセルデータと比較することが必
要となるが、この処理に多くの時間を要してしまう。ま
た、このような比較処理を行っても、第15図に示す頂点
P3の検出は不可能である。また、第16図において、ライ
ンL3の走査および塗り潰しを行うと、範囲Hbの塗り潰し
は行なわれるが、範囲Hcの塗り潰しは行なわれない。さ
らに、第17図の場合は、本来塗り潰し行うべきでないエ
リアEaを塗り潰してしまう。なお、第15図〜第17図のよ
うな形は、勿論、本来の文字フォントには現れない。し
かしながら、文字の縮小を行うと、このような形がしば
しば現れる。したがって、文字の塗り潰しにおいては、
このような閉曲線と線が混合した図形の塗り潰しもでき
なければならない。 次に、(2)追跡法および(3)セグメント法は共に、
塗り潰すべき総ての領域内に予めシードをセットしなけ
ればならず、アルファベットであればまだしも、漢字フ
ォントのように、非常に多くの閉曲線に分かれている場
合は、各閉曲線内の総てにシードをセットすることが極
めて手間がかかる。また、予め元になる文字フォントに
シードをセットしたとしても、縮小によってシードのな
い閉曲線ができてしまい、この場合、塗り潰しができな
くなる。さらに、これらの方法は塗り潰し処理に時間が
かかり、このため、1秒間にせいぜい10数文字しか塗り
潰しを行うことができず、レーザプリンタの場合に要求
される2000文字/1秒間の塗り潰し速度は到底達成し得な
い。 以上のように、従来の塗り潰し方法はいずれも、文字
(特に漢字)フォントの塗り潰しには適用できず、文字
フォントの塗り潰しに適用できる塗り潰し方法がないと
いうのが現状である。 この発明は上述した事情に鑑みてなされたもので、極め
て高速に、しかも、誤りなく閉曲線内を塗り潰すことが
でき、したがって、文字フォントの塗り潰しにも適用す
ることができる閉曲線内の塗り潰し方法を提供すること
を目的としている。 「課題を解決するための手段」 この発明は、輪郭線を表すベクトルデータをピクセルデ
ータに変換して画像メモリに書き込み、該ピクセルデー
タによって囲まれる前記画像メモリの内部をピクセルデ
ータによって塗り潰す閉曲線内の塗り潰し方法におい
て、前記ベクトルデータをDDA処理によってピクセルデ
ータに変換すると同時に、前記ベクトルが持つ属性に対
応する属性データを、前記DDA処理から得られるベクト
ルの傾き、および前記ベクトルの方向および該属性デー
タを書き込むべきメモリ位置に既に書き込まれている属
性データに基づいて論理演算し、これによって得られた
属性データを前記ピクセルデータと共に前記画像メモリ
に書き込み、次に、このピクセルデータおよび属性デー
タが書き込まれた画像メモリを走査して該画像メモリ内
の前記属性データを検出し、この検出した属性データの
値に基づいて塗り潰し位置を決定することを特徴として
いる。 「作用」 この発明によれば、ベクトルデータをピクセルデータに
変換して画像メモリに書き込む際に、そのピクセルの属
性データを前記画像メモリに書き込んでいく。そして、
塗り潰し処理においては、ベクトルデータがDDA処理に
よってピクセルデータに変換される。また同時に、ベク
トルが持つ属性に対応する属性データが、DDA処理から
得られるベクトルの傾き、およびベクトルの方向および
該属性データを書き込むべきメモリ位置に既に書き込ま
れている属性データに基づいて論理演算される。そし
て、これによって得られた属性データがピクセルデータ
と共に画像メモリに書き込まれ、次に、このピクセルデ
ータおよび属性データが書き込まれた画像メモリが走査
されて該画像メモリ内の属性データが検出され、この検
出された属性データの値に基づいて塗り潰し位置が決定
される。 「実施例」 以下、図面を参照してこの発明の一実施例について説明
する。第1図はこの発明の一実施例による塗り潰し方法
を適用した印字システムの構成を示すブロック図であ
る。まず、全体構成を説明する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention particularly relates to a method of filling a closed curve suitable for use in a printing system or the like that prints out high-quality characters. “Prior Art” With the development of laser printers in recent years, a system capable of printing high-quality characters in various character fonts such as Mincho and Gothic is being developed. In such a printing system, it is required that not only characters in various character fonts can be printed but also the character size can be set arbitrarily. However, in this type of conventional system, it is common to have a character font with pixel data, and therefore simple size changes such as 2x and 1 / 2x are possible, but 3.5x, 5x, It was impossible to perform enlargement / reduction at an arbitrary magnification such as 1 / 7x without impairing print quality. On the other hand, as a method of making it possible to print characters of various character fonts in an arbitrary size, a method of using a character font with an outline (contour line) vector is known. When enlarging or reducing a character by this method, vector data is previously enlarged or reduced by calculation, the vector data obtained by this calculation is converted into contour line pixel data, and then the inside of the contour line is filled. Character. According to this method, the print quality will not be impaired by any enlargement or reduction. Further, the present invention relates to a filling method suitable for use especially for filling the inside of the outline of a character described above. Next, a conventionally known filling method will be described. (1) Parity check method In FIG. 11, reference numeral 1 is an image memory having a storage capacity equal to the number of pixels of one page of printing paper, and 2 is an outline of an image written by data "1" in the image memory 1. It is a line. When filling the inside of the contour line 2, the parity check method performs horizontal scanning in order from the maximum value or the minimum value of the contour line written in the image memory 1. When the contour line (data “1”) is detected,
The data “1” is sequentially written, the writing is stopped when the contour line is detected next, and when the contour line is detected next, the data “1” is written again and this process is repeated. By such processing, for example, in scanning at the position of the broken line L1 in the figure, "1" is written (filling is performed) in the ranges H1 and H2. (2) Tracking method In FIG. 12, reference numeral 3 is a contour line written in the image memory, and SE is an arbitrary point in the contour line 3 (referred to as a seed).
Is. In this tracking method, first, the contour line 3 is detected by scanning the image memory in the direction of the arrow Y1 from the seed SE. Next, for example, the data "2" is written in the storage position of the image memory corresponding to the pixel P1 on the inner side of the contour line 3. Below, along the contour line 3, the pixels P2, P inside the contour line 3
Write "2" to the memory locations corresponding to 3 ... Then, data “2” for the entire circumference along the contour line 3
When the writing of data is completed, the pixels between which the data “2” has been written are filled in, that is, in this case, the data “2” is written. During this filling, for example, if another contour line 4 is detected (see scanning of arrow Y2), after writing data "2" around the contour line 4 (in this case, outside), the data "2" is again written. Fill between 2 "and" 2 ". (3) Segment Method In FIG. 13, reference numeral 5 is a contour line drawn in the image memory, and SE is a seed. In this segment method, first, the seed SE is filled in the direction of the arrow Y3. Then, when the pixel Pa of the contour line 5 is detected, the address of the contour line pixel on the contour line 5 is stored in the temporary storage memory as the stack address ST1, and then from the contour line pixel Pb below the pixel Pa in the arrow Y4 direction. Fill to. Then, when the contour pixel Pc is detected, next, the pixel Pd below it is filled in the direction of the arrow Y5, and thereafter, this operation is repeated to fill the area E1 shown in the figure.
In the filling process, continuity between contour line pixels, that is, continuity of pixels Pa, Pb, Pe ... and continuity of pixels Pc, Pd. Then, when the above continuity is broken, that is, when the pixel Pk is detected, the address of the next pixel is stored in the memory as the stack address ST2, and then the pixel Pl is filled again. Then, when the filling of the area E2 shown in the drawing is completed, the stack address ST2 is read from the memory, and the pixel indicated by the address is filled to fill the area E3. Next, the area E4 is filled by performing painting upward from the pixel indicated by the stack address ST1. The above is the conventionally known filling method. [Problems to be Solved by the Invention] However, each of the above-described filling methods has various drawbacks, and therefore cannot be practically used for filling characters. That is, first, (1) the parity check method has the following drawbacks. In FIG. 14, pixels P1 and P2 are the vertices (maximum points) on the contour line 6 and both are horizontal lines.
Let it be a point on L2. In this case, if the filling is performed while scanning the line L2, the range Ha shown in the figure will be filled. To prevent this, it is necessary to detect that the pixels P1 and P2 are vertices. However, in order to detect this vertex, it is necessary to read out each pixel data of the immediately preceding line and compare it with each pixel data of the line L2, but this process requires a lot of time. Even if such comparison processing is performed, the vertices shown in FIG.
Detection of P3 is not possible. Further, in FIG. 16, when the line L3 is scanned and filled, the range Hb is filled, but the range Hc is not filled. Further, in the case of FIG. 17, the area Ea, which should not be filled originally, is filled. The shapes shown in FIGS. 15 to 17 do not appear in the original character font, of course. However, when characters are reduced, such shapes often appear. Therefore, when filling characters,
It is necessary to be able to fill a figure in which such closed curves and lines are mixed. Next, both (2) tracking method and (3) segment method,
Seeds must be set in advance in all areas to be filled, and if it is an alphabet, and if it is divided into a large number of closed curves, such as a Kanji font, then all of the closed curves will be filled. Setting the seed is extremely troublesome. Further, even if the seed is set in the original character font in advance, a closed curve without seed is generated due to the reduction, and in this case, the filling cannot be performed. Furthermore, these methods take a long time for the filling process, so that at most 10 or more characters can be filled in one second, and the filling speed of 2000 characters / second required for the laser printer is extremely low. It cannot be achieved. As described above, none of the conventional filling methods can be applied to the filling of character (especially Kanji) fonts, and there is no filling method applicable to the filling of character fonts. The present invention has been made in view of the above-mentioned circumstances, and a filling method within a closed curve that can be filled at an extremely high speed and without error can be applied to a filled font. It is intended to be provided. "Means for Solving the Problem" The present invention converts a vector data representing a contour line into pixel data, writes the pixel data in the image memory, and fills the inside of the image memory surrounded by the pixel data with the pixel data. In the filling method, the vector data is converted into pixel data by DDA processing, and at the same time, the attribute data corresponding to the attribute of the vector is the inclination of the vector obtained from the DDA processing, and the direction and the attribute data of the vector. Is logically operated on the basis of the attribute data already written to the memory location to be written, and the attribute data obtained thereby is written to the image memory together with the pixel data, and then the pixel data and the attribute data are written. Image memory and scan the image memory It is characterized in that the attribute data in the memory is detected, and the filling position is determined based on the value of the detected attribute data. [Operation] According to the present invention, when the vector data is converted into the pixel data and is written in the image memory, the attribute data of the pixel is written in the image memory. And
In the filling process, the vector data is converted into pixel data by the DDA process. At the same time, the attribute data corresponding to the attribute of the vector is logically calculated based on the inclination of the vector obtained from the DDA process, the direction of the vector, and the attribute data already written in the memory location where the attribute data should be written. It Then, the attribute data thus obtained is written in the image memory together with the pixel data, and then the image memory in which the pixel data and the attribute data are written is scanned to detect the attribute data in the image memory. The filling position is determined based on the detected value of the attribute data. [Embodiment] An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of a printing system to which a filling method according to an embodiment of the present invention is applied. First, the overall configuration will be described.
第1図において、1はCPU(中央処理装置)、2はCPU1
のプログラムが記憶されたROM、3はデータ記憶用のRA
M、4は文字フォントメモリである。この文字フォント
メモリには、各文字(漢字、かな、アルファベット等)
の輪郭線がベクトルデータによって記憶されている。具
体的には、例えば第2図に示す「G」の字であれば、図
に示す点P0〜P24の各座標データ(Px,Py)によって記憶
されている。5はフロッピィディスク装置であり、印字
すべき文章が記憶されたフロッピィディスクがセットさ
れる。6は操作部である。 以上の構成において、フロッピィディスクをフロッピィ
ディスク装置5にセットし、操作部6によって文字の大
きさの指定等各種の指示を行った後プリント開始指示を
行うと、CPU1がこの指示をうけ、まず、フロッピィディ
スクから1ページ分の文字データを読み出してRAM3に書
き込む。次いで、RAM3に書き込んだ各文字データに対応
する文字フォントを順次文字フォントメモリ4から読み
出し、曲線補間を行う際に使用される曲線式および文字
の印字位置に関するレイアウト情報と共に、座標変換プ
ロセッサ8へ出力する。 座標変換プロセッサ8は、輪郭線ベクトルを曲線補間す
ることによって滑らかな曲線とする。具体的には、第2
図のベクトルP3→P4を例にとると、このベクトルをさら
に小線分に分け、各点P3-1,P3-2……の座標データをCPU
1から出力される曲線式に基づいて算出する。次に、操
作部6によって指定された文字の大きさに応じて文字フ
ォントの拡大/縮小を行い、この拡大/縮小済みの文字
フォント(具体的には座標データ)を塗り潰しプロセッ
サ9へ出力する。 塗り潰しプロセッサ9は、まず、座標変換プロセッサ8
から供給される座標データによって表されるベクトルを
ピクセル列に変換する。具体的には、例えば、第3図に
示すベクトルVの始点および終点を表す座標データ
(X0,Y0)、(Xn,Yn)から、ピクセルP1,P2,P3……Pn-1
の座標データを求める。なお、ピクセルP0,Pnの座標デ
ータは各々(X0,Y0)、(Xn,Yn)である。また、この処
理の多くはDDA(Digital Difference Analyzer)と呼
ばれるハードウエアで実現されている。そして、上記の
DDA処理によって求めた2点間を補間する座標データ
を、CPU1から出力されるレイアウト情報に基づいてペー
ジメモリ10のアドレスに変換する。ここで、ページメモ
リ10は、3個のメモリ(DRAM)から構成され、各メモリ
が印字用紙1ページの全ピクセル数と同数のビット数を
有し、3個とも同一アドレスで書込/読出が行なわれ
る。すなわち、このページメモリ10には、アクセル当た
り3ビットの属性データを書き込むことができる。 また、塗り潰しプロセッサ9は、各ピクセルのアドレス
が示すページメモリ10の記憶位置に、そのピクセルの属
性データを書き込む。なお、属性データについては後述
する。次に、ページメモリ10内に1ページ分のピクセル
データ(属性データ)が書き込まれた時点で、各文字の
内部を塗り潰す塗り潰し処理を行う。そして、この塗り
潰し処理が終了した時点で、ページメモリ10内のデータ
を読み出し、レーザプリンタ11へ出力する。これによ
り、レーザプリンタ11において印字が行なわれる。In FIG. 1, 1 is a CPU (central processing unit), 2 is a CPU1
ROM storing the program of 3 and RA for data storage
M and 4 are character font memories. Each character (kanji, kana, alphabet, etc.) is stored in this character font memory.
The contour line is stored as vector data. Specifically, for example, in the case of the letter “G” shown in FIG. 2, it is stored by the coordinate data (P x , P y ) of the points P 0 to P 24 shown in the figure. Reference numeral 5 is a floppy disk device, on which a floppy disk storing a text to be printed is set. Reference numeral 6 is an operation unit. In the above configuration, when the floppy disk is set in the floppy disk device 5, various instructions such as designation of the character size are given by the operation unit 6 and then the print start instruction is given, the CPU 1 receives this instruction, and first, Read one page of character data from the floppy disk and write it to RAM3. Next, the character font corresponding to each character data written in the RAM 3 is sequentially read from the character font memory 4, and is output to the coordinate conversion processor 8 together with the layout information about the curve formula and the character print position used when performing the curve interpolation. To do. The coordinate conversion processor 8 forms a smooth curve by curve-interpolating the contour vector. Specifically, the second
Taking the vector P 3 → P 4 in the figure as an example, this vector is further divided into small line segments, and the coordinate data of each point P 3-1 , P 3-2 ...
It is calculated based on the curve formula output from 1. Next, the character font is enlarged / reduced according to the size of the character designated by the operation unit 6, and the enlarged / reduced character font (specifically, coordinate data) is output to the painting processor 9. The fill processor 9 first detects the coordinate conversion processor 8
Converts the vector represented by the coordinate data supplied from the to a pixel column. Specifically, for example, from the coordinate data (X 0 , Y 0 ) and (X n , Y n ) representing the start point and the end point of the vector V shown in FIG. 3, the pixels P 1 , P 2 , P 3 ... P n-1
Calculate the coordinate data of. The coordinate data of the pixels P 0 and P n are (X 0 , Y 0 ) and (X n , Y n ), respectively. Most of this processing is realized by hardware called DDA (Digital Difference Analyzer). And above
The coordinate data for interpolating between two points obtained by the DDA process is converted into the address of the page memory 10 based on the layout information output from the CPU 1. Here, the page memory 10 is composed of three memories (DRAM), each memory has the same number of bits as the total number of pixels of one page of print paper, and all three can be written / read at the same address. Done. That is, attribute data of 3 bits per accelerator can be written in the page memory 10. Further, the painting processor 9 writes the attribute data of the pixel in the storage position of the page memory 10 indicated by the address of each pixel. The attribute data will be described later. Next, when one page of pixel data (attribute data) is written in the page memory 10, a filling process for filling the inside of each character is performed. Then, when the filling process is completed, the data in the page memory 10 is read and output to the laser printer 11. As a result, the laser printer 11 prints.
【塗り潰しプロセッサ9の詳細】 次に、上述した塗り潰しプロセッサ9において行なわれ
る処理の詳細を説明する。 (1)DDA処理 このDDA処理は次の過程で行なわれる(第3図参照)。 次の演算を行って、X,Y座標の各差分△X,△Yを求め
る。 △X=Xn−X0 ……(1) △Y=Yn−Y0 ……(2) この演算によって座標の差分が求められると共に、△X,
△Yの符号から、ベクトルVの方向(X方向およびY方
向)を各々検知することができる。すなわち、△X,△Y
が共に正であればベクトルVの方向はX方向,Y方向とも
正、△X,△Yが共に負であれば、ベクトルVの方向はX
方向,Y方向とも負、△Xが正、△Yが負であればベクト
ルVの方向はX方向が正,Y方向が負、△Xが負、△Yが
正であればベクトルVの方向はX方向が負,Y方向が正と
なる。 上記の差分△X,△Yの絶対値の差Dを求める。 D=|△X|−|△Y| ……(3) この演算によって得られるDの符号から、ベクトルVに
おいて、X,Yいずれの方向が長軸、いずれの方向が短軸
であるかを検知することができる。なお、以下、X方向
が長軸の場合(D>0)をXメジャ、Y方向が長軸の場
合(D<0)をYメジャという。 ピクセルP1〜Pn-1の座標データを求める。 −(1)ベクトルVがXメジャの場合 Yi=(△Y/△X)(Xi−X0)+Y0 ……(4) なる式において、Xiに逐次歩進するデータ(X0+1),
(X0+2),……(X0+n−1)を順次代入してデータ
Y1,Y2……Yn-1を算出する。この結果得られる座標デー
タ{(X0+1),Y1}、{(X0+2),Y2}……{(X0+
n−1),Yn-1}が各々求めるべきピクセルP1〜Pn-1の
座標データである。 −(2)ベクトルVがYメジャの場合 Xi=(△X/△Y)(Yi−Y0)+X0 ……(5) なる式において、Yiに逐次歩進するデータ(Y0+1),
(Y0+2),……(Y0+n−1)を順次代入することに
よって、データX1,X2……Xn-1wo算出し、ピクセルP1〜P
n-1の各座標データ(Xi,Yi)を求める。 (2)ページメモリ10のアドレス算出 各文字の用紙上の印字位置、言い替えれば、各文字のペ
ージメモリ10内の書き込み位置を示す座標データは、座
標変換プロセッサ8から出力される。この座標データは
第2図に示す文字の基点P00の座標である。いま、この
座標データを(Px,Py)とすると、第2図の文字の輪郭
線を構成する各ピクセルPi(Xi,Yi)のページメモリ10
における位置(アドレス)は各々(Px+Xi,Py+Yi)と
なる。 (3)属性データのページメモリ10への書込 この印字システムにおいては、輪郭線を構成する各ピク
セルに対応するページメモリ10の記憶位置に各々、その
ピクセルの属性データ(3ビット)が書き込まれる。こ
こで、属性データとは、 (イ)そのピクセルが属するベクトルの傾き、すなわ
ち、同ベクトルがXメジャであるか、Yメジャである
か、 (ロ)そのピクセルが属するベクトルのX方向およびY
方向 (ハ)そのピクセルに対応するページメモリ10の記憶位
置に既に書き込まれている属性データ 以上3つの要素に基づいて決められるデータである。 以下、この属性データについて、第4図を参照して具体
的に説明する。第4図は属性データテーブルであり、こ
のテーブルにおいて「旧」とある欄は、既に書き込まれ
ている属性データを示し、「新」とある欄は、これから
書き込もうとする属性データを示している。 通常の輪郭線ピクセルの属性データ 第3図に示すベクトルV(文字の輪郭線ベクトル)がY
メジャ(|X|<|Y|)である場合、ピクセルP0〜Pnの属性
データはいずれも「1」となり、Xメジャ(|X|>|Y|)
である場合はいずれも「2」となる。そして、ページメ
モリ10のピクセルP0〜Pnの各々に対応する記憶位置にデ
ータが書き込まれていない場合(「0」の場合)は、上
述した属性データ「1」または「2」がページメモリ10
にそのまま書き込まれる。 2つのベクトルのそれぞれ方向の異なる接続点ピクセ
ルの属性データ 第5図(イ)〜(ヌ)に示す2つのベクトルV1とV2とが
V1→V2の順に接続されている場合、ベクトルV1の終点と
ベクトルV2の始点は同一ピクセルとなる。この場合、接
続点ピクセルPsの属性データは次のようになる。 (i)第5図(イ),(ロ)に示すように、ベクトルV1
→V2において、Y方向の符号が変化している場合は
「3」となる。以下、この場合をVerEdge(Vertical E
dge)という。 (ii)第5図(ハ),(ニ)に示すように、X方向の符
号が変化している場合は「4」となる。以下、この場合
をHorEdge(Horizontal Edge)という。 (iii)第5図(ホ),(ヘ)に示すように、X方向、
Y方向とも変化しない場合は、ベクトルV2のみの場合
(接続点でない場合)と同じになる。すなわち、第5図
(ホ)の場合(Xメジャ)は「2」に、(ヘ)の場合
(Yメジャ)は「1」になる。また、第5図(ト)、
(チ)のように、ベクトルV2のX方向またはY方向が0
となる場合も同様である。 (iv)第5図(リ),(ヌ)に示すベクトルV1,V2のよ
うに、X方向またはY方向が「0」から正または負の変
化した場合は、ベクトルV1の前のベクトルV0の方向に応
じて決まる。すなわち、第5図(リ)に示すように、ベ
クトルV0→V2において方向変化がない場合は、上記(ii
i)によって決められ、第5図(ヌ)に示すように、ベ
クトルV0→V2において方向変化がある場合は上記(i)
または(ii)によって決められる。 ページメモリ10の記憶位置に既に属性データが書き込
まれている場合における二重,三重…書込時の属性デー
タ 文字フォントメモリ4内の各文字フォントは勿論、輪郭
線が重ならないようにできている。したがって、文字サ
イズが規定の大きさまたは拡大の場合にはページメモリ
10内において二重書込が行なわれることはない。しか
し、文字フォントの縮小を行った場合には、輪郭線の重
なりがしばしば発生し、したがって、二重書込がしばし
ば発生し、場合によっては三重書込、四重書込…も発生
する。この二重,三重…書込時においては、これから書
き込もうとする属性データ(上記またはによってき
まる属性データ;第4図「新」欄参照)と、既に書き込
まれている属性データ(第4図「旧」欄参照)から、第
4図の属性データテーブルに基づいて新たに書き込むべ
き属性データが決まる。例えば、既に書き込まれている
属性データが「2」で、これから書き込もうとする属性
データが「2」の場合は「6」が書き込まれ、例えば既
に書き込まれている属性データが「4」で、これから書
き込もうとする属性データが「1」の場合は「5」が書
き込まれる。なお、ベクトルの始点の属性データ書込の
場合は、属性データテーブルが適用されず、前述した
の規則が適用される。 以上が属性データ書込処理の詳細である。実際の装置に
おいては、上記の各処理が1ピクセル単位で行なわれ
る。すなわち、例えば第3図のベクトルVの処理におい
て、まず、ピクセルPiの属性データ(ベクトルVの傾き
および方向に基づく属性データ)が求められ、次いで、
その属性データが書き込まれるページメモリ10のアドレ
スがDDA処理によって求められる。次に、そのアドレス
がページメモリ10に出力される。これにより、ページメ
モリ10から既に書き込まれている属性データ(またはデ
ータ「0」)が読み出される。次に、読み出された属性
データとこれから書き込もうとする属性データとの論理
演算(第4図のテーブルに基づく論理演算)が行なわ
れ、この演算結果がページメモリ10の上記のアドレスに
書き込まれる。この場合、上記の読出/書込処理は周知
のリードモディファイライトモードによって行なわれ
る。そして、上記の処理がベクトルVを構成する各ピク
セルPiについて順次行なわれる。 (4)塗り潰し処理 ページメモリ10への属性データの書込みが終了すると、
次に、この塗り潰し処理が行なわれる。この塗り潰し処
理によって、文字の輪郭線の内部が塗り潰される。具体
的には、輪郭線内部の各ピクセルに対応するページメモ
リ10の記憶位置にデータ(例えば「1」)が書き込まれ
る。 この塗り潰し処理は、基本的にはパリティチェック法に
よる塗り潰し処理と同じであり、第1図に示すページメ
モリ10の各記憶位置を、最上行から順次左から右へ走査
し、輪郭線、すなわち属性データを検出した場合は、そ
の属性データに基づいてパリティを変化させる。ここ
で、パリティとは、変化指示がある毎に“1"→“0"→
“1"→・・・と交互に変化するデータであり、トリガフ
リップフロップによって作られる1ビットのデータであ
る。そして、走査が輪郭線を通過し、データ「0」の領
域に達した場合に、その時のパリティが“1"であればそ
の領域を塗り潰し、“0"であれば塗り潰しを行わない。
以上が塗り潰し処理の概略である。 次に、属性データとパリティとの関係を説明する。第6
図はパリティ変化テーブルであり、この図にいて「Lef
t」は横に並んでいる2個の記憶位置のうちの左側の記
憶位置を示し、「Right」を右側の記憶位置を示してい
る。また、「1」はパリティ変化指示を示し、空欄は変
化させないことを示している。以下、このテーブルに基
づく塗り潰し処理を例をあげて説明する。 第7図(イ)は輪郭線ベクトルおよび走査線Scを示し、
(ロ)は走査線Sc上の各記憶位置を示している。まず、
走査線Scの走査が開始される前において、パリティがリ
セットされ、“0"とされる。次に、記憶位置K1〜K4の走
査(データ読出)が行なわれた後、記憶位置K5内のデー
タ読出が行なわれると、属性データ「2」が読み出され
る。この場合、「0」→「2」の変化であり、第6図の
パリティ変化テーブルは空欄(#1参照)であり、パリ
ティは変化しない。次に、記憶位置K6内の属性データ
「2」が読み出される。この場合、「2」→「2」の変
化であり、パリティ変化テーブルは空欄(#2参照)で
あり、パリティは変化しない。次に、記憶位置K7の属性
データ「0」が読み出される。この場合、「2」→
「0」の変化であり、パリティ変化テーブルは「1」
(#3参照)である。したがって、パリティ変化指示が
発生し、パリティが“1"となる。またこの場合、記憶位
置のデータが「0」となっていることから、塗り潰しを
行うか否かの判断が行なわれる。そして、この場合、パ
リティが“1"であることから、記憶位置K7にデータ
「1」の書込が行なわれる。以下、記憶位置K8,K9,K10
内のデータが順次読み出され、各データが「0」である
ので、「1」に書き変えられる(すなわち、塗り潰しが
行なわれる)。次に、記憶位置K11,K12,K13の各データ
が読み出され、再び輪郭線が検知され、パリティ変化テ
ーブルに基づく処理が行なわれる。そして、記憶位置K1
3のデータ処理においてパリティ変化指示が再び発生
し、パリティが“0"になる。この結果、以後の記憶位置
K13,K14……の塗り潰しは行なわれない。 なお、輪郭線は1ピクセルで構成されることは少なく、
上述した第7図に示すように複数のピクセルによって構
成される場合が多い。 ところで、上述したパリティ変化テーブルに基づく処理
のみでは、適切に塗り潰しを行えない場合がある。そこ
で、この実施例においては、次の例外規定を設けてい
る。 (例外1)VerEdge「3」を含む輪郭線の場合はパリテ
ィ変化指示を行わない。 (例外2)HorEdge「4」を含む輪郭線の場合はパリテ
ィ変化指示を行う。 (例外3)VerEdge「3」、HorEdge「4」を含まず、属
性データ「6」を含む輪郭線の場合はパリティ変化指示
を行わない。 (例外4)VerEdge「3」を偶数個含み、かつ、属性デ
ータ「6」を含む輪郭線の場合はパリティ変化指示を行
わない。 (例外5)VerEdge「3」を奇数個含み、かつ、属性デ
ータ「6」を含む輪郭線の場合はパリティ変化指示を行
う。 (例外6)HorEdge「4」を奇数個含み、かつ、属性デ
ータ「6」を含む輪郭線の場合は、属性データ「6」が
偶数個の時パリティ変化指示を行い、奇数個の時パリテ
ィ変化指示を行わない。 しかして、前述した第6図に示すパリティ変化テーブル
および上記の例外規定に基づいてパリティを変化させ、
得られたパリティに基づいて塗り潰しを行えば、どのよ
うな形の輪郭線内部も誤りなく塗り潰すことができる。 次に、実際のパリティ検出処理の一例を説明する。ペー
ジメモリ10の各行について、まず、左端から例えば8デ
ータずつ順次属性データ読み出し、「0」→「1〜7」
の変化点および「1〜7」→「0」の変化点を検出して
輪郭線を検出する。次に、輪郭線内に含まれる各属性デ
ータについて、 「1」→「0」 「1」→「1」 「1」→「5」 「2」→「0」 の各変化の回数を検出し(第1の検出という)、また、
データ「3」,「4」,「6」の有無および「有」の場
合はその数が奇数であるか偶数であるかを検出する(第
2の検出という)。次に、上記の第2の検出結果から、
(例外1)〜(例外6)に該当するか否かをチェック
し、この結果および第1の検出の結果からパリティを決
定する。なお、上記第1,第2の検出およびパリティの決
定は簡単なハードウエアによって行うことができること
は言うまでもない。 次に、特殊な場合の塗り潰し例について説明する。 第8図に示す走査線Scが輪郭線の垂直頂点Pdを通過す
る場合 この場合、属性データは、同図に示すように頂点Pdに対
応する記憶位置において「3」となる。したがって、
(例外1)が適用され、この頂点Pdの左右においてパリ
ティの変化はない。この結果、頂点Pdの左側において塗
り潰しが行なわれていれば、右側でも塗り潰しが行なわ
れ、頂点Pdの左側において塗り潰しが行なわれていなけ
れば、右側でも塗り潰しが行なわれない。 水平線が重なった場合 第9図(イ)に示すように、文字フォントメモリ4内の
文字フォントの輪郭線ベクトルV2とV5が、非常に接近し
ている場合において、文字フォントの縮小が行なわれる
と、ベクトルV2,V5が重なってしまう。この場合、ペー
ジメモリ10の属性データの書き込みは次のようにして行
なわれる。すなわち、まず、ベクトルV1がピクセルに変
換され、各ピクセルに対応する記憶位置に第9図(ロ)
に示す属性データ「2」,「2」……が順次書き込ま
れ、次にベクトルV2に対応して属性データ「2」,
「2」……が順次書き込まれ、次にベクトルV3に対応し
て属性データ「3」,「1」,「1」……が書き込まれ
る。次に、ベクトルV4に対応して属性データ「1」,
「1」,「1」が書き込まれ、次いで属性データ「2」
が記憶位置Kaに書き込まれようとするが、この時、記憶
位置Kaには既に属性データ「2」が書き込まれており、
したがって、第4図の属性データテーブルに従い、記憶
位置Kaに属性データ「6」が書き込まれる。以下、同様
にしてベクトルV5,V6に対応する属性データの書き込み
が行なわれる。 次に、塗り潰し処理時においては、特に図に示す走査線
Scの走査時に、輪郭線として「2,6,6,6,3,2,3」になる
属性データが検出される。この場合、(例外4)の規定
が適用され、したがって、上記輪郭線においてパリティ
の変化はない。なお、従来のパリティチェック法によれ
ば、上記の輪郭線でパリティが変化し、したがって、第
16図において説明したように、同輪郭線の左側が塗り潰
しであれば、右側の塗り潰しは行なわれない。すなわ
ち、誤った塗り潰しとなってしまう。 縦線が複数重なった場合 第10図(イ)に示すように、縮小前の輪郭線がくし形を
していた場合において、縮小が行なわれない場合は、走
査線Scに対応するページメモリ10の記憶位置に、図に示
す6本の縦線に対応して、同図に示すように6個の属性
データ「1」が書き込まれる。これに対し、第10図
(ロ)に示すように、縮小が行なわれて6本の縦線が1
本に重なってしまった場合は、走査線Sc1と該縦線との
交点に対応する記憶位置Kbに次の属性データが書き込ま
れる。まず、最初の縦線がピクセルに変換され、各ピク
セルの属性データがページメモリ10に書き込まれる時、
記憶位置Kbに属性データ「1」が書き込まれる。次に、
第2番目の縦線がピクセルに変換されて書き込まれる
時、属性データ「1」が書き込まれようとするが、この
時、記憶位置Kbに既に属性データ「1」が書き込まれて
いるので、第4図の属性データテーブルに従い、記憶位
置Kbに属性データ「5」か書き込まれる。次に、第3番
目の縦線がピクセルに変換されて書き込まれる時も属性
データ「1」が書き込まれようとするが、この時、記憶
位置Kbに既に属性データ「5」が書き込まれているの
で、第4図の属性データテーブルに従い、記憶位置Kbに
属性データ「1」が書き込まれる。以下、同様の処理が
繰り返され、最終的に記憶位置Kbに属性データ「5」が
書き込まれる。 次に、塗り潰し時においては、走査線Sc1の走査時に記
憶位置Kbおよいその前後において、…「0」→「5」→
「0」…なる属性データが順次検出される、しかし、
「0」→「5」の変化、「5」→「0」の変化はいずれ
も第6図のパリティ変化テーブルを参照すると、パリテ
ィ変化指示が行なわれない。したがって、第10図(ロ)
のパターンの場合、記憶位置Kbの左側、右側とも塗り潰
しが行なわれる。なお、縮小前のパターンの縦線が第10
図(ハ)に示すように奇数の場合は、記憶位置Kbに最終
的に属性データ「1」が書き込まれる。この場合、塗り
潰し処理において、「0」→「1」の変化検出時にはパ
リティ変化指示が行なわれないが、「1」→「0」の変
化検出時にはパリティ変化指示が行なわれ、したがっ
て、記憶位置Kbの左側が塗り潰しの場合、右側は塗り潰
しが行なわれない。 以上がこの発明の一実施例の詳細である。この実施例に
よれば、DDA処理時において、同時にピクセルの属性デ
ータを求め、ページメモリ10に書き込む。この属性デー
タ書込処理において、ベクトルの傾き判別(|X|−|Y|)
はもともとDDA処理において行なわれる。したがって、
属性データ書き込みのために特に必要となる処理は、方
向判別および第4図の論理演算処理である。しかし、方
向判別はベクトルの始点および終点においてのみ行なわ
れる処理であり、しかも、単なる減算処理にすぎず、極
めて短時間で処理することができる。また、第4図の論
理演算処理もハードウエアで行えば、極めて短時間で行
えることは言うまでもない。したがって、属性データ書
込処理は、従来のDDA処理のための時間とほとんど変わ
ることがない。一方、塗り潰し時のパリティ検出も、ハ
ードウエアで行えば極めて短時間で行うことができる。 すかわち、この実施例によれば、極めて高速で塗り潰し
を行うことができ、文字フォントの塗り潰しを行った場
合は、例えば2000文字/秒の速度で塗り潰しを行うこと
も可能となる。 「発明の効果」 以上説明したように、この発明によれば、従来の方法で
は正確に塗り潰すことができなかった輪郭線の交差、重
なり、鋭角的な屈曲部などを含んだ全てのパターンを極
めて高速に、かつ、正確に塗り潰すことができる。この
結果、特に、印字システムにおける文字フォントの塗り
潰しに用いて好適である。[Details of Filling Processor 9] Next, details of the processing performed in the filling processor 9 will be described. (1) DDA processing This DDA processing is performed in the following process (see FIG. 3). The following calculation is performed to obtain the respective differences ΔX and ΔY of the X and Y coordinates. ΔX = X n −X 0 …… (1) ΔY = Y n −Y 0 …… (2) The difference of the coordinates is obtained by this calculation, and ΔX,
The direction of the vector V (X direction and Y direction) can be detected from the sign of ΔY. That is, △ X, △ Y
If both are positive, the direction of the vector V is positive in both the X and Y directions. If both ΔX and ΔY are negative, the direction of the vector V is X.
Direction, negative Y direction, if ΔX is positive, ΔY is negative, vector V direction is positive, X direction is positive, Y direction is negative, ΔX is negative, ΔY is positive, vector V direction Is negative in the X direction and positive in the Y direction. The difference D between the absolute values of the above differences ΔX and ΔY is calculated. D = | ΔX | − | ΔY | (3) From the sign of D obtained by this operation, it is determined in the vector V which direction, X or Y, is the major axis and which direction is the minor axis. Can be detected. Note that, hereinafter, when the X direction is the long axis (D> 0), it is called the X major, and when the Y direction is the long axis (D <0), it is called the Y major. The coordinate data of the pixels P 1 to P n-1 are obtained. -(1) When the vector V is the X major Yi = (ΔY / ΔX) (Xi−X 0 ) + Y 0 (4) In the formula, data (X 0 +1), which is stepwise incremented to Xi,
(X 0 +2), ... (X 0 + n-1) are sequentially substituted and data
Y 1 , Y 2 ... Y n-1 is calculated. The resulting coordinate data {(X 0 +1), Y 1 }, {(X 0 +2), Y 2 } ... {(X 0 +
n-1), Y n-1 } is the coordinate data of the pixels P 1 to P n-1 to be obtained. -(2) When the vector V is the Y major Xi = (ΔX / ΔY) (Yi−Y 0 ) + X 0 (5) In the formula, data (Y 0 +1), which is stepwise incremented to Yi,
By sequentially substituting (Y 0 +2), ... (Y 0 + n-1), the data X 1 , X 2 ... X n-1 wo are calculated, and the pixels P 1 to P 1
Obtain each coordinate data (Xi, Yi) of n-1 . (2) Address calculation of page memory 10 Coordinate data indicating the printing position of each character on the paper, in other words, the writing position of each character in the page memory 10, is output from the coordinate conversion processor 8. The coordinate data is the base point P 00 of the coordinates of the character shown in Figure 2. Now, assuming that this coordinate data is (P x , P y ), the page memory 10 of each pixel Pi (Xi, Yi) forming the outline of the character in FIG.
The position (address) at is (P x + Xi, P y + Yi). (3) Writing of Attribute Data to Page Memory 10 In this printing system, the attribute data (3 bits) of the pixel is written to each storage position of the page memory 10 corresponding to each pixel forming the contour line. . Here, the attribute data is (a) the inclination of the vector to which the pixel belongs, that is, whether the vector is the X major or the Y major, or (b) the X direction and the Y of the vector to which the pixel belongs.
Direction (c) Attribute data already written in the storage position of the page memory 10 corresponding to the pixel It is data determined based on the above three elements. The attribute data will be specifically described below with reference to FIG. FIG. 4 is an attribute data table. In this table, the column labeled "old" indicates the attribute data that has already been written, and the column labeled "new" indicates the attribute data that is about to be written. Ordinary outline pixel attribute data Vector V (character outline vector) shown in FIG. 3 is Y
In the case of the major (| X | <| Y |), the attribute data of the pixels P 0 to P n are all “1”, and the X major (| X |> | Y |)
If it is, all are “2”. Then, when the data is not written in the storage position corresponding to each of the pixels P 0 to P n of the page memory 10 (in the case of “0”), the above-mentioned attribute data “1” or “2” is the page memory. Ten
Is written as is. The attribute data of the connecting point pixel of each of the two vectors having different directions is obtained from the two vectors V1 and V2 shown in FIGS.
When they are connected in the order of V1 → V2, the end point of the vector V1 and the start point of the vector V2 are the same pixel. In this case, the attribute data of the connection point pixel Ps is as follows. (I) As shown in FIGS. 5 (a) and 5 (b), the vector V1
→ In V2, if the sign in the Y direction changes, it becomes “3”. Below, this case is referred to as VerEdge (Vertical E
dge). (Ii) As shown in FIGS. 5 (c) and 5 (d), when the sign in the X direction changes, the value is "4". Hereinafter, this case is referred to as Hor Edge (Horizontal Edge). (Iii) As shown in FIGS. 5 (e) and 5 (f), the X direction,
The case where there is no change in the Y direction is the same as the case where there is only the vector V2 (when there is no connection point). That is, in the case of FIG. 5 (e) (X major), it becomes "2", and in the case of (f) (Y major), it becomes "1". In addition, FIG.
As shown in (H), the X or Y direction of vector V2 is 0.
The same applies when (Iv) When the X direction or the Y direction changes from “0” to positive or negative like the vectors V1 and V2 shown in FIGS. 5 (i) and (nu), the vector V0 before the vector V1 is changed. It depends on the direction. That is, as shown in FIG. 5 (i), when there is no direction change in the vector V0 → V2, the above (ii)
i), and if there is a direction change in the vector V0 → V2 as shown in FIG.
Or (ii). Double or triple attribute data when attribute data has already been written to the storage location of the page memory 10. Attribute data at the time of writing Each character font in the character font memory 4 is of course designed so that outlines do not overlap. . Therefore, if the character size is the specified size or expansion, the page memory
There is no double writing within 10. However, when the character font is reduced, outlines often overlap, and therefore double writing often occurs, and sometimes triple writing, quadruple writing ... Occur. At the time of this double, triple ... writing, the attribute data to be written (attribute data determined by or above; see FIG. 4, “New” column) and already written attribute data (see FIG. 4, “old”). ) Column), the attribute data to be newly written is determined based on the attribute data table of FIG. For example, if the attribute data that has already been written is "2" and the attribute data that is about to be written is "2", then "6" is written. For example, the already written attribute data is "4", and If the attribute data to be written is "1", "5" is written. In the case of writing the attribute data at the starting point of the vector, the attribute data table is not applied and the above-mentioned rule is applied. The above is the details of the attribute data writing process. In an actual device, each of the above processes is performed on a pixel-by-pixel basis. That is, for example, in the processing of the vector V in FIG. 3, first, the attribute data of the pixel Pi (attribute data based on the inclination and direction of the vector V) is obtained, and then,
The address of the page memory 10 where the attribute data is written is obtained by the DDA process. Then, the address is output to the page memory 10. As a result, the attribute data (or data “0”) already written is read from the page memory 10. Next, a logical operation (logical operation based on the table of FIG. 4) is performed between the read attribute data and the attribute data to be written, and the result of this operation is written to the above address of the page memory 10. In this case, the read / write processing described above is performed in the well-known read modify write mode. Then, the above processing is sequentially performed for each pixel Pi forming the vector V. (4) Filling process When the writing of the attribute data to the page memory 10 is completed,
Next, this filling processing is performed. By this filling processing, the inside of the outline of the character is filled. Specifically, data (for example, “1”) is written in the storage position of the page memory 10 corresponding to each pixel inside the contour line. This filling process is basically the same as the filling process by the parity check method, and each storage position of the page memory 10 shown in FIG. 1 is sequentially scanned from the top row from left to right to obtain a contour line, that is, an attribute. When data is detected, the parity is changed based on the attribute data. Here, the parity is "1" → "0" → every time there is a change instruction.
It is data that alternates from “1” → ..., and is 1-bit data created by a trigger flip-flop. Then, when the scan passes through the contour line and reaches the area of the data “0”, if the parity at that time is “1”, the area is filled, and if the parity is “0”, the filling is not performed.
The above is the outline of the filling process. Next, the relationship between attribute data and parity will be described. Sixth
The figure shows the parity change table.
"t" indicates the left storage position of the two storage positions arranged side by side, and "Right" indicates the right storage position. Further, “1” indicates a parity change instruction, and the blank column indicates that the parity is not changed. Hereinafter, the filling process based on this table will be described with an example. FIG. 7A shows the contour line vector and the scanning line Sc,
(B) shows each storage position on the scanning line Sc. First,
Before the scanning of the scanning line Sc is started, the parity is reset to “0”. Next, when scanning (data reading) of storage positions K1 to K4 is performed and then data reading in storage position K5 is performed, attribute data "2" is read. In this case, the change is “0” → “2”, the parity change table of FIG. 6 is blank (see # 1), and the parity does not change. Next, the attribute data "2" in the storage location K6 is read. In this case, the change is “2” → “2”, the parity change table is blank (see # 2), and the parity does not change. Next, the attribute data “0” at the storage location K7 is read. In this case, "2" →
This is a change of "0", and the parity change table is "1".
(See # 3). Therefore, a parity change instruction is generated and the parity becomes "1". Further, in this case, since the data of the storage position is "0", it is determined whether or not the filling is performed. In this case, since the parity is "1", the data "1" is written in the storage position K7. Below, memory locations K8, K9, K10
The data in is read out sequentially, and since each data is "0", it is rewritten to "1" (that is, painting is performed). Next, the data in the storage locations K11, K12, K13 are read, the contour line is detected again, and the processing based on the parity change table is performed. And storage location K1
In the data processing of 3, the parity change instruction is generated again and the parity becomes “0”. As a result, subsequent memory locations
K13, K14 ... are not filled. In addition, the outline is rarely composed of 1 pixel,
As shown in FIG. 7 described above, it is often composed of a plurality of pixels. By the way, there is a case where the filling cannot be properly performed only by the processing based on the parity change table described above. Therefore, in this embodiment, the following exceptions are provided. (Exception 1) If the contour line includes VerEdge “3”, the parity change instruction is not issued. (Exception 2) In the case of a contour line including HorEdge “4”, a parity change instruction is given. (Exception 3) In the case of a contour line that does not include VerEdge “3” and HorEdge “4” and that includes attribute data “6”, the parity change instruction is not performed. (Exception 4) In the case of a contour line that includes an even number of VerEdge “3” and also includes attribute data “6”, the parity change instruction is not performed. (Exception 5) In the case of an outline including an odd number of VerEdge “3” and including attribute data “6”, a parity change instruction is given. (Exception 6) In the case of a contour line including an odd number of HorEdge “4” and an attribute data “6”, the parity change instruction is issued when the attribute data “6” is an even number, and the parity change is performed when the number is an odd number. Do not give instructions. Then, the parity is changed based on the parity change table shown in FIG. 6 and the exception rule described above,
If the filling is performed based on the obtained parity, the inside of the contour line of any shape can be filled without error. Next, an example of the actual parity detection process will be described. For each row of the page memory 10, first, for example, eight pieces of attribute data are sequentially read from the left end, and “0” → “1 to 7”.
And the change point of "1 to 7" → "0" are detected to detect the contour line. Next, for each attribute data included in the contour line, the number of times of each change of “1” → “0” “1” → “1” “1” → “5” “2” → “0” is detected. (Referred to as first detection)
Presence / absence of data “3”, “4”, “6” and, in the case of “present”, it is detected whether the number is odd or even (referred to as second detection). Next, from the above second detection result,
It is checked whether or not (Exception 1) to (Exception 6) are satisfied, and the parity is determined from this result and the result of the first detection. It goes without saying that the first and second detections and the determination of the parity can be performed by simple hardware. Next, an example of filling in a special case will be described. When the scanning line Sc shown in FIG. 8 passes through the vertical vertex Pd of the contour line In this case, the attribute data is “3” at the storage position corresponding to the vertex Pd as shown in FIG. Therefore,
(Exception 1) is applied, and there is no change in parity on the left and right of this vertex Pd. As a result, if the left side of the vertex Pd is filled, the right side is also filled, and if the left side of the vertex Pd is not filled, the right side is not filled. When Horizontal Lines Overlap As shown in FIG. 9A, when the character font outline vectors V2 and V5 in the character font memory 4 are very close to each other, when the character font is reduced. , Vectors V2 and V5 overlap. In this case, the writing of the attribute data in the page memory 10 is performed as follows. That is, first, the vector V1 is converted into a pixel, and the pixel is stored in the storage position corresponding to each pixel in FIG.
The attribute data “2”, “2”, ... shown in are written in sequence, and then the attribute data “2”, corresponding to the vector V2,
"2" ... Are sequentially written, and then attribute data "3", "1", "1" ... Are written corresponding to the vector V3. Next, the attribute data “1” corresponding to the vector V4,
"1" and "1" are written, then attribute data "2"
Is about to be written to the memory location Ka, but at this time, the attribute data “2” has already been written to the memory location Ka,
Therefore, the attribute data "6" is written in the storage location Ka according to the attribute data table of FIG. Thereafter, the attribute data corresponding to the vectors V5 and V6 are similarly written. Next, during the filling process, especially the scanning lines shown in the figure
At the time of scanning Sc, the attribute data of "2,6,6,6,3,2,3" as the contour line is detected. In this case, the definition of (Exception 4) applies, so there is no parity change in the contour. Note that according to the conventional parity check method, the parity changes at the above contour line, and therefore
As described with reference to FIG. 16, if the left side of the contour line is filled, the right side is not filled. In other words, it becomes an incorrect fill. When a plurality of vertical lines overlap As shown in Fig. 10 (a), when the contour line before reduction has a comb shape and no reduction is performed, the page memory 10 corresponding to the scanning line Sc As shown in the figure, 6 pieces of attribute data "1" are written in the storage positions corresponding to the 6 vertical lines shown in the figure. On the other hand, as shown in FIG. 10 (b), the six vertical lines are reduced by the reduction.
When it overlaps with the book, the next attribute data is written in the storage position Kb corresponding to the intersection of the scanning line Sc1 and the vertical line. First, when the first vertical line is converted to a pixel and the attribute data of each pixel is written to the page memory 10,
The attribute data “1” is written in the storage position Kb. next,
When the second vertical line is converted into pixels and written, the attribute data “1” is about to be written. At this time, however, since the attribute data “1” has already been written in the storage position Kb, According to the attribute data table of FIG. 4, the attribute data “5” is written in the storage position Kb. Next, when the third vertical line is converted into pixels and written, the attribute data “1” is about to be written, but at this time, the attribute data “5” has already been written in the storage position Kb. Therefore, the attribute data “1” is written in the storage position Kb according to the attribute data table of FIG. Thereafter, similar processing is repeated, and finally the attribute data “5” is written in the storage position Kb. Next, at the time of filling, the storage position Kb is good when scanning the scanning line Sc1, and before and after that ... “0” → “5” →
Attribute data of "0" ... is sequentially detected, but
As for the change of "0" → "5" and the change of "5" → "0", the parity change instruction is not issued by referring to the parity change table of FIG. Therefore, Fig. 10 (b)
In the case of the pattern, the filling is performed on both the left side and the right side of the storage position Kb. The vertical line of the pattern before reduction is the 10th
In the case of an odd number as shown in FIG. 3C, the attribute data “1” is finally written in the storage position Kb. In this case, in the filling process, the parity change instruction is not issued when the change of “0” → “1” is detected, but the parity change instruction is issued when the change of “1” → “0” is detected. If the left side of the is filled, the right side is not filled. The above is the details of the embodiment of the present invention. According to this embodiment, at the time of the DDA processing, the attribute data of the pixels are simultaneously obtained and written in the page memory 10. In this attribute data writing process, vector inclination determination (| X | − | Y |)
Originally performed in DDA processing. Therefore,
The processes particularly required for writing the attribute data are the direction determination and the logical operation process of FIG. However, the direction determination is a process performed only at the start point and the end point of the vector, and is merely a subtraction process, and can be processed in an extremely short time. Further, it goes without saying that the logical operation processing of FIG. 4 can be performed in an extremely short time if it is performed by hardware. Therefore, the attribute data writing process is almost the same as the time for the conventional DDA process. On the other hand, parity detection at the time of filling can also be performed in an extremely short time if performed by hardware. That is, according to this embodiment, it is possible to fill at an extremely high speed, and when the character font is filled, it is possible to fill at a speed of 2000 characters / sec. [Advantages of the Invention] As described above, according to the present invention, all patterns including contour line intersections, overlaps, sharp bends, and the like, which cannot be accurately filled by the conventional method, can be obtained. Filling can be performed extremely quickly and accurately. As a result, it is particularly suitable for filling character fonts in a printing system.
第1図はこの発明の一実施例による印字システムの構成
を示すブロック図、第2図は文字フォントの一例を示す
図、第3図は文字フォントを構成するベクトルおよび該
ベクトルに対応するピクセル列を示す図、第4図は属性
データ書込時に使用される属性データテーブルを示す
図、第5図は2つのベクトルの接続点におけるピクセル
の属性データを説明するための図、第6図は塗り潰し処
理において使用されるパリティ変化テーブルを示す図、
第7図〜第10図は各々塗り潰し処理の具体例を説明する
ための図、第11図〜第17図は各々従来の塗り潰し法およ
びその問題点を説明するための図である。 1……CPU、2……ROM、3……RAM、4……文字フォン
トメモリ、9……塗り潰しプロセッサ、10……ページメ
モリ。FIG. 1 is a block diagram showing a configuration of a printing system according to an embodiment of the present invention, FIG. 2 is a diagram showing an example of a character font, and FIG. 3 is a vector constituting a character font and a pixel string corresponding to the vector. FIG. 4, FIG. 4 is a diagram showing an attribute data table used when writing attribute data, FIG. 5 is a diagram for explaining attribute data of pixels at connection points of two vectors, and FIG. 6 is painting. A diagram showing a parity change table used in processing,
FIG. 7 to FIG. 10 are diagrams for explaining specific examples of the filling process, and FIGS. 11 to 17 are diagrams for explaining the conventional filling method and its problems. 1 ... CPU, 2 ... ROM, 3 ... RAM, 4 ... Character font memory, 9 ... Fill processor, 10 ... Page memory.
Claims (1)
ータに変換して画像メモリに書き込み、該ピクセルデー
タによって囲まれる前記画像メモリの内部をピクセルデ
ータによって塗り潰す閉曲線内の塗り潰し方法におい
て、前記ベクトルデータをDDA処理によってピクセルデ
ータに変換すると同時に、前記ベクトルが持つ属性に対
応する属性データを、前記DDA処理から得られるベクト
ルの傾き、および前記ベクトルの方向および該属性デー
タを書き込むべきメモリ位置に既に書き込まれている属
性データに基づいて論理演算し、これによって得られた
属性データを前記ピクセルデータと共に前記画像メモリ
に書き込み、次に、このピクセルデータおよび属性デー
タが書き込まれた画像メモリを走査して該画像メモリ内
の前記属性データを検出し、この検出した属性データの
値に基づいて塗り潰し位置を決定することを特徴とする
閉曲線内の塗り潰し方法。1. A method of filling a closed curve within a closed curve, wherein vector data representing a contour line is converted into pixel data, written into an image memory, and the inside of the image memory surrounded by the pixel data is filled with the pixel data. Is converted to pixel data by DDA processing, and at the same time, the attribute data corresponding to the attribute of the vector is already written to the inclination of the vector obtained from the DDA processing, the direction of the vector, and the memory location where the attribute data should be written. Logical operation is performed based on the attribute data stored therein, the attribute data obtained thereby is written in the image memory together with the pixel data, and then the image memory in which the pixel data and the attribute data are written is scanned to obtain the attribute data. Detects the attribute data in the image memory The method fills the closed curve, characterized by determining a position filled based on the value of the detected attribute data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63278299A JPH0749222B2 (en) | 1988-11-02 | 1988-11-02 | Filling method inside closed curve |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63278299A JPH0749222B2 (en) | 1988-11-02 | 1988-11-02 | Filling method inside closed curve |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH02122956A JPH02122956A (en) | 1990-05-10 |
JPH0749222B2 true JPH0749222B2 (en) | 1995-05-31 |
Family
ID=17595416
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63278299A Expired - Fee Related JPH0749222B2 (en) | 1988-11-02 | 1988-11-02 | Filling method inside closed curve |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0749222B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62272295A (en) * | 1986-05-20 | 1987-11-26 | 富士通株式会社 | Expansion/reduction system of character pattern with line width control function |
JPS63223984A (en) * | 1987-03-13 | 1988-09-19 | Alps Electric Co Ltd | Painting-out system for overlapping graphic |
JPH01228074A (en) * | 1988-03-08 | 1989-09-12 | Matsushita Electric Ind Co Ltd | Method and device for picture painting out |
-
1988
- 1988-11-02 JP JP63278299A patent/JPH0749222B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH02122956A (en) | 1990-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH059834B2 (en) | ||
KR970008546B1 (en) | Character or graphic processing method | |
JP3145509B2 (en) | Character generation method and device | |
US20050162430A1 (en) | Using externally parameterizeable constraints in a font-hinting language to synthesize font variants | |
JP3238580B2 (en) | Thicker text generator | |
JP3037854B2 (en) | Character generation method and device | |
JPH06328785A (en) | Method and apparatus for forming character | |
JPH0749222B2 (en) | Filling method inside closed curve | |
JP3034140B2 (en) | Character generation method and device | |
KR100223496B1 (en) | Character generating apparatus and method | |
JPH06175639A (en) | Method and device for character generation | |
JP3129717B2 (en) | Image processing apparatus and image processing method | |
JP2637921B2 (en) | Character symbol generator | |
JP2675363B2 (en) | Character processor | |
JP3294249B2 (en) | Image processing device | |
JP2896097B2 (en) | Method and apparatus for filling outline font in which characters are configured for each element | |
JP2737845B2 (en) | Character processing method and apparatus | |
JP3347756B2 (en) | Character generation method and device | |
JP2634906B2 (en) | Image processing method | |
JP2965429B2 (en) | Character output device | |
JP4080470B2 (en) | Character pattern generator | |
JP2835056B2 (en) | High quality character pattern generation method | |
JPH0127469B2 (en) | ||
JPH08241308A (en) | Method and device for image processing | |
JPH05216969A (en) | Graphic processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313532 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |