JP3560310B2 - Apparatus and method for changing contour data - Google Patents

Apparatus and method for changing contour data Download PDF

Info

Publication number
JP3560310B2
JP3560310B2 JP26173997A JP26173997A JP3560310B2 JP 3560310 B2 JP3560310 B2 JP 3560310B2 JP 26173997 A JP26173997 A JP 26173997A JP 26173997 A JP26173997 A JP 26173997A JP 3560310 B2 JP3560310 B2 JP 3560310B2
Authority
JP
Japan
Prior art keywords
curve
line segment
contour
data
intersection
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
Application number
JP26173997A
Other languages
Japanese (ja)
Other versions
JPH11102176A (en
Inventor
政幸 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP26173997A priority Critical patent/JP3560310B2/en
Publication of JPH11102176A publication Critical patent/JPH11102176A/en
Application granted granted Critical
Publication of JP3560310B2 publication Critical patent/JP3560310B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は輪郭データ変更装置および方法に関し、特に、曲線を含む文字や図形データにおいて交差を許すストローク単位のアウトライン型の座標データから交差を許さない全輪郭データへ変更し、処理するための文字・図形データを発生させる輪郭データ変更装置および方法に関する。
【0002】
【従来の技術】
従来は、本出願人による特許出願(特願平8−269844号および特願平8−351567号)の明細書に記載されているように、ストロークとストロークの交差を発見するために「線分+曲線」のデータのうち曲線データをショートベクトル化して、全てのデータをいったん線分データ化していた。
【0003】
【発明が解決しようとする課題】
しかしながら、上記のような従来の技術の場合、はじめに全ての曲線データをショートベクトルの集合に変換した後に交差判定を行っていたため、線分の数が膨大となってしまい、一対一で検索する方法では、検索数が大きいため、その処理時間がかかってしまうという問題点があった。
【0004】
そこで、本発明は上述の点に鑑みて成されたもので、上記の課題を解決した輪郭データ変更装置および方法を提供することを目的とする。
【0005】
【課題を解決するための手段】
上記目的を達成するために、請求項1に記載の本発明の装置では、線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差する輪郭データを、線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差しない輪郭データに変更する輪郭データ変更装置であって、基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定する領域判定手段と、前記領域判定手段により交差があると判定された場合、曲線を線分の集合に変換する変換手段と、線分どうしに交点があるか調べ、交点があると判定された場合、交点を元に線分の連結を変更する変更手段とを有することを特徴とする。
【0006】
ここで、請求項2に記載の本発明の装置では、基準側の線分または曲線の点列を取出す第1取出し手段と、前記第1取出し手段により取出した基準側の線分または曲線の点列の領域をチェックする第1チェック手段と、対象側の線分または曲線の点列を取出す第2取出し手段と、前記第2取出し手段により取出した対象側の線分または曲線の点列の領域をチェックする第2チェック手段とを有し、前記領域判定手段は、前記第1チェック手段と前記第2チェック手段とのチェックに基づき基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定することもできる。
【0007】
ここで、請求項3に記載の本発明の装置では、基準輪郭データと対象輪郭データと交差しているか判定する交差判定手段を有し、前記交差判定手段により交差していると判定された場合、前記領域判定手段による判定を行うこともできる。
【0008】
ここで、請求項4に記載の本発明の装置では、前記変更手段により変更されなかった曲線を抽出する抽出手段と、前記抽出手段により抽出された曲線を曲線線分変換する処理手段とを有することもできる。
【0009】
ここで、請求項5に記載の本発明の装置では、前記交差する輪郭データは輪郭型のデータとすることもできる。
【0010】
ここで、請求項6に記載の本発明の装置では、前記交差する輪郭データは芯線+太さ型のデータから変換された輪郭型のデータとすることもできる。
【0011】
ここで、請求項7に記載の本発明の装置では、前記変更手段により連結が変更された線分に基づく文字または図形を表示する表示手段を有することもできる。
【0012】
ここで、請求項8に記載の本発明の装置では、前記変更手段により連結が変更された線分に基づく文字または図形を印刷する印刷手段を有することもできる。
【0013】
上記目的を達成するために、請求項9に記載の本発明の方法では、線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差する輪郭データを、線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差しない輪郭データに変更するコンピュータで実行される輪郭データ変更方法であって、基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定する領域判定ステップと、前記領域判定ステップにおいて交差があると判定された場合、曲線を線分の集合に変換する変換ステップと、線分どうしに交点があるか調べ、交点があると判定された場合、交点を元に線分の連結を変更する変更ステップとを有することを特徴とする。
【0014】
ここで、請求項10に記載の本発明の方法では、基準側の線分または曲線の点列を取出す第1取出しステップと、前記第1取出しステップにおいて取出した基準側の線分または曲線の点列の領域をチェックする第1チェックステップと、対象側の線分または曲線の点列を取出す第2取出しステップと、前記第2取出しステップにおいて取出した対象側の線分または曲線の点列の領域をチェックする第2チェックステップとを有し、前記領域判定ステップは、前記第1チェックステップと第2チェックステップとのチェックに基づき基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定することもできる。
【0015】
ここで、請求項11に記載の本発明の方法では、基準輪郭データと対象輪郭データと交差しているか判定する交差判定ステップを有し、前記交差判定ステップにおいて交差していると判定された場合、前記領域判定ステップによる判定を行うこともできる。
【0016】
ここで、請求項12に記載の本発明の方法では、前記変更ステップにおいて変更されなかった曲線を抽出する抽出ステップと、前記抽出ステップにおいて抽出された曲線を曲線線分変換する処理ステップとを有することもできる。
【0017】
ここで、請求項13に記載の本発明の方法では、前記交差する輪郭データは輪郭型のデータとすることもできる。
【0018】
ここで、請求項14に記載の本発明の方法では、前記交差する輪郭データは芯線+太さ型のデータから変換された輪郭型のデータとすることもできる。
【0019】
ここで、請求項15に記載の本発明の方法では、前記変更ステップにおいて連結が変更された線分に基づく文字または図形をディスプレイに表示する表示ステップを有することもできる。
【0020】
ここで、請求項16に記載の本発明の方法では、前記変更ステップにおいて連結が変更された線分に基づく文字または図形をプリンタにより印刷する印刷ステップを有することもできる。
【0025】
【発明の実施の形態】
以下、図面を参照しながら本発明の実施の形態を詳細に説明する。
【0026】
(第1実施の形態)
図1は本発明を適用した情報処理システムの基本的な構成を示す。本システムは日本語ワードプロセッサであってもよいし、ワークステーションあるいはパーソナルコンピュータ等のシステムであってもよい。図1において1はCPU、すなわち中央処理装置であり、この装置全体の制御および演算処理等を行う。
【0027】
2はROM、すなわち読み出し専用メモリであり、システム起動プログラムおよび文字パターン・データ等を記憶する。
【0028】
3はRAM、すなわちランダムアクセスメモリであり、CPU1が演算に使用するデータ、CPU1の演算結果を一時記憶する。
【0029】
4はKBC、すなわち入力装置を制御するキーボード制御部であり、キーボード(KB)5よりキー入力データ(文字コードや制御コード)を受け取りCPU1へ伝達する。入力装置としては、ポインティングデバイスも使用される。
【0030】
6はCRTC、すなわちディスプレイ制御部であり、RAM3に格納された表示情報、すなわち、文字コードから変換されたビットマップイメージを読み出し、ディスプレイ装置(CRT)7に転送する。
【0031】
出力装置であるディスプレイ装置7は、ディスプレイ制御部6から転送されたビットマップイメージを受け取り表示画面に表示する。
【0032】
8はDKC、すなわちディスク制御部であり、外部記憶装置9のデータ伝送等の制御を行う。外部記憶装置9は、FD、すなわちフロッピー(登録商標)ディスク装置、HD、すなわちハードディスク装置、あるいはCD−ROM等を含んで構成される。外部記憶装置9にはプログラムおよびデータを記憶させておき、CPU1は必要に応じて記憶データを参照したり、またはRAM3にロードする。
【0033】
10はPRTC、すなわちプリンタ制御部であり、PRT、すなわち出力装置であるプリンタ装置11の動作制御を行う。
【0034】
12はシステムバスであり、上述の構成要素間のデータ転送を行う。
【0035】
図2は、図1のシステム構成からなる本発明装置の全体の処理におけるメモリ構成を示した図である。
【0036】
図2で示したように、本装置の全体処理に必要なメモリ構成は、基本I/Oプログラム20、オペレーティングシステム21、アプリケーション22、関連データ23およびワークエリア24からなる。本装置は、これらのうち基本I/Oプログラム20、ウインドウズ(マイクロソフト社登録商標)システム等のオペレーティングシステム21、および本発明方法の処理である文字発生処理プログラムを含むアプリケーション22が実行されることにより動作する。
【0037】
なお、図2においてオペレーティングシステム21は、ウインドウズシステム等のオペレーティングシステムがRAM3にロードされ実行可能となった状態を示している。
【0038】
また、アプリケーション22は、本発明の文字処理プログラムがRAM3にロードされ実行可能となった状態のメモリマップを示し、関連データ23は関連データがRAM3にロードされ実行可能となった状態のメモリマップを示している。ワークエリア24は、各々のプログラムが使用するワークメモリのメモリマップを示す。
【0039】
また、図2に示した基本I/Oプログラム20は、図1のROM2に格納されている。オペレーティングシステム21は、図1に示したHD等の外部記憶装置9に格納されている。そして電源がONされたときに、基本I/Oプログラム20中のIPL(イニシャライズプログラムローディング)機能によりHDからオペレーティングシステムがRAM3に読み込まれ、本装置が起動する。
【0040】
ここで、図3に文字発生処理プログラムおよび関連データを記録したFD,CD−ROM等における記録媒体の記録内容の構成例を示す。
【0041】
図3に示したように、FD,CD−ROM等の記録媒体は、ボリューム情報31、ディレクトリ情報32、文字発生処理プログラム実行ファイル33および文字発生処理プログラム関連データファイル34等の記録内容30で構成される。
【0042】
本発明のプログラムおよび関連データは、たとえば図4に示すように、FDあるいはCD−ROM等の装置に着脱自在な記録媒体43を、装置本体41に装備された記録媒体挿入口42に挿入することで供給される。そして、FDあるいはCD−ROMからのプログラムおよび関連データを一旦HDへインストールすることにより、HDからRAM3にロードし、本発明のプログラムを実行することが可能となる。なお、HDへインストールせずにFDあるいはCD−ROMからRAM3に直接ロードして実行することも可能である。
【0043】
図5は本発明にかかる文字処理装置を適用可能な別のシステムの制御構成を示すブロック図である。
【0044】
なお、本システムはレーザビームプリンタであってもよいし、インクジェットプリンタあるいは熱転写方式等の出力機であってもよい。図5において、51はCPU、すなわち中央処理装置であり、この装置全体の制御および演算処理等を行うものである。
【0045】
52はROM、すなわち読み出し専用メモリであり、システム起動プログラムおよび文字パターン・データ等の記憶領域である。53はRAM、すなわちランダムアクセスメモリであり、さまざまな処理毎に各々のプログラムおよびデータがロードされ実行される領域である。
【0046】
510はPRTC、すなわちプリンタ制御部であり、511はPRT、すなわちプリンタ装置である。512はシステムバスであり、上述における構成要素間のデータの通路となるべきものである。
【0047】
ここで、上記構成の装置を利用した本発明方法の詳細について図6のフローチャートを参照して説明する。
【0048】
まず、図6におけるフローチャートのインターフェイスとして文字コード、出力装置に出力するときの出力サイズ、書体、変形情報等が渡される。そして、ステップS101において文字コード、書体から対象となる文字のデータを読み込む。このとき読み込むデータはストローク単位で登録された文字データであり、図7に示すようなそれぞれのストロークが芯線+太さ型のデータであってもよいし、図8に示すようにそれぞれのストロークが輪郭型のデータであってもよい。
【0049】
そして、ゲットしたデータが図7に示すような芯線+太さ型のデータであれば、芯線+太さ型のデータから図8に示すような1ストローク単位のアウトライン座標に変換する。
【0050】
そしてステップS102において、あらかじめROM2,52あるいはHD等の外部記憶装置9に格納されたデータが持つ文字の幅と高さと、インターフェイスで要求された出力サイズから、拡大縮小処理や変形処理等の座標変換を行って、読み込んだ文字の輪郭データを発生する。
【0051】
ステップS103においては、1文字分の全てのストロークについて輪郭データ発生が終了したかどうかを判定する。1文字分の全てのストロークに対して座標変換を終了したらステップS104へ進み、まだ処理すべきストロークが存在していればステップS102へ戻って、ステップS102,S103を繰り返し行う。
【0052】
ステップS104では、ベジェ曲線やBスプライン曲線で定義されている点列と、線分として登録された点列の座標データを輪郭の順序を守るようにして登録する。
【0053】
図9は登録された座標列の様子を示す説明図である。
【0054】
図9(a)は、輪郭に点A〜Hを含むストローク91と輪郭に点I〜Lを含むストローク92で構成される「ナ」の例を示す。この図および以下の図において、△(白抜き三角印)は曲線の中間点、○(白抜き丸印)はその他の点を表す。
【0055】
登録内容は図9(b)の輪郭データ管理情報部に、1輪郭毎のデータ910,920として登録される。この輪郭データのメンバとしては、各輪郭の回転方向(左回り、右回り)、スタート点番号、エンド点(終了点)番号、輪郭データの最大座標値、最小座標値が格納される。この最大座標値はストロークの最大x座標と最大y座標で、最小座標値はストロークの最小x座標と最小y座標である。
【0056】
そして実際には、図9(c)の輪郭座標データテーブルに輪郭情報が格納されている。この輪郭座標データテーブルには、輪郭データ管理情報部によって示されたスタート点番号からエンド点番号までの輪郭における点について、その座標値、点属性フラグ、一つ前の点番号、次の点番号が格納される。ここで点属性フラグには、曲線のスタート点であれば1を、曲線の中間点であれば2を、曲線のエンド点であれば3を付ける。そして、直線上の点等のその他の点のフラグの値には0を付ける。
【0057】
したがって、図9(a)のストローク91の曲線部分のスタート点Bには1が、中間点C,Dには2が、エンド点Eには3が付けられている。ここではストローク92は直線であり、このすべての点I〜Lに0が付けられている。また、前の点番号と次の点番号の値から、ストローク91の輪郭はABCDEFGHAの順に、IJKLIの順に登録されていることがわかる。
【0058】
図6に戻って説明すると、ステップS105以降では、ステップS104までの処理で登録したストロークの輪郭データをチェックして、お互いの輪郭が交差していれば繋ぎ替えて新たな線分の集合で輪郭を発生させる処理を行う。
【0059】
ステップS105においては、まず図9で示したように登録された最初の輪郭データを基準輪郭データとしてセットする。
【0060】
ステップS106においては、ステップS105でセットした基準輪郭データの次の輪郭データを対象輪郭データとしてセットする。以上により、1つの文字の2つのストロークが抽出されたことになる。
【0061】
ステップS107においては、基準輪郭データと対象輪郭データが交差しているかどうかの交差判定を行う。ここでの判定方法は、図9で示した各輪郭の情報から、基準輪郭データの最大座標値および最小座標値と対象輪郭データの最大座標値および最小座標値をチェックし、重なっているかどうかを判定するものである。重なっていたら交差ありと判定し、ステップS108へ進む。重なっていなかったら交差なしと判定し、ステップS110へ進む。
【0062】
ステップS108においては基準輪郭データと対象輪郭データの交差する線分を検索し、交差がある場合には曲線を線分の集合に変換して線分の交点座標を算出し、この交点座標に基づき輪郭を繋ぎ替える連結変更処理を行う。この連結変更処理の詳細については、後で図14乃至図15のフローチャートを参照して詳述する。
【0063】
そしてステップS109においては、ステップS108において連結を変更したことによって消滅した輪郭の登録削除や、新たに発生した輪郭の登録追加等の新しい輪郭データ登録処理を行う。
【0064】
ステップS110においては、次の対象輪郭データの候補を検索する。検索の方法としては、輪郭情報データ管理部において、ステップS109で対象としていた対象輪郭データの後に別の輪郭データが存在するかどうかをチェックする。検索の結果まだ存在する場合は、ステップS111において対象輪郭データは終了していないと判断し、ステップS112へ進む。検索の結果もう対象輪郭データが存在しない場合には、ステップS111において対象輪郭データは終了したと判断し、ステップS113に進む。
【0065】
ステップS112においては、ステップS110において検索した対象輪郭データを次の新たなチェックすべき輪郭データとして登録する。次の対象輪郭データを登録するとステップS107に戻り、基準輪郭データとの交差をチェックし、交差が存在すれば輪郭の繋ぎを変更する連結変更処理を行う。
【0066】
ステップS113に進むと、これまでの処理で1つの基準輪郭データに対して処理を終了したことになるので、次の新たな基準輪郭データを検索する。検索方法としては、ステップS112までに対象としていた基準輪郭データの次のデータが存在するかどうかをチェックする。この結果、存在していればステップS114において基準データとなり得る輪郭はまだ存在すると判断しステップS115へ進む。しかし、基準輪郭データとなるべき輪郭が存在しない場合には、ステップS114で基準輪郭データはもう存在しないと判断し、ステップS116へ進む。
【0067】
ところで、ステップS110やステップS113において対象輪郭データや基準輪郭データを検索する際には、輪郭情報データ管理部のスタート点およびエンド点の点番号を調べて、スタート点およびエンド点の値が「−1」になっていなければまだ存在すると判断する。「−1」となっていた場合には、消滅した輪郭データと判断し、次の輪郭データを検索しにいく。
【0068】
ステップS115においては、ステップS113において検索した基準輪郭データを次の新たなチェックすべき基準輪郭データとして登録する。次の基準輪郭データを登録すると、ステップS106に戻って対象輪郭データとの交差をチェックし、交差が存在すれば輪郭の繋ぎを変更するステップS107以降の処理を行う。すなわち、登録された1文字分のすべてのストロークからストロークを2つずつ抽出して、抽出された各ストローク対に対して交差判定等の処理を行う。
【0069】
そして、ステップS116においては、これまでに求めた輪郭データを交差を許さない全輪郭データとして出力する。このとき、輪郭データ管理情報部に登録された全ての輪郭データを出力するわけではなく必要とされる輪郭データの抽出を行う。さらに、線分への変換を1文字について漏れなく行うために必要とされるデータ、つまり、ステップS108の連結変更処理を行っても変換されなかった曲線データを検索し抽出する。上記のように生成出力されたデータに基づいて、ディスプレイ制御部6の制御によってディスプレイ7の表示画面に文字(および/または図形)パターンを表示出力する。また、プリンタ制御部10,510の制御によってプリンタ装置11,511が文字(および/または図形)パターンのプリント出力を行う。
【0070】
必要な輪郭データの抽出においては、たとえば図10(a)に示すストローク101〜104で構成される図形の例では、最初の輪郭数は4である。そして、この図10(b)の輪郭データ110,120,130,140を上記アルゴリズムで処理すると、輪郭データ管理情報部には最終的に図11に示す輪郭データが得られ、このデータが表す輪郭は図12が示すとおりになる。処理結果がこのようになることは、ステップS108の連結変更についての詳細な説明を参照すると容易に理解できる。
【0071】
図11において、輪郭データ110a,120a,130a,140aは輪郭データ110,120,130,140が更新登録されたものであり、輪郭データ150〜190は新たに登録されたものである。輪郭データ120a,130a,140aのスタート点およびエンド点の値は「−1」であり、輪郭データとしては消滅したものになっている。輪郭データ110aは図12の輪郭101aを、輪郭データ150〜190はそれぞれ輪郭105〜109を表す。
【0072】
この例の場合、最初の輪郭数が4であるので、それよりも小さいところに登録されていて輪郭の回転方向が逆転していないのは輪郭データ110aが表す最初の輪郭のみである。また、最初の輪郭数4よりも多いところに登録されていて輪郭の回転方向が左回りに逆転しているのは輪郭データ190が表す最後の輪郭のみである。したがって、この2つの輪郭101a,109のみを抽出して最終的に登録することによって、図13のような輪郭の交差を許さない全輪郭データを発生させることが可能となる。
【0073】
ところで、上記の処理中にステップS108の段階で曲線に他の線分領域または曲線領域との交差があったと判定された場合には既に曲線から線分変換されているが、曲線に当該交差がなかった場合には、最後に曲線線分変換をする必要がある。そこで抽出された輪郭データに登録されていた全ての点属性の検索を行う。輪郭のスタート点から順に「次」の連結点をチェックしていき、点属性1(曲線開始点)がないかどうかをチェックする。点属性1があった場合には、その後に現れる点属性3(曲線終了点)の点までが曲線データであると登録する。この曲線検索を登録されている輪郭データの全ての点に対して行う。そしてステップS117では、ステップS116において抽出された曲線データがあれば、この曲線データを曲線線分変換する処理を行って全体の処理を終了する。ステップS117における処理は、後に図14乃至図15のフローチャートを参照して説明する処理と同様である。
【0074】
このようにして、輪郭の交点を検索し、お互いの輪郭の連結を変更し、最後に必要なデータのみを抽出してさらに曲線線分変換することで、1文字のすべてのストロークに対して交差を許す輪郭データから交差を許さない全輪郭データの発生を行うことが可能となる。
【0075】
ここで、図6におけるステップS108の連結変更の詳細について図14乃至図15のフローチャートを参照して説明する。
【0076】
まずステップS201においては、基準輪郭側の線分か曲線かの点列を取り出すための判定を行う。ここでは図9(c)の輪郭座標データテーブルで示した点属性を見て、その属性の値が0であれば曲線ではなく線分であると判定してステップS202へ進み、属性の値が1であれば曲線であると判定してステップS204へ進む。
【0077】
ステップS202においては、現在の点とその次の点を取り出すことによって線分データの取り出し、すなわち直線点列の取り出しを行う。
【0078】
そしてステップS203においては、取り出した直線点列の領域をチェックする。つまり、取り出した線分データのx座標およびy座標をチェックし、その線分が含まれる範囲の最大座標値および最小座標値を格納することによって、その線分の領域とする。
【0079】
またステップS204においては、現在の点属性1の点から点属性が2である点を順次読み込み、点属性が3になる点まで読み込むことで曲線点列の取り出しを行う。
【0080】
そしてステップS205においては、取り出した曲線点列の領域をチェックする。つまり、読み込んた点すべてのx座標およびy座標を調べ、それぞれの座標の最小値および最大値を格納することによって、その曲線が含まれる領域とする。ここまでで、線分部分、曲線部分がそれぞれ1つの領域として算出される。
【0081】
以上の処理を基準輪郭データ側で行うと、同様の処理を続いて対象輪郭データ側でも行うことにより、その線分部分、曲線部分をそれぞれ1つの領域として算出する。具体的には、ステップS206ないしS210の処理を行う。
【0082】
ステップS206においては、対象輪郭側の線分か曲線かの点列を取り出すための判定を行う。ここでは図9の輪郭座標データテーブルで示した点属性を見て、その属性の値が0であれば曲線ではなく線分であると判定してステップS207へ進み、属性の値が1であれば曲線であると判定してステップS209へ進む。
【0083】
ステップS207においては、現在の点とその次の点を取り出すことによって線分データの取り出し、すなわち直線点列の取り出しを行う。
【0084】
そしてステップS208においては、取り出した直線点列の領域をチェックする。つまり、取り出した線分データのx座標およびy座標をチェックし、その線分が含まれる範囲の最大座標値および最小座標値を格納することによって、その線分の領域とする。
【0085】
ステップS209においては、現在の点属性1の点から点属性が2である点を順次読み込み、点属性が3になる点まで読み込むことで曲線点列の取り出しを行う。
【0086】
そしてステップS210においては、取り出した曲線点列の領域をチェックする。つまり、読み込んた点すべてのx座標およびy座標を調べ、それぞれの座標の最小値および最大値を格納することによって、その曲線が含まれる領域とする。
【0087】
基準輪郭側および対象輪郭側について領域を算出すると図15のステップS211においては、基準輪郭側で算出した線分または曲線の領域と、対象輪郭側で算出した線分または曲線の領域に交差があるかどうかの交差判定(他の交差判定)を行う。ここでは、それぞれ算出した領域のx座標およびy座標の最小値と最大値を調べ、領域が重なる部分があるかどうかをチェックする。この結果、重なる部分がある場合は交差があると判断し、ステップS212へ進む。一方、重なる部分がない場合は交差がないと判断し、ステップS219へ進む。
【0088】
図16は線分領域と曲線領域の交差判定の様子を示す説明図である。
【0089】
図16(a)は線分領域1600と曲線領域1610に実際に交差がある場合を示す。図16(b)は線分領域1600と曲線領域1610に実際には交差はないが、領域として判断すると交差があると判断される場合を示す。ここでは、曲線1610が含まれる破線で示す範囲1620と線分領域1600が交差している。図16(c)は線分領域1600と曲線領域1610に実際に交差もないし、領域として判定した場合にも交差がない場合をそれぞれ示す。ここでは、曲線1610が含まれる破線で示す範囲1620と線分領域1600は交差していない。
【0090】
したがって、ステップS211による判定処理を行うと、図16(a)および(b)の場合には交差があると判定してステップS212へ進み、図16(c)の場合には領域に交差がないと判定してステップS219へ進む。線分領域と線分領域との判定、および曲線領域と曲線領域との判定も、このように同様な方法で行う。
【0091】
領域に交差があるときにステップS212においては、基準輪郭側で取り出したデータが曲線かを判定し、曲線ではなく線分であればステップS214へ進み、曲線であればステップS213へ進む。
【0092】
ステップS213では、曲線のデータを短い線分の集合(ショートベクトル)に変換する。ここで扱う曲線は、内包性の特性(制御点の最小値、最大値の領域を超えない)を持つベジェ曲線であってもBスプライン曲線であってもよい。そして、規則にしたがってベジェ分解またはBスプライン展開を行い、曲線をショートベクトル化する。
【0093】
図17は図9(a)で示した曲線の制御点のレベルの文字から曲線分解してショートベクトル化(線分変換)した文字の点列を示す説明図である。ここで、171と172は図9中のストローク91,92の曲線領域であり、これについては以下に詳しく説明する。
【0094】
図18は変換された線分の座標列の様子を示す説明図である。
【0095】
輪郭データ管理情報部には、図9(b)の場合と同様に1輪郭毎のデータ1710,1720として登録されているが、輪郭座標データテーブルの内容は図9(c)の場合とは異なる。
【0096】
すなわち、輪郭座標データテーブルには、図18(c)のように新たに点番号14以降の点の線分のデータが加わり、元の点の点属性、繋ぎ情報(前の点番号、次の点番号)も更新される。点A,B,E,Fは曲線の端点となるので、点属性フラグは0となる。追加された点によって点B,Fの次の点、点A,Eの前の点が変わるので、これらの繋ぎ情報が更新される。図18(c)の前の点番号と次の点番号の値から、ストローク91の輪郭情報は、連続する線分AB,線分Ba,線分ab,線分bc,線分cd,線分dE,線分EF,線分Fe,線分ef,線分fg,線分gh,線分hAの集合に変換されて登録されていることがわかる。つまり、曲線が線分に変化されている。またストローク92の輪郭情報は、連続する線分IJ、線分JK、線分KL、線分LIの集合に変換されて登録されていることがわかる。
【0097】
図15に戻って説明すると、ステップS214においては対象輪郭側で取り出したデータが曲線かを判定し、曲線ではなく線分であればステップS216へ進み、曲線であればステップS215へ進む。
【0098】
ステップS215では、ステップS213と同様にして曲線のデータを短い線分の集合に変換(ショートベクトル化)する。
【0099】
ステップS216においては、基準側の線分またはショートベクトル群と、対象側の線分またはショートベクトル群と実際に交差があるかどうかをチェックする。線分どうしの場合は、お互いの線分の領域内に交点があるかどうかを調べ、ある場合にはその交点を求める。線分のショートベクトル群の場合には、線分に対して全てのショートベクトルと交点があるかどうかを調べ、ある場合にはその線分と交点の登録行う。ショートベクトル群どうしの場合には、総ての組み合わせについて線分どうしに交点があるかどうかを調べ、ある場合にその交点があるそれぞれの線分と交点の登録を行う。例えば図16に示した例では、図16(a)の場合には、実際の交点が存在するのでこのステップにおいて計算により交点座標が算出される。図16(b),(c)の場合には実際に交点がないので交点なしと判定され、座標算出は行わない。
【0100】
ステップS217においては、ステップS216で調べた交点が存在したか(線分交差ありか)どうかを判定して、存在していればステップS218へ進み、存在していなければステップS219へ進む。
【0101】
ステップS218に進むのは2つの曲線領域171,172の中に交点があった場合であり、その交点を基にして2つの輪郭の連結を変更して連結を繋ぎ変える。図17の片仮名「ナ」の例では、図18(a)のようにα,β,γ,δの4点が2つの曲線領域171と172の交点となる。
【0102】
したがって連結変更のために、図19のように輪郭座標データテーブルに、点番号22〜29としてこれらの交点座標を追加登録する。交点αについては2つの交点座標α1,α2を登録し、他の交点β,γ,δについても同様に2つずつ交点座標を登録する。
【0103】
まず交点αを利用した連結の繋ぎ変えについて説明すると、線分IJと線分ghの交点が交点αとなっているので、I→Jの順に連結していたのをI→α1→hの順になるように連結変更し、またg→hの順に連結していたのをg→α2→Jの順になるように連結変更する。交点βは線分abと線分IJの交点となっていたが、交点αを利用した前記の連結変更により、線分abと線分α2Jの交点に変更されている。そこで、a→bの順に連結していたのをa→β1→Jの順になるように連結変更する。また、α2→Jの連結はα2→β2→bの順になるように連結変更する。
【0104】
以下、交点γ,交点δについても同様な連結変更操作を行っていくと、図18(c)の輪郭座標データテーブルは図19から図20のように繋ぎ情報(前の番号と次の番号)を更新される。図20は2つの輪郭を表している。一つは繋ぎ情報が示すように、点番号1の点Aをスタート点とし点番号8の点Iをエンド点とするもので、連結順はA→B→a→J→K→γ1→c→d→E→F→e→f→δ1→L→Iとなっている。もう一つは、点番号9の点Iをスタート点とし点番号13の点Aをエンド点とするもので、連結順はI→α1→h→Aとなっている。これら2つの輪郭はスタート点とエンド点において互いに結合しているので、一方のスタート点とエンド点は消滅し、輪郭の一部となっている。
【0105】
すなわち、図19におけるスタート点でありエンド点であった点Iは、通常の輪郭の一部として、L→I→α1と連続する連結になる。その様子を図21に示す。図21は、繋ぎ変えによって得られた2つの輪郭を表している。一つは繋ぎ情報が示すように、点番号1の点Aをスタート点とし点番号8の点Aをエンド点とするもので、連結順はA→B→a→J→K→γ1→c→d→E→F→e→f→δ1→L→I→α1→h→Aとなっている。もう一つは、点番号23の点α2をスタート点とし点番号30の点α2をエンド点とするもので、連結順はα2→β2→b→γ2→δ2→g→α2となっている。
【0106】
そして、輪郭データ管理部の情報もそれにしたがって更新され、図22に示すようになる。
【0107】
図20が示す2つめの輪郭(スタート点番号9,エンド点番号13)は連結変更によって閉じられたので、輪郭データ管理部から削除する必要がある。ここでは、輪郭がなくなったという意味で輪郭データ222のスタート点番号およびエンド点番号に「−1」の値を代入する。そして、図21が示す2つめの輪郭(スタート点番号23,エンド点番号30)の輪郭データ223が新たに生成されたので、その回転方向、スタート点番号、エンド点番号、輪郭データの最大座標値、最小座標値等、その輪郭の情報を輪郭データ管理情報部に登録する。221は図21が示す1つめの輪郭(スタート点番号0,エンド点番号8)の輪郭データである。
【0108】
図15に戻って説明すると、ステップS219においては、対象輪郭のすべての点列において、上記の交差判定が終了したかどうかを判定する。対象輪郭のすべての点列においてチェックが終了していればステップS221へ進み、まだチェックが終了していなければ図14のステップS220へ進んで、次の新たな点列についてステップS206〜S218による処理を行う。
【0109】
ステップS221では、基準輪郭のすべての点列において、上記の交差判定が終了したかどうかを判定する。基準輪郭のすべての点列においてチェックが終了していれば、本フローチャートの2つの輪郭の交差判定および連結変更処理を終了する。まだチェックが終了していなければ図14のステップS222へ進んで、次の新たな点列についてステップS201〜S220による処理を行う。
【0110】
上記のようにして図6および図14乃至図15のフローチャートに基づいて連結変更の処理を行う本実施の形態によれば、全ての曲線データをショートベクトルの集合に変換することなく、必要なときに曲線から線分群へ変更している。つまり、交差判定を行って線分または曲線領域に交差があるときだけ曲線から線分群へ変更することができるので、膨大な量のデータを扱うことなく処理を高速化し高品位画像を発生させることが可能となる。
【0111】
また、交差を許すストロークデータは、ストローク単位のアウトラインデータとすることも、芯線+太さ型のデータとすることもできる。
【0112】
(第2実施の形態)
次に第2実施の形態について説明する。本実施の形態では、ユーザ定義可能なフォントエディタ画面あるいは図形編集画面に表示された文字や図形において交差があったストロークに対して、ユーザの指示により交差をなくす処理を行う例について説明する。
【0113】
図23は本発明にかかるコンピュータあるいはワークステーション等の画面上で文字や図形を編集するときの文字データ編集画面の様子を示す説明図である。
【0114】
この画面上で、ユーザは好みのアウトラインフォントを周知の技術により編集し登録することができる。図23は、「吉」という文字を輪郭を交差させて登録したときの表示例を示しており、7個のストローク231〜237のデータとして登録している。230,239はモード選択ボタンであり、ユーザがマウス等のポインティングデバイスを用いてクリックしたボタンに応じて、本実施の形態の機能が遂行される。
【0115】
モード選択ボタン230をクリックすると一括変換モードが選択され、図24で後述するように、編集画面上の全てのデータに対して交差を許す輪郭データから交差を許さない全輪郭データへの変換が行われる。一方、モード選択ボタン239をクリックすると部分変換モードが選択され、図25,図26を例にとって後述するように、ユーザに任意に変換対象領域を指定させ、その領域に少なくとも一部が属するストロークに対してのみ交差を許す輪郭データから交差を許さない全輪郭データへの変換が行われる。
【0116】
図24は、ユーザが一括変換モードを選択した場合の変換の様子を示す説明図である。
【0117】
編集画面上の全ての文字(および/または図形)のストローク231〜237に対して、第1実施の形態で説明したとおりに全てのデータの交差をチェックし、交差が存在すれば交差を許さない輪郭型への一括変換を行うと、交差しない2つの輪郭241,242が得られる。
【0118】
図25は、ユーザが部分変換モードを選択した場合の変換の様子を示す説明図である。
【0119】
まずユーザがどの部分領域に対して変換処理を行うのかを指定する。この例では、点線250で示すように部分領域を囲むことによって指定する。
【0120】
変換処理を行う領域を指定すると、プログラムの処理では、まず点線250で示された部分領域内に少なくともその一部が含まれているストロークが存在するのかどうかをチェックし、存在するのであればそのストロークはどのストロークであるのかをチェックする。図25の例では、太線で示したストローク231,232のそれぞれ一部が点線250で指定した部分領域に含まれており、その他のストローク233〜237は、点線250で指定した部分領域に全く含まれていない。
【0121】
したがって、この部分領域に少なくとも一部が含まれているストローク231,232には、含まれていることを示すフラグを1にセットする。一方、この部分領域に全く含まれていないストローク233〜237に対しては、含まれていないのでそのフラグをクリアして0とする。そしてフラグがセットされたストローク231,232のみを抽出し、それらのストローク231,232に対してのみ第1実施の形態で説明したのと同様の処理を施すことによって、ユーザが任意に指定した部分領域に少なくとも一部が含まれるストロークに対して、交差を許す輪郭データから交差を許さない251の全輪郭データへの変換を行うことができる。
【0122】
同様に図26の例は、ユーザが部分変換モードを選択した場合の変換の様子を示す説明図である。
【0123】
まずユーザがどの部分領域に対して変換処理を行うのかを指定する。この例では、点線260で示すように部分領域を囲むことによって指定する。
【0124】
変換処理を行う領域を指定すると、プログラムの処理では、まず点線260で指定された部分領域に少なくとも一部が含まれているストロークが存在するのかどうかをチェックし、存在するのであればそのストロークはどのストロークであるのかをチェックする。図26の例では、ストローク234の全部と、ストローク235,237の一部が部分領域260に含まれており、その他のストローク231〜233,236は、点線260で指定された部分領域に全く含まれていない。
【0125】
したがって、この部分領域に少なくとも一部が含まれているストローク234,235,237には、含まれていることを示すフラグを1にセットする。一方、この部分領域に全く含まれていないその他のストロークに対しては、含まれていないのでそのフラグをクリアして0とする。そしてフラグがセットされたストローク234,235,237のみを抽出し、それらのストローク234,235,237に対してのみ第1実施の形態で説明したのと同様の処理を施すことによって、ユーザが任意に指定した部分領域に少なくとも一部が含まれるストロークに対して、交差を許す輪郭データから交差を許さない261の全輪郭データへの変換を行うことができる。
【0126】
このように、ユーザが文字や図形の編集を行っていてストロークの交差を作って登録してしまった場合に、交差を取り除きたいストロークそれぞれの少なくとも一部を含む領域を画面上で指示することによって、ユーザの手間をかけずに自動的に2つ以上の輪郭の交差を取り除くことが可能となる。
【0127】
本発明方法は、複数の機器から構成されるシステムに適用しても、1つの機器からなる装置に適用しても良い。また、本発明方法はシステム或いは装置にプログラムを供給することによって達成される場合にも適用できることは言うまでもない。この場合、本発明方法を達成するためのソフトウエアによって表されるプログラムを格納した記憶媒体をシステム或いは装置に読み出すことによって、そのシステム或いは装置が、本発明方法の効果を享受することが可能になる。
【0128】
【発明の効果】
以上説明してきたように、本発明によれば、互いに交差するストローク対を含んで構成される画像データをストローク単位で登録し、当該ストローク対のデータから交差しない輪郭データを発生させる際において、登録されたストロークを2つずつ組み合わせてストローク対を抽出し、当該抽出されたストローク対に対し、両ストロークが互いに交差するかを判定し、交差すると判定されたときのみ両ストロークを線分の集合に変換し、両ストロークの各線分が交差しないように各線分を繋ぎ替えることで、両ストロークを表す交差のない輪郭線を発生させるので、処理する線分の数を必要最小限とすることができ、高速かつ高品位な輪郭データ変更を行うことができる効果が得られる。
【図面の簡単な説明】
【図1】本発明の第1実施の形態のシステム構成を示すブロック図である。
【図2】システムのメモリ構成を示す図である。
【図3】記録媒体のメモリ構成を示す図である。
【図4】システムの外観を示す図である。
【図5】本発明の他のシステム構成を示すブロック図である。
【図6】第1実施の形態の処理の全体の流れを示すフローチャートである。
【図7】芯線+太さ型のストロークデータの例を示す説明図である。
【図8】ストローク単位のアウトライン型のデータの例を示す説明図である。
【図9】登録された座標列の様子を示す説明図である。
【図10】交点を求める様子を示す説明図である。
【図11】繋ぎ替えをした後の輪郭データ管理情報部を示す説明図である。
【図12】繋ぎ替えをした後の図形を示す説明図である。
【図13】必要なデータのみを抽出した様子を示す説明図である。
【図14】本発明の詳細な流れを示すフローチャート(その1)である。
【図15】本発明の詳細な流れを示すフローチャート(その2)である。
【図16】線分領域と曲線領域の交差判定の様子を示す説明図である。
【図17】曲線から線分変換した様子を示す図である。
【図18】線分変換した後、交点を求める様子を示す説明図である。
【図19】繋ぎ替えの様子を示す輪郭座標データテーブルの説明図(その1)である。
【図20】繋ぎ替えの様子を示す輪郭座標データテーブルの説明図(その2)である。
【図21】繋ぎ替えの様子を示す輪郭座標データテーブルの説明図(その3)である。
【図22】輪郭の新規登録の様子を示す輪郭データ管理情報部の説明図である。
【図23】第2実施形態による文字データ編集画面の様子を示す説明図である。
【図24】一括変換の様子を示す説明図である。
【図25】部分変換の様子を示す説明図(その1)である。
【図26】部分変換の様子を示す説明図(その2)である。
【符号の説明】
1 CPU
2 ROM
3 RAM
4 キーボード制御部
6 ディスプレイ制御部
7 ディスプレイ装置
8 ディスク制御部
9 外部記憶装置
10 プリンタ制御部
11 プリンタ装置
12 システムバス
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a contour data changing apparatus and method, and more particularly to a character / graphic for changing and processing outline type coordinate data in stroke units that allow intersection in character or graphic data including a curve to all contour data in which intersection is not allowed. The present invention relates to a contour data changing apparatus and method for generating graphic data.
[0002]
[Prior art]
Conventionally, as described in the specifications of patent applications (Japanese Patent Application Nos. 8-269844 and 8-351567) filed by the present applicant, a "line segment" The curve data among the data of "+ curve" was converted into a short vector, and all the data were once converted into line segment data.
[0003]
[Problems to be solved by the invention]
However, in the case of the conventional technique as described above, since the intersection determination is performed after first converting all the curve data into a set of short vectors, the number of line segments becomes enormous, and a one-to-one search method is used. Thus, there is a problem that the processing time is required because the number of searches is large.
[0004]
Therefore, the present invention has been made in view of the above points, and an object of the present invention is to provide a contour data changing apparatus and method which solve the above-mentioned problems.
[0005]
[Means for Solving the Problems]
In order to achieve the above object, in the apparatus according to the present invention, a contour representing a stroke constituted by a line segment or a curve and a contour representing a stroke constituted by a line segment or a curve intersect. A contour data changing device for changing data into contour data in which a contour representing a stroke constituted by a line segment or a curve and a contour representing a stroke constituted by a line segment or a curve do not intersect, wherein a line segment on a reference side is provided. Alternatively, an area determining unit that determines whether there is an intersection between the area of the curve and the line segment or the area of the curve on the target side, and when the area determining unit determines that there is an intersection, the curve is converted into a set of line segments. It is characterized by having conversion means and change means for examining whether or not there is an intersection between line segments and, when it is determined that there is an intersection, changing the connection of line segments based on the intersection.
[0006]
Here, in the apparatus according to the second aspect of the present invention, the first extracting means for extracting the sequence of points of the line segment or the curve on the reference side, and the point of the line segment or the curve on the reference side extracted by the first extracting means. A first check unit for checking a region of a row, a second extracting unit for extracting a sequence of points of a line segment or a curve on a target side, and an area of a point sequence of a line segment or a curve on the target side extracted by the second extracting unit And the area determination means, based on the check between the first check means and the second check means, and a reference-side line segment or a curve region and a target-side line segment or It can also be determined whether there is an intersection with the area of the curve.
[0007]
Here, the apparatus according to the third aspect of the present invention includes an intersection determining unit that determines whether the reference contour data intersects with the target outline data. The determination by the area determination means can also be performed.
[0008]
Here, the apparatus according to the fourth aspect of the present invention includes an extracting unit that extracts a curve that has not been changed by the changing unit, and a processing unit that converts a curve extracted by the extracting unit into a curved line segment. You can also.
[0009]
Here, in the apparatus according to the fifth aspect of the present invention, the intersecting contour data may be contour type data.
[0010]
Here, in the apparatus of the present invention described in claim 6, the intersecting contour data may be contour type data converted from the data of the core line + thickness type.
[0011]
Here, the apparatus of the present invention according to claim 7 may have a display unit for displaying a character or a graphic based on the line segment whose connection has been changed by the changing unit.
[0012]
Here, the apparatus of the present invention described in claim 8 may have a printing unit that prints a character or a graphic based on the line segment whose connection has been changed by the changing unit.
[0013]
In order to achieve the above object, according to the method of the present invention, a contour representing a stroke constituted by a line or a curve and a contour representing a stroke constituted by a line or a curve intersect with each other. A contour data changing method executed by a computer for changing data to contour data in which a contour representing a stroke composed of a line segment or a curve and a contour representing a stroke composed of a line segment or a curve do not intersect, A region determining step of determining whether there is an intersection between the line segment or the curve region on the reference side and the line segment or the curve region on the target side; And a change step of changing the connection of the line segments based on the intersection if it is determined that there is an intersection between the line segments and it is determined that there is an intersection. And wherein the Rukoto.
[0014]
Here, in the method according to the present invention, a first extraction step for extracting a point sequence of a line segment or a curve on the reference side, and a point of the line segment or the curve on the reference side extracted in the first extraction step. A first check step for checking a row area, a second extraction step for extracting a point sequence of a line segment or a curve on a target side, and an area of a point sequence for a target line segment or a curve extracted in the second extraction step And the area determination step is based on the check of the first check step and the second check step and the area of the line segment or curve on the reference side and the line segment or curve on the target side It is also possible to determine whether there is an intersection with the region.
[0015]
Here, the method of the present invention according to claim 11, further comprising an intersection determination step of determining whether or not the reference outline data and the target outline data intersect, and when it is determined that the intersection occurs in the intersection determination step. The determination in the area determination step can be performed.
[0016]
Here, the method according to the twelfth aspect of the present invention includes an extracting step of extracting a curve that has not been changed in the changing step, and a processing step of converting the curve extracted in the extracting step into a curve segment. You can also.
[0017]
Here, in the method of the present invention described in claim 13, the intersecting contour data may be contour-type data.
[0018]
Here, in the method of the present invention described in claim 14, the intersecting contour data may be contour-type data converted from data of a core line + thickness type.
[0019]
Here, the method of the present invention according to claim 15 may include a display step of displaying a character or a graphic based on the line segment whose connection has been changed in the changing step on a display.
[0020]
Here, the method according to the sixteenth aspect of the present invention may include a printing step of printing, by a printer, a character or graphic based on the line segment whose connection has been changed in the changing step.
[0025]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0026]
(1st Embodiment)
FIG. 1 shows a basic configuration of an information processing system to which the present invention is applied. This system may be a Japanese word processor or a system such as a workstation or a personal computer. In FIG. 1, reference numeral 1 denotes a CPU, that is, a central processing unit, which controls the entire apparatus, performs arithmetic processing, and the like.
[0027]
Reference numeral 2 denotes a ROM, that is, a read-only memory, which stores a system startup program, character pattern data, and the like.
[0028]
Reference numeral 3 denotes a RAM, that is, a random access memory, which temporarily stores data used by the CPU 1 for calculation and a calculation result of the CPU 1.
[0029]
Reference numeral 4 denotes a KBC, that is, a keyboard control unit that controls an input device. The keyboard control unit 4 receives key input data (character codes and control codes) from a keyboard (KB) 5 and transmits the key input data to the CPU 1. A pointing device is also used as an input device.
[0030]
Reference numeral 6 denotes a CRTC, that is, a display control unit, which reads out display information stored in the RAM 3, that is, a bitmap image converted from a character code, and transfers it to a display device (CRT) 7.
[0031]
The display device 7, which is an output device, receives the bitmap image transferred from the display control unit 6, and displays the bitmap image on a display screen.
[0032]
Reference numeral 8 denotes a DKC, that is, a disk control unit, which controls data transmission and the like of the external storage device 9. The external storage device 9 includes an FD, that is, a floppy (registered trademark) disk device, an HD, that is, a hard disk device, a CD-ROM, or the like. The external storage device 9 stores programs and data, and the CPU 1 refers to the stored data or loads the data into the RAM 3 as needed.
[0033]
Reference numeral 10 denotes a PRTC, that is, a printer control unit, which controls the operation of the PRT, that is, a printer device 11 that is an output device.
[0034]
A system bus 12 transfers data between the above-described components.
[0035]
FIG. 2 is a diagram showing a memory configuration in the overall processing of the apparatus of the present invention having the system configuration of FIG.
[0036]
As shown in FIG. 2, the memory configuration required for the overall processing of the present apparatus includes a basic I / O program 20, an operating system 21, an application 22, related data 23, and a work area 24. The present apparatus executes the basic I / O program 20, an operating system 21 such as a Windows (registered trademark) system, and an application 22 including a character generation processing program which is a process of the method of the present invention. Operate.
[0037]
In FIG. 2, the operating system 21 indicates a state in which an operating system such as a Windows system is loaded into the RAM 3 and becomes executable.
[0038]
The application 22 shows a memory map in a state where the character processing program of the present invention is loaded into the RAM 3 and becomes executable. The related data 23 is a memory map in a state where the related data is loaded into the RAM 3 and becomes executable. Is shown. The work area 24 shows a memory map of a work memory used by each program.
[0039]
Further, the basic I / O program 20 shown in FIG. 2 is stored in the ROM 2 of FIG. The operating system 21 is stored in the external storage device 9 such as the HD shown in FIG. When the power is turned on, the operating system is read from the HD into the RAM 3 by the IPL (initialize program loading) function in the basic I / O program 20, and the apparatus starts up.
[0040]
Here, FIG. 3 shows a configuration example of the recorded contents of a recording medium such as an FD, a CD-ROM or the like in which a character generation processing program and related data are recorded.
[0041]
As shown in FIG. 3, a recording medium such as an FD or a CD-ROM is composed of recorded information 30 such as volume information 31, directory information 32, a character generation processing program execution file 33, and a character generation processing program related data file. Is done.
[0042]
For example, as shown in FIG. 4, the program and related data of the present invention are obtained by inserting a recording medium 43 detachable from an apparatus such as an FD or a CD-ROM into a recording medium insertion port 42 provided in the apparatus main body 41. Supplied with. Then, by once installing the program and related data from the FD or CD-ROM into the HD, it is possible to load the program from the HD into the RAM 3 and execute the program of the present invention. Note that it is also possible to directly load the program from the FD or CD-ROM to the RAM 3 without installing the program on the HD and execute the program.
[0043]
FIG. 5 is a block diagram showing a control configuration of another system to which the character processing device according to the present invention can be applied.
[0044]
The present system may be a laser beam printer, an ink jet printer, or an output device such as a thermal transfer system. In FIG. 5, reference numeral 51 denotes a CPU, that is, a central processing unit, which controls the entire apparatus, performs arithmetic processing, and the like.
[0045]
Reference numeral 52 denotes a ROM, that is, a read-only memory, which is a storage area for a system startup program, character pattern data, and the like. Reference numeral 53 denotes a RAM, that is, a random access memory, which is an area where each program and data are loaded and executed for each of various processes.
[0046]
Reference numeral 510 denotes a PRTC, that is, a printer control unit, and reference numeral 511 denotes a PRT, that is, a printer device. Reference numeral 512 denotes a system bus, which should serve as a data path between the components described above.
[0047]
Here, the details of the method of the present invention using the apparatus having the above configuration will be described with reference to the flowchart of FIG.
[0048]
First, a character code, an output size when outputting to an output device, a font, deformation information, and the like are passed as an interface of the flowchart in FIG. Then, in step S101, data of the target character is read from the character code and the font. The data to be read at this time is character data registered in units of strokes, and each stroke as shown in FIG. 7 may be data of a core line + thickness type, or as shown in FIG. It may be contour type data.
[0049]
Then, if the obtained data is data of the core line + thickness type as shown in FIG. 7, the data of the core line + thickness type is converted into outline coordinates in units of one stroke as shown in FIG.
[0050]
In step S102, coordinate conversion such as enlargement / reduction processing and deformation processing is performed based on the character width and height of the data previously stored in the external storage device 9 such as the ROMs 2 and 52 or the HD and the output size requested by the interface. To generate the outline data of the read character.
[0051]
In step S103, it is determined whether the generation of outline data has been completed for all strokes of one character. When the coordinate conversion is completed for all the strokes of one character, the process proceeds to step S104. If there is still a stroke to be processed, the process returns to step S102, and steps S102 and S103 are repeated.
[0052]
In step S104, coordinate data of the point sequence defined by the Bezier curve or the B-spline curve and the coordinate data of the point sequence registered as a line segment are registered so as to maintain the order of the outline.
[0053]
FIG. 9 is an explanatory diagram showing a state of a registered coordinate sequence.
[0054]
FIG. 9A shows an example of “na” composed of a stroke 91 whose outline includes points A to H and a stroke 92 whose outline includes points I to L. In this figure and the following figures, △ (open triangle) represents the middle point of the curve, and ((open circle) represents other points.
[0055]
The registration contents are registered as data 910 and 920 for each contour in the contour data management information section of FIG. 9B. As the members of the outline data, the rotation direction (counterclockwise, counterclockwise), start point number, end point (end point) number, maximum coordinate value and minimum coordinate value of the outline data of each outline are stored. The maximum coordinate value is the maximum x coordinate and the maximum y coordinate of the stroke, and the minimum coordinate value is the minimum x coordinate and the minimum y coordinate of the stroke.
[0056]
Actually, the outline information is stored in the outline coordinate data table of FIG. 9C. In this contour coordinate data table, for the points on the contour from the start point number to the end point number indicated by the contour data management information section, the coordinate values, point attribute flags, the previous point number, the next point number Is stored. Here, 1 is added to the point attribute flag if it is the start point of the curve, 2 if it is the middle point of the curve, and 3 if it is the end point of the curve. Then, 0 is added to the flag values of other points such as points on the straight line.
[0057]
Therefore, 1 is added to the start point B, 2 is set to the intermediate points C and D, and 3 is set to the end point E of the curved portion of the stroke 91 in FIG. Here, the stroke 92 is a straight line, and 0 is added to all of the points I to L. Further, from the values of the previous point number and the next point number, it is understood that the outline of the stroke 91 is registered in the order of ABCDEFGHA and then in the order of IJKLI.
[0058]
Returning to FIG. 6, after step S105, the contour data of the stroke registered in the processing up to step S104 is checked. Is performed.
[0059]
In step S105, first, the first contour data registered as shown in FIG. 9 is set as reference contour data.
[0060]
In step S106, contour data next to the reference contour data set in step S105 is set as target contour data. Thus, two strokes of one character are extracted.
[0061]
In step S107, it is determined whether or not the reference contour data and the target contour data cross each other. The determination method here is to check the maximum coordinate value and the minimum coordinate value of the reference contour data and the maximum coordinate value and the minimum coordinate value of the target contour data from the information of each contour shown in FIG. It is to judge. If they overlap, it is determined that there is an intersection, and the process proceeds to step S108. If they do not overlap, it is determined that there is no intersection, and the process proceeds to step S110.
[0062]
In step S108, a line segment where the reference contour data and the target contour data intersect is searched, and if there is an intersection, the curve is converted into a set of line segments to calculate the intersection coordinates of the line segments. A connection change process for changing the outline is performed. The details of the connection change process will be described later with reference to the flowcharts of FIGS.
[0063]
In step S109, new contour data registration processing such as registration deletion of a contour which has disappeared due to the change in connection in step S108 and registration addition of a newly generated contour are performed.
[0064]
In step S110, the next candidate of the target contour data is searched. As a search method, the contour information data management unit checks whether or not another contour data exists after the target contour data targeted in step S109. If there is still a search result, it is determined in step S111 that the target contour data has not been completed, and the process proceeds to step S112. If there is no more target contour data as a result of the search, it is determined in step S111 that the target contour data has been completed, and the process proceeds to step S113.
[0065]
In step S112, the target contour data searched in step S110 is registered as the next new contour data to be checked. When the next target contour data is registered, the process returns to step S107, where the intersection with the reference contour data is checked, and if there is an intersection, a connection change process for changing the connection of the contours is performed.
[0066]
In step S113, since the processing for one piece of reference contour data has been completed in the processing so far, the next new reference contour data is searched. As a search method, it is checked whether there is data next to the reference contour data targeted up to step S112. As a result, if it exists, it is determined in step S114 that a contour that can serve as reference data still exists, and the process proceeds to step S115. However, when there is no contour to be the reference contour data, it is determined in step S114 that the reference contour data no longer exists, and the process proceeds to step S116.
[0067]
When searching for the target contour data or the reference contour data in step S110 or step S113, the point numbers of the start point and the end point of the contour information data management unit are checked, and the values of the start point and the end point are set to “−”. If it is not "1", it is determined that it still exists. If the value is "-1", it is determined that the contour data has disappeared, and the next contour data is searched.
[0068]
In step S115, the reference contour data retrieved in step S113 is registered as the next new reference contour data to be checked. When the next reference contour data is registered, the flow returns to step S106 to check the intersection with the target contour data, and if there is an intersection, the processing after step S107 for changing the connection of the contours is performed. That is, two strokes are extracted from all the registered strokes of one character, and processing such as intersection determination is performed on each extracted stroke pair.
[0069]
Then, in step S116, the contour data obtained so far is output as all contour data that does not allow intersection. At this time, not all the contour data registered in the contour data management information section are output, but necessary contour data is extracted. Further, data required to completely convert one character into a line segment, that is, curve data that has not been converted even after performing the connection changing process in step S108, is searched and extracted. Based on the data generated and output as described above, a character (and / or graphic) pattern is displayed and output on the display screen of the display 7 under the control of the display control unit 6. Further, under the control of the printer control units 10 and 510, the printer devices 11 and 511 print out character (and / or graphic) patterns.
[0070]
In extracting necessary contour data, for example, in the case of a figure composed of strokes 101 to 104 shown in FIG. When the contour data 110, 120, 130, and 140 shown in FIG. 10B are processed by the above algorithm, the contour data shown in FIG. 11 is finally obtained in the contour data management information section. Is as shown in FIG. This can be easily understood by referring to the detailed description of the connection change in step S108.
[0071]
In FIG. 11, contour data 110a, 120a, 130a, and 140a are obtained by updating and registering the contour data 110, 120, 130, and 140, and contour data 150 to 190 are newly registered. The values of the start point and the end point of the contour data 120a, 130a, 140a are "-1", and the contour data has disappeared. The contour data 110a represents the contour 101a in FIG. 12, and the contour data 150 to 190 represent the contours 105 to 109, respectively.
[0072]
In this example, since the first number of contours is 4, only the first contour represented by the contour data 110a is registered in a smaller place and the rotation direction of the contour is not reversed. Further, only the last contour represented by the contour data 190 is registered in a place where the number of contours is larger than the first four, and the rotation direction of the contour is reversed counterclockwise. Therefore, by extracting only these two contours 101a and 109 and finally registering them, it becomes possible to generate all the contour data that does not allow the intersection of the contours as shown in FIG.
[0073]
By the way, if it is determined in the step S108 that the curve has an intersection with another line segment area or the curve area during the above processing, the curve has already been converted into a line segment. If not, it is necessary to convert the curve line segment at the end. Therefore, all point attributes registered in the extracted contour data are searched. The “next” connection point is checked in order from the start point of the contour, and it is checked whether there is a point attribute 1 (curve start point). If there is a point attribute 1, it is registered that the data up to the point of the point attribute 3 (curve end point) appearing thereafter is curve data. This curve search is performed for all points of the registered contour data. In step S117, if there is the curve data extracted in step S116, a process of converting the curve data into a curved line segment is performed, and the entire process ends. The processing in step S117 is the same as the processing described later with reference to the flowcharts in FIGS.
[0074]
In this way, the intersection of the outlines is searched, the connection of the outlines is changed, only the necessary data is extracted at the end, and further converted into a curved line segment, thereby intersecting all strokes of one character. It is possible to generate all the contour data that does not allow the intersection from the contour data that allows the intersection.
[0075]
Here, the details of the connection change in step S108 in FIG. 6 will be described with reference to the flowcharts in FIGS.
[0076]
First, in step S201, a determination is made to extract a point sequence of a line segment or a curve on the reference contour side. Here, looking at the point attribute shown in the contour coordinate data table of FIG. 9C, if the value of the attribute is 0, it is determined that the attribute is not a curve but a line segment, and the process proceeds to step S202. If it is 1, it is determined that it is a curve and the process proceeds to step S204.
[0077]
In step S202, line segment data is extracted by extracting the current point and the next point, that is, a straight line point sequence is extracted.
[0078]
In step S203, the area of the extracted straight point sequence is checked. That is, the x-coordinate and the y-coordinate of the extracted line segment data are checked, and the maximum coordinate value and the minimum coordinate value of the range including the line segment are stored, thereby defining the area of the line segment.
[0079]
In step S204, a point having a point attribute of 2 is sequentially read from the current point attribute 1 to a point having a point attribute of 3 to extract a curve point sequence.
[0080]
Then, in step S205, the region of the extracted curve point sequence is checked. That is, the x- and y-coordinates of all the read points are checked, and the minimum value and the maximum value of each coordinate are stored, thereby defining the area as including the curve. Up to this point, each of the line segment portion and the curved portion is calculated as one region.
[0081]
When the above processing is performed on the reference contour data side, the same processing is subsequently performed on the target contour data side, so that the line segment portion and the curve portion are each calculated as one region. Specifically, the processing of steps S206 to S210 is performed.
[0082]
In step S206, a determination is made to extract a point sequence that is a line segment or a curve on the target contour side. Here, looking at the point attribute shown in the contour coordinate data table of FIG. 9, if the value of the attribute is 0, it is determined that the attribute is not a curve but a line segment, and the process proceeds to step S207. If it is determined to be a curve, the process proceeds to step S209.
[0083]
In step S207, line segment data is extracted by extracting the current point and the next point, that is, a straight line point sequence is extracted.
[0084]
Then, in step S208, the area of the extracted straight point sequence is checked. That is, the x-coordinate and the y-coordinate of the extracted line segment data are checked, and the maximum coordinate value and the minimum coordinate value of the range including the line segment are stored, thereby defining the area of the line segment.
[0085]
In step S209, the points having the point attribute 2 are sequentially read from the current point attribute 1 and the curve point sequence is extracted by reading up to the point having the point attribute 3.
[0086]
Then, in step S210, the region of the extracted curve point sequence is checked. That is, the x- and y-coordinates of all the read points are checked, and the minimum value and the maximum value of each coordinate are stored, thereby defining the area as including the curve.
[0087]
When regions are calculated for the reference contour side and the target contour side, in step S211 in FIG. 15, there is an intersection between the line segment or curve region calculated on the reference contour side and the line segment or curve region calculated on the target contour side. Is determined (other crossing determination). Here, the minimum value and the maximum value of the calculated x-coordinate and y-coordinate of the region are checked, and it is checked whether there is a portion where the regions overlap. As a result, when there is an overlapping portion, it is determined that there is an intersection, and the process proceeds to step S212. On the other hand, if there is no overlapping portion, it is determined that there is no intersection, and the process proceeds to step S219.
[0088]
FIG. 16 is an explanatory diagram showing how to determine the intersection between the line segment area and the curved area.
[0089]
FIG. 16A shows a case where the line segment area 1600 and the curved area 1610 actually intersect. FIG. 16B shows a case where there is no actual intersection between the line segment area 1600 and the curved area 1610, but it is determined that there is an intersection when determined as an area. Here, a range 1620 indicated by a broken line including the curve 1610 and a line segment region 1600 intersect. FIG. 16C shows a case where there is no actual intersection between the line segment region 1600 and the curved region 1610, and there is no intersection even when it is determined as a region. Here, a range 1620 indicated by a broken line including the curve 1610 does not intersect with the line segment region 1600.
[0090]
Therefore, when the determination processing in step S211 is performed, it is determined that there is an intersection in the case of FIGS. 16A and 16B, and the process proceeds to step S212. In the case of FIG. 16C, there is no intersection in the area. And the process proceeds to step S219. The determination of the line segment region and the line segment region and the determination of the curved region and the curved region are performed in the same manner.
[0091]
When there is an intersection in the area, in step S212, it is determined whether the data extracted on the side of the reference contour is a curve. If the data is not a curve but a line segment, the flow proceeds to step S214;
[0092]
In step S213, the curve data is converted into a set of short line segments (short vector). The curve handled here may be a Bezier curve or a B-spline curve having the property of inclusiveness (not exceeding the range of the minimum value and the maximum value of the control point). Then, Bezier decomposition or B-spline expansion is performed according to the rules to convert the curve into a short vector.
[0093]
FIG. 17 is an explanatory diagram showing a point sequence of a character obtained by decomposing a curve from a character at the control point level of the curve shown in FIG. 9A and converting it into a short vector (line segment conversion). Here, 171 and 172 are curved areas of the strokes 91 and 92 in FIG. 9, which will be described in detail below.
[0094]
FIG. 18 is an explanatory diagram showing a state of a coordinate sequence of the converted line segment.
[0095]
In the contour data management information section, as in the case of FIG. 9B, data 1710 and 1720 are registered for each contour, but the contents of the contour coordinate data table are different from those of FIG. 9C. .
[0096]
In other words, as shown in FIG. 18C, data of the line segment of the point after the point number 14 is newly added to the contour coordinate data table, and the point attribute and the connection information (the previous point number, the next point number, Point number) is also updated. Since the points A, B, E, and F are the end points of the curve, the point attribute flag becomes 0. Since the next point after the points B and F and the point before the points A and E change depending on the added point, the connection information thereof is updated. From the values of the previous point number and the next point number in FIG. 18C, the outline information of the stroke 91 is obtained by dividing the continuous line segment AB, line segment Ba, line segment ab, line segment bc, line segment cd, line segment. It can be seen that dE, line segment EF, line segment Fe, line segment ef, line segment fg, line segment gh, and line segment hA are converted and registered. That is, the curve is changed to a line segment. Further, it can be seen that the outline information of the stroke 92 is registered after being converted into a set of continuous line segments IJ, JK, KL, and LI.
[0097]
Referring back to FIG. 15, in step S214, it is determined whether the data extracted on the target contour side is a curve. If the data is not a curve but a line segment, the process proceeds to step S216, and if it is a curve, the process proceeds to step S215.
[0098]
In step S215, similarly to step S213, the data of the curve is converted into a set of short line segments (short vectorization).
[0099]
In step S216, it is checked whether there is any actual intersection with the reference-side line segment or short vector group and the target-side line segment or short vector group. In the case of line segments, it is checked whether or not there is an intersection in the area of each line segment, and if so, the intersection is found. In the case of a short vector group of line segments, it is checked whether or not all the short vectors have intersections with the line segment. If there are, the line segment and the intersection are registered. In the case of short vector groups, it is checked whether or not there is an intersection between line segments for all combinations, and if so, each line segment having the intersection and the intersection are registered. For example, in the example shown in FIG. 16, in the case of FIG. 16A, since an actual intersection exists, the intersection coordinates are calculated in this step. In the case of FIGS. 16B and 16C, there is no actual intersection, so it is determined that there is no intersection, and no coordinate calculation is performed.
[0100]
In step S217, it is determined whether or not the intersection checked in step S216 exists (whether or not there is a line segment intersection). If it exists, the process proceeds to step S218, and if not, the process proceeds to step S219.
[0101]
The process proceeds to step S218 when there is an intersection in the two curved regions 171 and 172, and the connection of the two contours is changed based on the intersection to change the connection. In the example of the katakana “na” in FIG. 17, four points α, β, γ, and δ are the intersections of the two curved regions 171 and 172 as shown in FIG.
[0102]
Therefore, to change the connection, these intersection coordinates are additionally registered as point numbers 22 to 29 in the contour coordinate data table as shown in FIG. Two intersection coordinates α1 and α2 are registered for the intersection α, and two intersection coordinates are similarly registered for the other intersections β, γ and δ.
[0103]
First, the connection reconnection using the intersection point α will be described. Since the intersection point of the line segment IJ and the line segment gh is the intersection point α, the connection in the order of I → J is changed to the order of I → α1 → h. The connection is changed in such a way as to become g → h, and the connection is changed in the order of g → α2 → J. The intersection β is the intersection of the line segment ab and the line segment IJ, but is changed to the intersection of the line segment ab and the line segment α2J by the above-described connection change using the intersection α. Therefore, the connection is changed from a → b in the order of a → β1 → J in the order of a → b. The connection of α2 → J is changed so that the connection is in the order of α2 → β2 → b.
[0104]
Hereinafter, when the same connection changing operation is performed for the intersections γ and δ, the contour coordinate data table of FIG. 18C becomes the connection information (the previous number and the next number) as shown in FIGS. Will be updated. FIG. 20 shows two contours. One is that the point A of point number 1 is the start point and the point I of point number 8 is the end point, as indicated by the connection information, and the connection order is A → B → a → J → K → γ1 → c → d → E → F → e → f → δ1 → L → I. The other is that the point I of point number 9 is the start point and the point A of point number 13 is the end point, and the connection order is I → α1 → h → A. Since these two contours are connected to each other at the start point and the end point, one of the start point and the end point has disappeared and becomes a part of the contour.
[0105]
That is, the point I, which is the start point and the end point in FIG. 19, is connected as L → I → α1 as a part of the normal contour. This is shown in FIG. FIG. 21 shows two contours obtained by reconnection. One is that the point A of the point number 1 is the start point and the point A of the point number 8 is the end point as indicated by the connection information, and the connection order is A → B → a → J → K → γ1 → c → d → E → F → e → f → δ1 → L → I → α1 → h → A The other is that the point α2 of the point number 23 is the start point and the point α2 of the point number 30 is the end point, and the connection order is α2 → β2 → b → γ2 → δ2 → g → α2.
[0106]
Then, the information of the contour data management unit is also updated accordingly, as shown in FIG.
[0107]
The second outline (start point number 9, end point number 13) shown in FIG. 20 has been closed by the connection change, and therefore needs to be deleted from the outline data management unit. Here, a value of “−1” is substituted for the start point number and end point number of the contour data 222 in the sense that the contour has disappeared. Then, since the outline data 223 of the second outline (start point number 23, end point number 30) shown in FIG. 21 is newly generated, its rotation direction, start point number, end point number, and maximum coordinates of the outline data are obtained. The information of the contour, such as the value and the minimum coordinate value, is registered in the contour data management information section. Reference numeral 221 denotes the contour data of the first contour (start point number 0, end point number 8) shown in FIG.
[0108]
Referring back to FIG. 15, in step S219, it is determined whether or not the above-described intersection determination has been completed for all the point sequences of the target contour. If the check has been completed for all the point sequences of the target contour, the process proceeds to step S221. If the check has not been completed yet, the process proceeds to step S220 in FIG. 14, and the process of steps S206 to S218 for the next new point sequence. I do.
[0109]
In step S221, it is determined whether or not the above-described intersection determination has been completed for all the point sequences of the reference contour. If the check has been completed for all the point sequences of the reference contour, the intersection determination and connection change processing of the two contours in this flowchart are terminated. If the check has not been completed yet, the process proceeds to step S222 in FIG. 14, and the processes in steps S201 to S220 are performed for the next new point sequence.
[0110]
According to the present embodiment in which the connection change process is performed based on the flowcharts of FIGS. 6 and 14 and 15 as described above, when all the curve data are converted into a set of short vectors, Is changed from a curve to a group of line segments. In other words, it is possible to change from a curve to a group of line segments only when there is an intersection in the line segment or curve area by performing intersection judgment, so that processing can be speeded up and a high-quality image can be generated without handling a huge amount of data. Becomes possible.
[0111]
Also, the stroke data that allows the intersection may be outline data in units of strokes, or may be data of a core line + thickness type.
[0112]
(2nd Embodiment)
Next, a second embodiment will be described. In the present embodiment, an example will be described in which a process is performed by a user's instruction to eliminate a crossing for a stroke having a crossing in a character or graphic displayed on a user-definable font editor screen or a graphic editing screen.
[0113]
FIG. 23 is an explanatory diagram showing a state of a character data editing screen when characters and graphics are edited on a screen of a computer or a workstation according to the present invention.
[0114]
On this screen, the user can edit and register a favorite outline font by a known technique. FIG. 23 shows a display example when a character "yoshi" is registered by crossing its outline, and is registered as data of seven strokes 231 to 237. 230 and 239 are mode selection buttons, and the functions of the present embodiment are performed according to the button clicked by the user using a pointing device such as a mouse.
[0115]
When the mode selection button 230 is clicked, the batch conversion mode is selected. As described later with reference to FIG. 24, the conversion from all the data on the edit screen to the outline data that allows intersection to all the outline data that does not allow intersection is performed. Is On the other hand, when the mode selection button 239 is clicked, the partial conversion mode is selected, and as described later with reference to FIGS. The conversion is performed from the contour data that allows intersection only to the entire contour data that does not allow intersection.
[0116]
FIG. 24 is an explanatory diagram illustrating a state of conversion when the user selects the batch conversion mode.
[0117]
The intersection of all data is checked for strokes 231 to 237 of all characters (and / or graphics) on the editing screen as described in the first embodiment, and if there is an intersection, the intersection is not permitted. When the batch conversion to the contour type is performed, two contours 241 and 242 that do not intersect are obtained.
[0118]
FIG. 25 is an explanatory diagram showing a state of conversion when the user selects the partial conversion mode.
[0119]
First, the user specifies which partial area is to be subjected to the conversion process. In this example, the designation is made by surrounding a partial area as shown by a dotted line 250.
[0120]
When an area to be converted is designated, the program processing first checks whether there is a stroke including at least a part of the stroke in the partial area indicated by the dotted line 250, and if so, checks the stroke. Check which stroke the stroke is. In the example of FIG. 25, a part of each of the strokes 231 and 232 indicated by a thick line is included in the partial area specified by the dotted line 250, and the other strokes 233 to 237 are completely included in the partial area specified by the dotted line 250. Not.
[0121]
Therefore, for the strokes 231, 232 at least partially included in this partial area, the flag indicating that they are included is set to 1. On the other hand, the strokes 233 to 237 which are not included at all in this partial area are not included, so that their flags are cleared to 0. Then, only the strokes 231 and 232 for which the flag is set are extracted, and only the strokes 231 and 232 are subjected to the same processing as that described in the first embodiment, so that the part arbitrarily specified by the user is obtained. For a stroke at least partially included in the area, it is possible to perform conversion from the contour data that allows intersection to 251 entire contour data that does not allow intersection.
[0122]
Similarly, the example of FIG. 26 is an explanatory diagram illustrating a state of conversion when the user selects the partial conversion mode.
[0123]
First, the user specifies which partial area is to be subjected to the conversion process. In this example, the designation is made by surrounding a partial area as shown by a dotted line 260.
[0124]
When the area to be converted is designated, the program processing first checks whether there is a stroke at least partially included in the partial area designated by the dotted line 260, and if so, the stroke is Check which stroke it is. In the example of FIG. 26, the entire stroke 234 and a part of the strokes 235 and 237 are included in the partial area 260, and the other strokes 231 to 233 and 236 are completely included in the partial area designated by the dotted line 260. Not.
[0125]
Therefore, a flag indicating that the stroke is included in the strokes 234, 235, 237 at least partially included in the partial area is set to 1. On the other hand, other strokes that are not included in this partial area at all are not included, so that the flag is cleared to 0. Then, only the strokes 234, 235, and 237 for which the flags are set are extracted, and only the strokes 234, 235, and 237 are subjected to the same processing as that described in the first embodiment. Can be converted from the outline data that allows the intersection to the entire outline data 261 that does not allow the intersection for the stroke at least partially included in the partial area specified in (1).
[0126]
As described above, when the user edits a character or a figure and creates and registers an intersection of strokes, the user specifies on the screen an area including at least a part of each stroke whose intersection is to be removed. In addition, it is possible to automatically remove the intersection of two or more contours without the user's trouble.
[0127]
The method of the present invention may be applied to a system composed of a plurality of devices or an apparatus composed of one device. Needless to say, the method of the present invention can be applied to a case where the method is achieved by supplying a program to a system or an apparatus. In this case, by reading out a storage medium storing a program represented by software for achieving the method of the present invention into a system or an apparatus, the system or apparatus can receive the effects of the method of the present invention. Become.
[0128]
【The invention's effect】
As described above, according to the present invention, image data including stroke pairs that intersect each other is registered in units of strokes, and when generating contour data that does not intersect from the data of the stroke pairs, registration is performed. A stroke pair is extracted by combining two strokes each other, and it is determined whether the two strokes intersect each other with respect to the extracted stroke pair. Only when it is determined that the two strokes intersect, both strokes are formed into a set of line segments. By converting and reconnecting each line segment so that each line segment of both strokes does not intersect, a contour line without intersection representing both strokes is generated, so the number of line segments to be processed can be minimized. Thus, an effect that high-speed and high-quality contour data can be changed can be obtained.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a system configuration according to a first embodiment of the present invention.
FIG. 2 is a diagram showing a memory configuration of the system.
FIG. 3 is a diagram showing a memory configuration of a recording medium.
FIG. 4 is a diagram showing an appearance of the system.
FIG. 5 is a block diagram showing another system configuration of the present invention.
FIG. 6 is a flowchart illustrating an overall flow of a process according to the first embodiment.
FIG. 7 is an explanatory diagram showing an example of stroke data of a core line + thickness type.
FIG. 8 is an explanatory diagram showing an example of outline type data in units of strokes.
FIG. 9 is an explanatory diagram showing a registered coordinate sequence.
FIG. 10 is an explanatory diagram showing how to find an intersection.
FIG. 11 is an explanatory diagram showing an outline data management information section after reconnection.
FIG. 12 is an explanatory diagram showing a figure after reconnection.
FIG. 13 is an explanatory diagram showing a state where only necessary data is extracted.
FIG. 14 is a flowchart (part 1) showing a detailed flow of the present invention.
FIG. 15 is a flowchart (part 2) showing a detailed flow of the present invention.
FIG. 16 is an explanatory diagram showing how to determine the intersection between a line segment area and a curved area.
FIG. 17 is a diagram showing a state where a line segment is converted from a curve.
FIG. 18 is an explanatory diagram showing a state where an intersection is obtained after performing line segment conversion.
FIG. 19 is an explanatory diagram (part 1) of a contour coordinate data table showing a state of reconnection.
FIG. 20 is an explanatory diagram (part 2) of a contour coordinate data table showing a state of reconnection.
FIG. 21 is an explanatory diagram (part 3) of a contour coordinate data table showing a state of reconnection.
FIG. 22 is an explanatory diagram of a contour data management information part showing a state of new registration of a contour.
FIG. 23 is an explanatory diagram showing a state of a character data editing screen according to the second embodiment.
FIG. 24 is an explanatory diagram showing a state of batch conversion.
FIG. 25 is an explanatory diagram (part 1) illustrating a state of partial conversion.
FIG. 26 is an explanatory diagram (part 2) illustrating a state of partial conversion.
[Explanation of symbols]
1 CPU
2 ROM
3 RAM
4 Keyboard control unit
6 Display control unit
7 Display device
8 Disk control unit
9 External storage device
10 Printer control unit
11 Printer device
12 System bus

Claims (16)

線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差する輪郭データを、線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差しない輪郭データに変更する輪郭データ変更装置であって、
基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定する領域判定手段と、
前記領域判定手段により交差があると判定された場合、曲線を線分の集合に変換する変換手段と、
線分どうしに交点があるか調べ、交点があると判定された場合、交点を元に線分の連結を変更する変更手段と
を有することを特徴とする輪郭データ変更装置。
Contour data that intersects a contour representing a stroke composed of a line segment or a curve and a contour representing a stroke composed of a line segment or a curve, A contour data changing device for changing to contour data that does not intersect with a contour representing a stroke composed of
Area determining means for determining whether there is an intersection between the line segment or curve region on the reference side and the line segment or curve region on the target side,
When it is determined that there is an intersection by the area determination means, conversion means for converting the curve into a set of line segments,
A contour data changing device, comprising: changing means for changing the connection of a line segment based on the intersection if it is determined whether there is an intersection between the line segments and it is determined that there is an intersection.
基準側の線分または曲線の点列を取出す第1取出し手段と、
前記第1取出し手段により取出した基準側の線分または曲線の点列の領域をチェックする第1チェック手段と、
対象側の線分または曲線の点列を取出す第2取出し手段と、
前記第2取出し手段により取出した対象側の線分または曲線の点列の領域をチェックする第2チェック手段とを有し、
前記領域判定手段は、前記第1チェック手段と前記第2チェック手段とのチェックに基づき基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定することを特徴とする請求項1記載の輪郭データ変更装置。
First extraction means for extracting a sequence of points of a line segment or a curve on the reference side;
First check means for checking a region of a point sequence of a line segment or a curve on the reference side extracted by the first extraction means;
Second extracting means for extracting a point sequence of a line segment or a curve on the target side;
A second check unit for checking an area of a point sequence of a line segment or a curve on the target side extracted by the second extraction unit;
The area determination means determines whether there is an intersection between a reference-side line segment or a curve area and a target-side line segment or a curve area based on checks by the first check means and the second check means. The contour data changing device according to claim 1, wherein:
基準輪郭データと対象輪郭データと交差しているか判定する交差判定手段を有し、
前記交差判定手段により交差していると判定された場合、前記領域判定手段による判定を行うことを特徴とする請求項1記載の輪郭データ変更装置。
Intersection determining means for determining whether the reference contour data and the target contour data intersect,
2. The contour data changing device according to claim 1, wherein when the intersection is judged by the intersection judging means, the judgment is made by the area judging means.
前記変更手段により変更されなかった曲線を抽出する抽出手段と、
前記抽出手段により抽出された曲線を曲線線分変換する処理手段とを有することを特徴とする請求項1記載の輪郭データ変更装置。
Extracting means for extracting a curve that has not been changed by the changing means,
2. A contour data changing apparatus according to claim 1, further comprising processing means for converting a curve extracted by said extracting means into a curved line segment.
前記交差する輪郭データは輪郭型のデータであることを特徴とする請求項1記載の輪郭データ変更装置。2. The contour data changing device according to claim 1, wherein the intersecting contour data is contour type data. 前記交差する輪郭データは芯線+太さ型のデータから変換された輪郭型のデータであることを特徴とする請求項1記載の輪郭データ変更装置。2. The contour data changing device according to claim 1, wherein the intersecting contour data is contour-type data converted from data of a core line + thickness. 前記変更手段により連結が変更された線分に基づく文字または図形を表示する表示手段を有することを特徴とする請求項1記載の輪郭データ変更装置。2. The contour data changing device according to claim 1, further comprising display means for displaying a character or graphic based on the line segment whose connection has been changed by said changing means. 前記変更手段により連結が変更された線分に基づく文字または図形を印刷する印刷手段を有することを特徴とする請求項1記載の輪郭データ変更装置。2. The outline data changing device according to claim 1, further comprising a printing unit that prints a character or a graphic based on the line segment whose connection has been changed by the changing unit. 線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差する輪郭データを、線分または曲線で構成されるストロークを表す輪郭と線分または曲線で構成されるストロークを表す輪郭とが交差しない輪郭データに変更するコンピュータで実行される輪郭データ変更方法であって、
基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定する領域判定ステップと、
前記領域判定ステップにおいて交差があると判定された場合、曲線を線分の集合に変換する変換ステップと、
線分どうしに交点があるか調べ、交点があると判定された場合、交点を元に線分の連結を変更する変更ステップと
を有することを特徴とする輪郭データ変更方法。
Contour data that intersects a contour representing a stroke composed of a line segment or a curve and a contour representing a stroke composed of a line segment or a curve, A contour data changing method executed by a computer to change to contour data that does not intersect with a contour representing a stroke composed of:
A region determination step of determining whether there is an intersection between the line segment or curve region on the reference side and the line segment or curve region on the target side,
A conversion step of converting a curve into a set of line segments when it is determined that there is an intersection in the area determination step;
A step of examining the line segments for intersections and, if it is determined that there is an intersection, changing the connection of the line segments based on the intersections.
基準側の線分または曲線の点列を取出す第1取出しステップと、
前記第1取出しステップにおいて取出した基準側の線分または曲線の点列の領域をチェックする第1チェックステップと、
対象側の線分または曲線の点列を取出す第2取出しステップと、
前記第2取出しステップにおいて取出した対象側の線分または曲線の点列の領域をチェックする第2チェックステップとを有し、
前記領域判定ステップは、前記第1チェックステップと第2チェックステップとのチェックに基づき基準側の線分または曲線の領域と対象側の線分または曲線の領域とに交差があるか判定することを特徴とする請求項9記載の輪郭データ変更方法。
A first extraction step of extracting a point sequence of a line segment or a curve on a reference side;
A first check step of checking an area of a point sequence of a line segment or a curve on the reference side extracted in the first extraction step;
A second extraction step of extracting a point sequence of a line segment or a curve on the target side;
A second check step of checking an area of a point sequence of a line segment or a curve on the target side extracted in the second extraction step,
The area determination step determines whether there is an intersection between the reference side line segment or curve area and the target side line segment or curve area based on the check of the first check step and the second check step. 10. The contour data changing method according to claim 9, wherein:
基準輪郭データと対象輪郭データと交差しているか判定する交差判定ステップを有し、
前記交差判定ステップにおいて交差していると判定された場合、前記領域判定ステップによる判定を行うことを特徴とする請求項9記載の輪郭データ変更方法。
Having an intersection determination step of determining whether the reference outline data and the target outline data intersect,
10. The contour data changing method according to claim 9, wherein when it is determined in the intersection determination step that the vehicle crosses, the determination in the area determination step is performed.
前記変更ステップにおいて変更されなかった曲線を抽出する抽出ステップと、
前記抽出ステップにおいて抽出された曲線を曲線線分変換する処理ステップとを有することを特徴とする請求項9記載の輪郭データ変更方法。
An extracting step of extracting a curve that has not been changed in the changing step;
10. A method according to claim 9, further comprising a step of converting a curve extracted in the extraction step into a curve segment.
前記交差する輪郭データは輪郭型のデータであることを特徴とする請求項9記載の輪郭データ変更方法。10. The contour data changing method according to claim 9, wherein the intersecting contour data is contour type data. 前記交差する輪郭データは芯線+太さ型のデータから変換された輪郭型のデータであることを特徴とする請求項9記載の輪郭データ変更方法。10. The contour data changing method according to claim 9, wherein the intersecting contour data is contour-type data converted from data of a core line + thickness. 前記変更ステップにおいて連結が変更された線分に基づく文字または図形をディスプレイに表示する表示ステップを有することを特徴とする請求項9記載の輪郭データ変更方法。10. The contour data changing method according to claim 9, further comprising a display step of displaying a character or a graphic based on the line segment whose connection has been changed in the changing step on a display. 前記変更ステップにおいて連結が変更された線分に基づく文字または図形をプリンタにより印刷する印刷ステップを有することを特徴とする請求項9記載の輪郭データ変更方法。10. The contour data changing method according to claim 9, further comprising a printing step of printing, by a printer, a character or a graphic based on the line segment whose connection has been changed in the changing step.
JP26173997A 1997-09-26 1997-09-26 Apparatus and method for changing contour data Expired - Fee Related JP3560310B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26173997A JP3560310B2 (en) 1997-09-26 1997-09-26 Apparatus and method for changing contour data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26173997A JP3560310B2 (en) 1997-09-26 1997-09-26 Apparatus and method for changing contour data

Publications (2)

Publication Number Publication Date
JPH11102176A JPH11102176A (en) 1999-04-13
JP3560310B2 true JP3560310B2 (en) 2004-09-02

Family

ID=17366044

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26173997A Expired - Fee Related JP3560310B2 (en) 1997-09-26 1997-09-26 Apparatus and method for changing contour data

Country Status (1)

Country Link
JP (1) JP3560310B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5397070B2 (en) * 2008-08-13 2014-01-22 株式会社リコー Control device, laser irradiation device, optimized font data DB, recording method, program, storage medium
JP5534415B2 (en) * 2010-02-15 2014-07-02 株式会社リコー Developing device, process cartridge including the developing device, and image forming apparatus including the developing device or the process cartridge
JP5659871B2 (en) * 2010-11-24 2015-01-28 株式会社リコー Thermal rewritable media drawing device, control method, and control program

Also Published As

Publication number Publication date
JPH11102176A (en) 1999-04-13

Similar Documents

Publication Publication Date Title
JP4686186B2 (en) System and method for generating font format data from source font data
JP2690110B2 (en) Scan conversion method
JP4893148B2 (en) Shape simplification device and program used therefor
EP2002352B1 (en) Applying effects to a merged text path
US6266444B1 (en) Character processing apparatus and method therefor
US5524198A (en) Character or graphic processing method and apparatus
JP3560310B2 (en) Apparatus and method for changing contour data
JP3396404B2 (en) Automatic string editing system
KR100243831B1 (en) Character pattern generator apparatus
JP3490703B2 (en) Character processing method based on outline font information and computer-readable recording medium storing computer program for causing a computer system to execute the method
JP4458640B2 (en) Drawing instruction apparatus, drawing instruction method thereof, and computer-readable storage medium
JP3039015B2 (en) Character processor
JP2590327B2 (en) How to manage drawing information
JP3382336B2 (en) Character processing apparatus and method
JP3163577B2 (en) Vector font generation method
JPH11109942A (en) Device and method for processing character
JP3461210B2 (en) Character processing apparatus and method
JP3133807B2 (en) Outline extraction method and apparatus
JP3351939B2 (en) Character string transformation arrangement method
JP3082391B2 (en) Image processing device
JPH04218094A (en) Outline font processor
JPH0962855A (en) Information processor, information processing method and storage medium
JPH02241267A (en) Picture information processor
JPH0968963A (en) Device and method for processing character
JPH07248756A (en) Device for plotting character/graphic

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040123

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040203

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040405

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040521

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040524

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090604

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090604

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100604

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110604

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120604

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120604

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130604

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees