Nothing Special   »   [go: up one dir, main page]

JP4140363B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP4140363B2
JP4140363B2 JP2002351978A JP2002351978A JP4140363B2 JP 4140363 B2 JP4140363 B2 JP 4140363B2 JP 2002351978 A JP2002351978 A JP 2002351978A JP 2002351978 A JP2002351978 A JP 2002351978A JP 4140363 B2 JP4140363 B2 JP 4140363B2
Authority
JP
Japan
Prior art keywords
character
font
drawn
characters
image processing
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
JP2002351978A
Other languages
Japanese (ja)
Other versions
JP2004184718A (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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
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 Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2002351978A priority Critical patent/JP4140363B2/en
Publication of JP2004184718A publication Critical patent/JP2004184718A/en
Application granted granted Critical
Publication of JP4140363B2 publication Critical patent/JP4140363B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Record Information Processing For Printing (AREA)
  • Processing Or Creating Images (AREA)
  • Document Processing Apparatus (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、複数のフォントをあらかじめ保有しておき、これら複数のフォントの中から要求されたフォントを選択して当該フォントに対応した文字の出力処理を行う画像処理装置および画像処理方法に関し、特に要求されたフォントと同一のフォントを保有していない場合に、保有しているフォントの中から要求されたフォントに近いフォントを選択して描画することが可能な画像処理装置および画像処理方法に関する。
【0002】
【従来の技術】
近年、文章や画像などのドキュメントを、パーソナルコンピュータやワークステーションなどのコンピュータ装置で電子的に作成し、その作成したドキュメントをコンピュータ装置と例えばネットワークを介して接続された出力装置、例えばプリンタ装置にて印刷出力する、といったことが広く行われている。
【0003】
このようなコンピュータ装置とプリンタ装置とを備えてなる画像形成システムにおいては、一般に、ドキュメントを印刷出力するに当たって、コンピュータ装置側からプリンタ装置側に対してページ記述言語(Page Description Language;以下、「PDL」と略す)で記述された描画命令を送出するようになっている。そして、描画命令の送出があると、プリンタ装置側において、コンピュータ装置側から受け取った描画命令を基にテキストやグラフィックスなどの図形を描画することになる。
【0004】
テキストを描画する場合は、テキストとして描画されるフォントの属性と、テキストと、テキストの描画位置の各情報がコンピュータ装置側から指定され、これらの指定情報に基づいてプリンタ装置側にてテキスト描画を行うのが一般的である。その際、コンピュータ装置側で指定されたフォントが全てプリンタ装置に搭載されているとは限らない。
【0005】
このように、指定されたフォントがプリンタ装置に搭載されていない場合、従来は、プリンタ装置が保有している複数のフォントの中から適当なフォントを選んで描画するようにしていた(例えば、特許文献1参照)。具体的には、複数のフォントの各々に対してそれぞれの書体名とスタイル情報(太さ・字形・ファミリ)とを対応付けて格納しておき、指定されたフォントが存在しない場合は、書体名およびスタイル情報を基に代替のフォントに置き換えて描画することで、フォントがプリンタ装置側に搭載されていない場合のテキスト描画を実現可能にしている。
【0006】
【特許文献1】
特開平6−130930号公報
【0007】
【発明が解決しようとする課題】
しかしながら、上述した従来技術のように、指定されたフォントが存在しない場合に、単に別のフォントに置換して描画する手法を採ると、指定されたフォントと変更されたフォントとの間でフォントの横幅または縦幅が異なる場合に、その幅の違いによって描画されたテキストの文字間隔が不自然に広くなったり、逆に狭くなったりするという不具合が発生してしまう。
【0008】
例えば、横書きの場合に、指定されたフォントの幅が変更されたフォントの幅よりも狭いと描画された文字同士が接触し、逆に広いと文字間隔が不自然に開いて描画されてしまう。また、縦書きの場合に、指定されたフォントの高さが変更されたフォントの高さよりも低いと描画された文字同士が接触し、逆に高いと文字間隔が不自然に開いて描画されてしまう。
【0009】
具体的には、横書きの場合を例に採ると、指定されたフォントの幅が、置き換えられたフォントの幅よりも狭い場合には、図9に示すように、文字列を描画する各々の文字の描画開始位置は元の狭いフォントを基準にして指定されるため、幅の広いフォントに置き換えられることで、元のフォント描画位置では文字同士が重なって描画されてしまっていた。ここでは、幅の狭い「へ」と「と」を幅の広いフォントに置換した場合の様子を示している。
【0010】
一方、指定されたフォントの幅が、置き換えられたフォントの幅よりも広い場合には、図10に示すように、文字列を描画する各々の文字の描画開始位置は元の広いフォントを基準にして指定されるため、幅の狭いフォントに置き換えられることで、元のフォント描画位置では文字間隔が不自然に広がって描画されてしまっていた。ここでは、幅の広い「へ」と「と」を幅の狭いフォントに置換した場合の様子を示している。
【0011】
本発明は、上記課題に鑑みてなされたものであり、その目的とするところは、指定されたフォントを別のフォントに置換して描画する際に、文字間の重なりや文字間隔の狭すぎあるいは広すぎ(開きすぎ)を防止して見栄えの良い文字列の描画を可能にした画像処理装置および画像処理方法を提供することにある。
【0012】
【課題を解決するための手段】
本発明による画像処理装置は、任意のフォントを特定する情報とそのフォントの属性情報を基にしたフォントの使用要求に応じて、複数のフォントの中から所望のフォントを選択し、この選択したフォントを用いて文字コードおよび文字描画位置情報を基に文字を出力する画像処理装置であって、前記複数のフォント中に前記使用要求に一致するフォントが存在する場合はそのフォントを選択し、存在しない場合は指定された属性情報が近いフォントを近似フォントとして選択する選択手段と、前記選択手段によって選択されたフォントに対応する文字を当該フォントの文字コードおよび文字描画位置情報を基に描画する描画手段と、前記選択手段によって前記近似フォントが選択されたとき、前記描画手段による今回の描画文字と次回の描画文字との間の文字間隔を予測する文字間隔予測手段と、前記描画手段による今回の描画文字を前記文字間隔予測手段が算出した前記文字間隔に対応する縮小率または拡大率で縮小または拡大する制御手段とを備える構成となっている。
【0013】
本発明による画像処理方法は、任意のフォントを特定する情報とそのフォントの属性情報を基にしたフォントの使用要求に応じて、複数のフォントの中から所望のフォントを選択し、この選択したフォントを用いて文字コードおよび文字描画位置情報を基に文字を出力するに当たって、前記複数のフォント中に前記使用要求に一致するフォントが存在する場合はそのフォントを選択し、存在しない場合は指定された属性情報が近いフォントを近似フォントとして選択し、前記近似フォントを選択したとき、今回の描画文字と次回の描画文字との間の文字間隔を予測し、この予測した前記文字間隔に対応する縮小率または拡大率で今回の描画文字を縮小または拡大して前記文字描画位置情報を基に描画するようにする。
【0014】
上記構成の画像処理装置または画像処理方法において、使用要求に一致するフォントが存在しない場合に、指定された属性情報が近いフォントを近似フォントとして選択し、この選択した近似フォントを用いて文字コードと文字描画位置情報を基に文字を出力するに当たって、今回の描画文字と次回の描画文字との間の文字間隔を予測し、この予測結果に基づいて、今回の描画文字に対して次回の描画文字が重なったり、文字間隔が狭くなりすぎたり、広くなりすぎないように今回の描画文字を縮小または拡大して描画する。これにより、描画後の文字列において、文字間の重なりや文字間隔の狭すぎあるいは広すぎ(開きすぎ)を防止できるため、見栄えの良い文字列の描画を実現できる。
【0015】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照して詳細に説明する。ただし、ここでは、本発明を、ドキュメントの印刷出力を行うプリンタ装置に搭載された画像処理装置および当該画像処理装置が実行する画像処理方法に適用した場合を例に挙げて説明するものとする。
【0016】
図1は、本発明の一実施形態に係る画像処理装置の構成の概略を示すブロック図である。本実施形態に係る画像処理装置10は、図示しないホストコンピュータ装置で生成されたPDLを、そのコンピュータ装置からネットワーク20を介して受信すると、受信したPDLによって記述された描画コマンド(直線、曲線、フォント、ラスタ画像、塗りつぶし等の描画命令)を解釈して図形描画処理を行うとともに描画した図形のデータをバッファに格納し、描画後に生成されたラスタ状の図形データを出力する出力装置、例えば画像形成を行うプリンタエンジン30に対して送出する機能を持っている。
【0017】
上述した機能を実現するために、図1から明らかなように、本実施形態に係る画像処理装置10は、入力インターフェイス(以下、インターフェイスを「I/F」と略す)11と、CPU(Central Processing Unit)12と、ROM(Read Only Memory)13と、RAM(Random Access Memory)14と、プリンタエンジンI/F15と、これらの構成要素を相互に接続する内部バス16とを備えた構成となっている。
【0018】
この画像処理装置10において、入力I/F11は、ホストコンピュータ装置から送出されるPDLをネットワーク20を介して受信する。ここで、入力I/F11が受信するPDLには、先述した図形描画コマンドが含まれているものとする。また、図形の描画を行う場合には、その図形の外郭データがPDLとして入力I/F11に与えられるものとする。
【0019】
CPU12は、画像処理装置10全体の動作制御の外に、入力I/F11を介して受け取ったPDLを解釈して、その解釈結果に基づいて図形の描画処理を行う。この図形の描画処理は、CPU12が持つ図形描画処理、ラスターイメージ描画処理および文字描画処理の各機能によって行われる。これらの処理のうち、文字描画処理を行うために、CPU12は、図1に示すように、文字描画命令処理部121、ビットマップイメージ生成部122、書体選択部123および文字間隔算出部124の各機能部を有している。
【0020】
ROM13は、CPU11が描画処理を行うのに必要となる描画プログラムをあらかじめ格納している。このROM13内の描画プログラムを実行することにより、CPU11は上述した各処理、即ち図形描画処理、ラスターイメージ描画処理および文字描画処理の各機能を実現するようになっている。ROM13にはさらに、文字描画のための複数のフォントについてのフォントデータも格納されている。このフォントデータは、ビットマップイメージ生成部122によって読み出されてフォントのビットマップを作成するために使用される。
【0021】
RAM14は、CPU11が描画処理を行う際のワークメモリとして用いられる。詳しくは、CPU11による描画結果が描き込まれることにより、プリンタエンジン30に出力するための図形データを格納するページバッファ141を有している。RAM14には、後述する文字の拡縮率(拡大率・縮小率)テーブルも格納されている。
【0022】
プリンタエンジンI/F15は、CPU11による制御に従いつつ、RAM14内のページバッファ141に格納された図形データから展開されたラスターデータをプリンタエンジン30に送出する。プリンタエンジン30としては、周知の電子写真技術を利用してラスターデータを印刷出力するものであっても良く、あるいは、周知のインクジェット方式の印刷技術を利用してラスターデータを印刷出力するものであっても良い。
【0023】
なお、本実施形態では、画像出力を行う出力装置として、ドキュメントの印刷出力を行うプリンタ装置を用いた場合を例に挙げたが、これに限られるものではなく、表示出力を行うCRT(Cathode Ray Tube)等のディスプレイ装置であっても構わない。
【0024】
また、本実施形態においては、ホストコンピュータ装置から送出されるPDLをネットワーク20を介して受信するとしたが、ネットワーク20を介して受信するのではなく、同一のコンピュータ上にあるアプリケーションから直接呼び出す構成であっても構わない。
【0025】
次に、CPU12が持つ機能部である文字描画命令処理部121、ビットマップイメージ生成部122、書体選択部123および文字間隔算出部124の各機能の概要、換言すれば、文字描画処理における処理動作の概要について簡単に説明する。
【0026】
ホストコンピュータ装置からネットワーク20を経由して送られてきたPDLは、図示されていない図形描画命令解釈部によって解釈されて、RAM14のページバッファ141へラスターデータとして描画される。このとき、グラフィックスやラスターイメージは、図示されていない図形描画処理部やラスターイメージ描画処理部によってラスターデータへ変換されて描画される。
【0027】
文字描画命令処理部121は、ネットワーク20を介してホストコンピュータ装置から送られてきたPDL中の文字描画命令を、図形描画命令解釈部を介して受け取り、当該文字描画命令に基づいて文字描画処理を行う。ここで、文字描画命令は、図2に示すように、フォント指定命令と文字列描画命令とから構成されている。フォント指定命令は、フォント名情報(フォント名・ファミリ名)およびフォント属性情報(太さ・傾斜・サイズ)を含んでいる。文字列描画命令は、文字列情報(文字数・描画位置・文字コード×文字数・文字描画位置×文字数)を含んでいる。
【0028】
文字描画命令処理部121がフォント指定命令を受け取ると、これを受けて書体選択部123は、ROM13にあらかじめ格納されている複数のフォント(書体)の中からフォント指定命令によって指定されたフォントの選択を行う。このとき、書体選択部123は、複数のフォントの中に指定されたフォントが存在すれば、そのフォントをカレントフォントとして設定し、存在しないのであれば、指定された属性情報が近いフォント、好ましくは最も近いフォントを選択してカレントフォント(近似フォント)として設定する。ROM13に格納されるフォントデータ(図6参照)の詳細については後述する。
【0029】
続いて、文字描画命令処理部121が文字列描画命令を受け取ると、これを受けてビットマップイメージ生成部122は、書体選択部123にて設定されたカレントフォントの文字コードに該当する文字のビットマップを生成し、この生成したビットマップを文字列情報中の描画位置情報に対応した文字描画位置に描画する。この際、指定されたフォントが存在せず、書体選択部123にて別のフォントが選択されている場合、即ちフォントが置換されている場合には、今回の描画文字と次回の描画文字との文字間の状態を予測する処理を行う。
【0030】
ここで、「文字間の状態を予測する」とは、フォント指定命令で指定された文字を文字列描画命令に応じて描画した際の文字相互間の間隔を基準としたとき、今回の描画文字と次回の描画文字とが重なった状態にならないか、基準の状態よりも狭すぎる状態にならないか、あるいは広すぎる(開きすぎる)状態にならないかを予測することを言う。この予測を行う手段として、例えば、今回の描画文字と次回の描画文字との間の文字間隔(描画間隔)を算出する処理を行う文字間隔算出部124が用いられる。
【0031】
文字間隔算出部124は、文字間隔を算出するとともに、この算出した文字間隔を基に今回の描画文字と次回の描画文字との文字間の状態を判定する処理を行う。すなわち、算出した文字間隔が上記基準の状態に対応する基準値に対して等しいか、小さいか、大きいかの判定を行う。基準値よりも小さい場合は、今回の描画文字に対して次回の描画文字が重なったり、文字間隔が不自然に狭すぎる状態となる。逆に、基準値よりも大きい場合は、今回の描画文字と次回の描画文字との文字間隔が不自然に広すぎる(開きすぎる)状態となる。いずれの場合も、描画後の文字列の見栄えを悪化させる要因となる。
【0032】
文字間隔算出部124はさらに、文字間の状態の判定結果を基に各文字コードに対応した拡縮率を求めて、拡縮率テーブルとしてRAM14に格納する。その後、ビットマップイメージ生成部122は、文字間隔算出部124で求めた拡縮率を基に、カレントフォントの文字コードに該当する文字のビットマップを生成し、この生成したビットマップを文字列情報中の描画位置情報に対応した文字描画位置に描画する。
【0033】
上述した処理を全ての描画コマンドについて繰り返して実行する。そして、全ての描画コマンドの描画処理が終了したら、プリンタエンジンI/F15を介してプリンタエンジン30に出力する。以上により、1ページ分の処理が終了し、以降、ページ単位で上述した一連の処理を繰り返して実行する。
【0034】
続いて、文字描画命令処理部121、書体選択部124および文字間隔処理部124の各機能部において実行される処理の具体例について説明する。
【0035】
〔文字描画命令処理部121〕
先ず、文字描画命令処理部121の処理について詳しく説明する。図3は、文字描画命令処理部121の処理手順の一例を示すフローチャートである。
【0036】
文字描画命令処理部121は、ネットワーク20を介してホストコンピュータ装置から送られてきたPDL中の文字描画命令を、図示されていない図形描画命令解釈部を介して受け取ると、先ず、フォント指定命令か文字列描画命令かを判定する(ステップS11)。フォント指定命令であれば、書体選択部123による書体(フォント)選択の処理(ステップS12)に移行する。この書体選択の処理では、後で詳細に説明するように、選択したフォントをカレントフォントとして登録するとともに、フォントの置換が発生している場合には、置換前のフォント情報(フォント指定命令として指定された情報)を登録し、さらにフォント置換が発生したことを示す置換発生情報も登録しておく。
【0037】
ステップS11での判定が文字列描画命令であれば、上記置換発生情報を基にカレントフォントにフォント置換が発生しているか否かを判定する(ステップS13)。フォント置換が発生していなければ、文字間の重なり、文字間隔の不自然な狭まりあるいは広がり(開き)が発生せず、文字間の状態が基準の状態にある訳であるから、カレントフォントの文字コードを取得し(ステップS14)、次いでビットマップイメージ生成部122にてカレントフォントと文字コードに対応する文字のビットマップを生成する処理(ステップS15)に移行する。ここで生成したビットマップについては、ページバッファ141の指定位置へ描画する(ステップS16)。
【0038】
続いて、文字列内の全ての文字の描画が終了したか否かを判定し(ステップS17)、全ての文字の描画が終了していなければ、上述したステップS14〜ステップS16の処理を繰り返して実行する。そして、文字列内の全ての文字の描画が終了したならば、一連の文字描画命令の処理を終了する。
【0039】
ステップS13でフォント置換が発生していたと判定したならば、文字間隔算出部124にて今回の描画文字と次回の描画文字との文字間隔を算出して当該文字間の状態の予測、即ち文字間での重なり、文字間隔の狭まりすぎあるいは広がりすぎの状態を判定し、その判定結果から今回の描画文字に対する拡縮率を求め、文字列の全ての文字に対して拡縮率を拡縮率テーブルとしてRAM14に登録する処理(ステップS18)に移行する。
【0040】
RAM14に登録される拡縮率テーブルを図4に示す。同図から明らかなように、拡縮率テーブルは、カレントフォントに対応する置換前のフォント情報と、出現した文字コードとそれに対応する拡縮率とから構成される。拡縮率テーブルは、出現したフォントの種類分だけ存在する必要がある。この拡縮率テーブルについては、文字列描画命令単位で生成して描画終了後破棄しても良いし、ページ描画単位で生成してページ描画終了後に破棄しても良いし、ジョブ描画単位で生成して破棄しても良い。
【0041】
拡縮率テーブルを文字列描画命令単位で生成して描画終了後破棄することで、同じフォントの描画時の拡縮率が、指定された文字コード列内の同じ文字コード間で等しくなる。拡縮率テーブルをページ描画単位で生成してページ描画終了後に破棄することで、同じフォントの描画時の拡縮率が、同一ページ内の同じフォント属性をもつ同じ文字コード間で等しくなる。拡縮率テーブルをジョブ描画単位で生成して破棄することで、同じフォントの描画時の拡縮率が、同一ジョブ内の同じフォント属性をもつ同じ文字コード間で等しくなる。
【0042】
ここで、同じフォントの描画時の拡縮率を、指定された文字コード列内の同じ文字コード間で等しくする手法を採ることにより、当該拡縮率を文字コード列ごとに更新できることになるため、拡縮率テーブルを格納するRAM14の記憶容量が少なくて済むという利点がある。一方、同じフォントの描画時の拡縮率を、同一ジョブ内の同じフォント属性をもつ同じ文字コード間で等しくする手法を採ることにより、拡縮率テーブルを格納するRAM14の記憶容量が多少大きくなるものの、同一ジョブ全体に亘って同じフォントの描画時の拡縮率を等しくできるため、より見栄えの良い文字列の描画が可能になるという利点がある。
【0043】
これら2つの手法の長所、短所を考慮すると、両者の中間的な位置付けとなる手法である、同じフォントの描画時の拡縮率を、同一ページ内の同じフォント属性をもつ同じ文字コード間で等しくする手法を採るのが好ましいと考えられる。何故ならば、当該手法を採ることにより、拡縮率テーブルを格納するRAM14の記憶容量をあまり大きくしなくとも、同じページ内において文字列単位で拡縮率がばらつかないようにすることができるため、より見栄えの良い文字列の描画が可能になる
【0044】
ステップS18の処理の終了後、カレントフォントの文字コードを取得し、さらに、RAM14に登録されている拡縮率テーブルから、今回の描画文字の置換前フォント情報と文字コードに合致する拡縮率を取得する(ステップS19)。続いて、ビットマップイメージ生成部122にてカレントフォントと文字コードに対応する文字のビットマップを生成する処理(ステップS20)に移行する。この処理の終了後、ビットマップイメージを生成する際に必要な文字サイズをステップS19で取得した拡縮率で修正して拡縮後のビットマップを生成し、この生成したビットマップをページバッファ141の指定位置へ描画する(ステップS21)。
【0045】
続いて、文字列内の全ての文字の描画が終了したか否かを判定し(ステップS22)、終了していなければ、ステップS19〜ステップS21の処理を繰り返して実行する。そして、文字列内の全ての文字の描画が終了したならば、一連の文字描画命令処理を終了する。
【0046】
〔書体選択部123〕
次に、書体選択部123の処理について詳しく説明する。図5は、書体選択部123の処理手順の一例を示すフローチャートである。
【0047】
ここでは、前提として、フォントデータは、図6に示すように、フォント名とフォントファミリ名とフォントの太さと傾きがあるか否かのフラグ(一般的に、Italicと呼ばれる)とで表現されるものとする。また、各々のフォント内に含まれる文字は、文字コードとその文字を描画するデータ(図中では、アウトラインデータとなっているが、ビットマップデータやストロークデータの場合も存在する)と文字の幅と高さとで構成されるものとする。さらに、複数のフォントに対応するために、フォントデータは複数存在するものとする。
【0048】
書体選択部123は、先ず、フォント指定命令からフォント名を取得し(ステップS31)、しかる後取得したフォント名と一致するフォント名を持つフォントデータが存在するか否かを検索する処理(ステップS32)に移行する。そして、この検索処理の結果を基に、フォント名が一致したフォントがフォントデータ内に存在するか否かを判定する(ステップS33)。フォント名が一致したフォントが存在するならば、フォント指定命令によって指定されたフォント名をカレントフォントとして登録し(ステップS34)、次いで「フォント置換発生せず」と登録し(ステップS35)、本書体選択処理を終了する。
【0049】
一方、フォント名が一致したフォントが存在しないならば、フォント指定命令からファミリ名を取得し(ステップS36)、しかる後取得したファミリ名と一致するファミリ名を持つフォントデータが存在するか否かを検索する処理(ステップS37)に移行する。そして、この検索処理の結果を基に、ファミリ名が一致したフォントがフォントデータ内に存在するか否かを判定する(ステップS38)。
【0050】
ファミリ名が一致したフォントが存在したならば、ファミリ名が一致したフォントデータの中からフォント指定命令によって指定された太さおよび傾斜が等しいフォントを選択し(ステップS39)、その選択したフォントをカレントフォントとして登録するとともに、置換前のフォントをカレント置換前フォントとして登録する(ステップS40)。最後に、「フォント置換発生」(これは、先述した置換発生情報に相当する)と登録し(ステップS41)、一連の書体選択処理を終了する。
【0051】
ステップS38において、ファミリ名が一致したフォントがフォントデータ内に存在しないと判定したならば、適当なフォントを選択し(ステップS42)、しかる後ステップS40に移行する。ここで、適当なフォントを選択するとしたのは、ファミリ名が一致しないフォントの場合には、どのフォントを選択しても大差ないからである。以降、選択したフォントをカレントフォントとして登録するとともに、置換前のフォントをカレント置換前フォントとして登録し(ステップS40)、最後に「フォント置換発生」と登録し(ステップS41)、一連の書体選択処理を終了する。
【0052】
〔文字間隔算出部124〕
最後に、文字間隔算出部124の処理について詳しく説明する。図7は、文字間隔算出部124の処理手順の一例を示すフローチャートである。
【0053】
文字間隔算出部124は、先ず、先述した書体選択処理で登録されたカレント置換前フォント情報とカレントフォント情報とを取得する(ステップS51)。続いて、文字描画命令から今回の描画文字の文字コードと描画位置情報、さらに次回の描画文字の描画位置情報を取得する(ステップS52)。この取得した描画文字の文字コードとカレント置換前フォント情報とから任意の文字の拡縮率を決定できることから、これらの情報を基に、RAM14に格納されている拡縮率テーブルの中に、カレント置換前フォントが一致し、かつ、文字コードが一致する計算済みの拡縮率が在るか否かを検索する(ステップS53)。
【0054】
続いて、計算済みの拡縮率の検索結果を判定し(ステップS54)、今回の描画文字について拡縮率が計算されていれば、描画命令中の全ての文字について拡縮率の計算が終了したか否かを判定し(ステップS55)、終了していないのであれば、ステップS52に戻って再び同様の処理を実行する。今回の描画文字について拡縮率が計算されていないと判定したのであれば、以下に説明する拡縮率の計算処理を実行する。
【0055】
図8に、拡縮率に用いられる情報の具体例を示す。図8において、「へ」が今回の描画文字、「と」が次回の描画文字となる。拡縮率の計算処理では、先ず、カレントフォントで指定されるフォントデータ内の文字コードに該当するフォントデータから文字の幅を取得する(ステップS56)。これは、図8において、置換されて描画される文字の幅に相当する。続いて、今回の描画文字の描画開始位置と次回の描画文字の描画開始位置とから描画ピッチを計算する(ステップS57)。通常、描画開始位置は(x,y)二次元座標系で与えられるので、今回の描画文字の描画開始位置を(x1,y1)、次回の描画文字の描画開始位置を(x2,y2)とすると、描画ピッチはy2−y1で求めることができる。
【0056】
このようにして求めた描画ピッチと、置換されて描画される文字の幅との差、即ち(描画ピッチ)−(置換されて描画される文字の幅)が、今回の描画文字と次回の描画文字との文字間隔(負を含む)に相当する。ここで、図8に示すように、描画ピッチは元々描画命令で想定された描画文字の幅と等しいと考えられるので、(描画ピッチ)−(置換前フォントに該当する文字の幅)が先述した基準の状態での文字間隔、即ちフォント指定命令で指定された文字を文字列描画命令に応じて描画した際の文字間隔と言える。この基準の状態での文字間隔は、正規の文字間隔とも言える。
【0057】
そして、この正規の文字間隔を基準値としたときに、描画ピッチと置換されて描画される文字の幅との差、即ち今回の描画文字と次回の描画文字との文字間隔が基準値よりも小さい場合は、今回の描画文字に対して次回の描画文字が重なった状態(文字間隔が負)あるいは文字間が不自然に狭すぎる状態にあり、逆に、基準値よりも大きい場合は、今回の描画文字と次回の描画文字との文字間が不自然に広すぎる(開きすぎる)状態にあると言える。
【0058】
次に、置換されて描画される文字の幅と、求めた描画ピッチとから文字の拡縮率を計算して求める(ステップS58)。すなわち、(描画ピッチ)/(置換されて描画される文字の幅)が拡縮率となる。ここで、描画ピッチは元々描画命令で想定された描画文字の幅と等しいと考えられるので、置換されて描画される文字の幅との比を求めることにより、置換されて描画される文字が次に描画される文字と重ならない、またはそれらの文字間隔が不自然に狭すぎない、あるいは広すぎないようにする、換言すれば当該文字間隔を正規の文字間隔、即ち(描画ピッチ)−(置換前フォントに該当する文字の幅)にするための拡縮率とすることができる。
【0059】
この拡縮率については、そのまま用いることも可能であるし、また求めた拡縮率では大きすぎる、あるいは小さすぎる場合もあり得るので、場合によっては、求めた拡縮率に対して指定されたフォントに依存する定数をかけて用いるようにしても良い。
【0060】
続いて、求めた拡縮率を拡縮率テーブルとしてRAM14に登録し(ステップS59)、しかる後ステップS55へ移行して、描画命令中の全ての文字について拡縮率の計算が終了したか否か判定し、終了していないのであれば、再び上述した一連の拡縮率の計算フローへ戻る。
【0061】
上述したように、使用要求に一致するフォントが存在しない場合に、指定された属性情報が近いフォント、好ましくは最も近いフォントを近似フォントとして選択し、この選択した近似フォントを用いて文字コードと文字描画位置情報を基に文字を出力するに当たって、今回の描画文字と次回の描画文字との文字間の状態を予測し、この予測結果に基づいて今回の描画文字を縮小または拡大して描画することにより、描画後の文字列において、文字が相互に重なったり、文字間隔が狭すぎたりあるいは広すぎたりするのを防止できるため、見栄えの良い文字列の描画を実現できる。
【0062】
特に、文字間の状態を予測するのに、例えば文字間隔算出部124を用い、当該文字間隔算出部124によって今回の描画文字と次回の描画文字との文字間隔を算出してこの算出結果を利用することにより、文字相互が重なる状態、文字間隔が不自然に狭すぎる状態あるいは不自然に広すぎる状態を確実に予測できるため、置換されたフォントを基に描画する文字について最適な縮小処理または拡大処理を行うことができる。
【0063】
なお、上記実施形態において、文字描画処理の概要を説明するのに横書きの場合を例に挙げて説明したが、縦書きの場合にも適用可能である。すなわち、縦書きの場合には、文字の幅(横方向の幅)を文字の高さ(縦方向の幅)に置き換えるだけで、同様の処理を適用することができる。
【0064】
また、上記実施形態では、文字間の状態を予測するのに、文字間隔処理部124を用いて今回の描画文字と次回の描画文字の文字間隔を算出してこの算出結果を基に文字間の状態を予測するとしたが、文字間隔処理部124を用いる手法に限られるものではなく、要は、今回の描画文字と次回の描画文字との文字間の状態を予測できるものであればその構成は問わない。
【0065】
【発明の効果】
以上説明したように、本発明によれば、使用要求に一致するフォントが存在しない場合に、指定された属性情報が最も近いフォントを近似フォントとして選択し、この選択した近似フォントを用いて文字コードと文字描画位置情報を基に文字を出力するに当たり、今回の描画文字と次回の描画文字との間の文字間隔を予測し、この予測した文字間隔に対応する縮小率または拡大率で今回の描画文字を縮小または拡大して描画することにより、描画後の文字列において、文字間の重なりや開きすぎを防止できるため、見栄えの良い文字列の描画を実現できる。
【図面の簡単な説明】
【図1】 本発明の一実施形態に係る画像処理装置の構成の概略を示すブロック図である。
【図2】 文字描画命令の構成の一例を示す図である。
【図3】 文字描画命令処理部の処理手順の一例を示すフローチャートである。
【図4】 拡縮率テーブルの一例を示す図である。
【図5】 書体選択部の処理手順の一例を示すフローチャートである。
【図6】 フォントデータの一例を示す図である。
【図7】 文字間隔算出部の処理手順の一例を示すフローチャートである。
【図8】 拡縮率に用いられる情報の具体例を示す図である。
【図9】 指定されたフォントの幅が置換されたフォントの幅よりも狭い場合の文字列の描画例を示す図である。
【図10】 指定されたフォントの幅が置換されたフォントの幅よりも広い場合の文字列の描画例を示す図である。
【符号の説明】
10…画像処理装置、11…入力I/F、12…CPU、13…ROM、14…RAM、15…プリンタエンジンI/F、20…ネットワーク、30…プリンタエンジン、121…文字描画命令処理部、122…ビットマップイメージ生成部、123…書体選択部、124…文字間隔算出部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and an image processing method for storing a plurality of fonts in advance, selecting a requested font from the plurality of fonts, and performing character output processing corresponding to the font, The present invention relates to an image processing apparatus and an image processing method capable of selecting and drawing a font close to a requested font from the held fonts when the same font as the requested font is not held.
[0002]
[Prior art]
In recent years, documents such as texts and images are electronically created by a computer device such as a personal computer or a workstation, and the created document is output to a computer device such as a printer device via a network, for example, a printer device. Printing output is widely performed.
[0003]
In an image forming system including such a computer device and a printer device, generally, when printing a document, a page description language (hereinafter referred to as “PDL”) is transmitted from the computer device side to the printer device side. The drawing command described in “) is sent out. When a drawing command is sent, the printer device draws a graphic such as text or graphics based on the drawing command received from the computer device.
[0004]
When drawing text, each of the attributes of the font to be drawn as text, the text, and the text drawing position are specified from the computer device side, and the printer device side draws the text based on the specified information. It is common to do it. At this time, not all fonts designated on the computer device side are mounted on the printer device.
[0005]
As described above, when the designated font is not installed in the printer device, conventionally, an appropriate font is selected from a plurality of fonts held by the printer device and drawn (for example, patents). Reference 1). Specifically, the font name and style information (thickness, character shape, family) are stored in association with each font, and if the specified font does not exist, the font name In addition, by drawing with a substitute font based on the style information, it is possible to realize text drawing when the font is not mounted on the printer device side.
[0006]
[Patent Document 1]
JP-A-6-130930
[0007]
[Problems to be solved by the invention]
However, when the designated font does not exist as in the prior art described above, if a method of simply replacing with a different font and drawing is adopted, the font between the designated font and the changed font is changed. When the horizontal width or the vertical width is different, there is a problem that the character spacing of the drawn text is unnaturally widened or conversely narrowed due to the difference in the width.
[0008]
For example, in the case of horizontal writing, drawn characters come into contact with each other if the width of the designated font is narrower than the width of the changed font, and on the contrary, if the width is wide, the character spacing is unnaturally opened. Also, in vertical writing, if the height of the specified font is lower than the height of the changed font, the drawn characters touch each other, and conversely if it is higher, the character spacing is unnaturally opened and drawn. End up.
[0009]
Specifically, taking horizontal writing as an example, if the width of the designated font is narrower than the width of the replaced font, as shown in FIG. Since the drawing start position of is specified with reference to the original narrow font, by replacing with a wide font, characters are drawn overlapping each other at the original font drawing position. Here, a state where the narrow “he” and “to” are replaced with a wide font is shown.
[0010]
On the other hand, when the width of the designated font is wider than the width of the replaced font, as shown in FIG. 10, the drawing start position of each character for drawing a character string is based on the original wide font. Therefore, when the font is replaced with a narrow font, the character spacing is unnaturally widened at the original font drawing position. Here, a state where the wide “he” and “to” are replaced with a narrow font is shown.
[0011]
The present invention has been made in view of the above problems, and the object of the present invention is to overlap between characters when the specified font is replaced with another font and drawn, or the character spacing is too narrow or An object of the present invention is to provide an image processing apparatus and an image processing method capable of rendering a character string having a good appearance while preventing an excessively wide (open) state.
[0012]
[Means for Solving the Problems]
The image processing apparatus according to the present invention selects a desired font from a plurality of fonts in response to a request for using a font based on information specifying an arbitrary font and attribute information of the font, and selects the selected font. Is an image processing apparatus that outputs characters based on character code and character drawing position information, and if there is a font that matches the use request in the plurality of fonts, the font is selected and does not exist In this case, a selecting unit that selects a font having a specified attribute information close as an approximate font, and a drawing unit that draws a character corresponding to the font selected by the selecting unit based on the character code of the font and the character drawing position information When the approximate font is selected by the selection means, the current drawing character by the drawing means and the next drawing character Of a character Character spacing predicting means for predicting character spacing between And the current drawing character by the drawing means The reduction rate or enlargement rate corresponding to the character spacing calculated by the character spacing prediction means And a control means for reducing or enlarging.
[0013]
According to the image processing method of the present invention, a desired font is selected from a plurality of fonts in response to a request for using a font based on information specifying an arbitrary font and attribute information of the font, and the selected font is selected. When outputting a character based on the character code and character drawing position information using, if there is a font that matches the use request among the plurality of fonts, the font is selected, otherwise it is specified When a font with similar attribute information is selected as an approximate font and the approximate font is selected, the current drawn character and the next drawn character Character spacing between Predict this and predicted With a reduction ratio or enlargement ratio corresponding to the character spacing The current drawn character is reduced or enlarged and drawn based on the character drawing position information.
[0014]
In the image processing apparatus or the image processing method having the above configuration, when there is no font that matches the use request, a font having the specified attribute information is selected as an approximate font, and a character code and a character code are selected using the selected approximate font. When outputting characters based on the character drawing position information, the current drawn character and the next drawn character Character spacing between Based on the prediction result, the current drawing character is reduced or enlarged so that the next drawing character does not overlap with the current drawing character, the character spacing is not too narrow, or too wide. draw. Thereby, in the character string after drawing, it is possible to prevent the overlap between characters and the character interval from being too narrow or too wide (too wide), so that it is possible to draw a character string having a good appearance.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. However, here, the case where the present invention is applied to an image processing apparatus mounted on a printer apparatus that prints out a document and an image processing method executed by the image processing apparatus will be described as an example.
[0016]
FIG. 1 is a block diagram showing an outline of the configuration of an image processing apparatus according to an embodiment of the present invention. Image processing apparatus according to this embodiment 10 When a PDL generated by a host computer device (not shown) is received from the computer device via the network 20, the drawing commands described by the received PDL (drawing commands such as straight lines, curves, fonts, raster images, fills, etc.) ) Is processed and the drawn graphic data is stored in the buffer, and the rasterized graphic data generated after the drawing is output to the output device, for example, the printer engine 30 that performs image formation. Have the ability to
[0017]
In order to realize the above-described functions, as is apparent from FIG. 1, the image processing apparatus 10 according to the present embodiment includes an input interface (hereinafter referred to as “I / F”) 11 and a CPU (Central Processing). Unit) 12, a ROM (Read Only Memory) 13, a RAM (Random Access Memory) 14, a printer engine I / F 15, and an internal bus 16 that interconnects these components. Yes.
[0018]
In the image processing apparatus 10, the input I / F 11 receives the PDL sent from the host computer apparatus via the network 20. Here, it is assumed that the PDL received by the input I / F 11 includes the graphic drawing command described above. When drawing a figure, it is assumed that outline data of the figure is given to the input I / F 11 as PDL.
[0019]
In addition to the operation control of the entire image processing apparatus 10, the CPU 12 interprets the PDL received via the input I / F 11, and performs graphic drawing processing based on the interpretation result. This graphic drawing process is performed by the graphic drawing process, raster image drawing process, and character drawing process of the CPU 12. Among these processes, in order to perform a character drawing process, the CPU 12 includes a character drawing command processing unit 121, a bitmap image generation unit 122, a typeface selection unit 123, and a character interval calculation unit 124 as shown in FIG. It has a functional part.
[0020]
The ROM 13 stores in advance a drawing program necessary for the CPU 11 to perform drawing processing. By executing the drawing program in the ROM 13, the CPU 11 implements the above-described processes, that is, the functions of the graphic drawing process, the raster image drawing process, and the character drawing process. The ROM 13 further stores font data for a plurality of fonts for character drawing. This font data is read out by the bitmap image generation unit 122 and used to create a font bitmap.
[0021]
The RAM 14 is used as a work memory when the CPU 11 performs a drawing process. Specifically, it has a page buffer 141 for storing graphic data to be output to the printer engine 30 by drawing a drawing result by the CPU 11. The RAM 14 also stores a character enlargement / reduction ratio (enlargement ratio / reduction ratio) table, which will be described later.
[0022]
The printer engine I / F 15 sends raster data developed from graphic data stored in the page buffer 141 in the RAM 14 to the printer engine 30 while being controlled by the CPU 11. The printer engine 30 may be one that prints raster data using a known electrophotographic technique, or one that prints raster data using a known inkjet printing technique. May be.
[0023]
In this embodiment, the case where a printer device that prints out a document is used as an output device that outputs an image has been described as an example. However, the present invention is not limited to this, and a CRT (Cathode Ray that performs display output) is used. Tube) or the like.
[0024]
In the present embodiment, the PDL transmitted from the host computer device is received via the network 20, but is not received via the network 20, but directly called from an application on the same computer. It does not matter.
[0025]
Next, an outline of each function of the character drawing command processing unit 121, the bitmap image generation unit 122, the typeface selection unit 123, and the character interval calculation unit 124, which are functional units of the CPU 12, in other words, processing operations in the character drawing processing The outline of is briefly described.
[0026]
The PDL sent from the host computer device via the network 20 is interpreted by a graphic drawing command interpreter (not shown) and drawn as raster data in the page buffer 141 of the RAM 14. At this time, the graphics and the raster image are converted into raster data and drawn by a graphic drawing processing unit and a raster image drawing processing unit (not shown).
[0027]
The character drawing command processing unit 121 receives a character drawing command in the PDL transmitted from the host computer device via the network 20 via the graphic drawing command interpreting unit, and performs character drawing processing based on the character drawing command. Do. Here, as shown in FIG. 2, the character drawing command is composed of a font designation command and a character string drawing command. The font designation command includes font name information (font name / family name) and font attribute information (thickness / tilt / size). The character string drawing command includes character string information (number of characters / drawing position / character code × number of characters / character drawing position × number of characters).
[0028]
When the character drawing command processing unit 121 receives the font designation command, the typeface selection unit 123 selects the font designated by the font designation command from a plurality of fonts (typefaces) stored in advance in the ROM 13. I do. At this time, the typeface selection unit 123 sets the font as the current font if there is a designated font among a plurality of fonts, and if it does not exist, the font with the specified attribute information close, preferably Select the nearest font and set it as the current font (approximate font). Details of the font data (see FIG. 6) stored in the ROM 13 will be described later.
[0029]
Subsequently, when the character drawing command processing unit 121 receives the character string drawing command, the bitmap image generating unit 122 receives the character string drawing command, and the bit of the character corresponding to the character code of the current font set by the typeface selection unit 123. A map is generated, and the generated bitmap is drawn at a character drawing position corresponding to the drawing position information in the character string information. At this time, when the designated font does not exist and another font is selected by the typeface selection unit 123, that is, when the font is replaced, the current drawn character and the next drawn character are changed. Performs processing to predict the state between characters.
[0030]
Here, “predict the state between characters” means that the character drawn this time is based on the interval between characters when the character specified by the font specification command is drawn according to the character string drawing command. And the next drawn character are not overlapped, predicted to be too narrow than the reference state, or too wide (too open). As a means for performing this prediction, for example, a character interval calculation unit 124 that performs a process of calculating a character interval (drawing interval) between the current drawn character and the next drawn character is used.
[0031]
The character interval calculation unit 124 calculates a character interval and performs a process of determining a state between characters of the current drawn character and the next drawn character based on the calculated character interval. That is, it is determined whether the calculated character spacing is equal to, smaller, or larger than the reference value corresponding to the reference state. If it is smaller than the reference value, the next drawn character overlaps the current drawn character or the character spacing is unnaturally too narrow. On the other hand, if it is larger than the reference value, the character spacing between the current drawn character and the next drawn character is unnaturally too wide (too open). In either case, the appearance of the character string after drawing becomes a factor.
[0032]
The character interval calculation unit 124 further obtains an enlargement / reduction rate corresponding to each character code based on the determination result of the state between characters, and stores it in the RAM 14 as an enlargement / reduction rate table. After that, the bitmap image generation unit 122 generates a bitmap of characters corresponding to the character code of the current font based on the enlargement / reduction ratio obtained by the character interval calculation unit 124, and the generated bitmap is included in the character string information. Draw at the character drawing position corresponding to the drawing position information.
[0033]
The above process is repeated for all drawing commands. When all the drawing commands have been drawn, the image data is output to the printer engine 30 via the printer engine I / F 15. Thus, the processing for one page is completed, and thereafter, the above-described series of processing is repeatedly executed for each page.
[0034]
Next, a specific example of processing executed in each function unit of the character drawing command processing unit 121, the typeface selection unit 124, and the character interval processing unit 124 will be described.
[0035]
[Character drawing command processing unit 121]
First, the processing of the character drawing command processing unit 121 will be described in detail. FIG. 3 is a flowchart illustrating an example of a processing procedure of the character drawing command processing unit 121.
[0036]
When the character drawing command processing unit 121 receives a character drawing command in the PDL sent from the host computer device via the network 20 via a graphic drawing command interpreting unit (not shown), first, the character drawing command processing unit 121 It is determined whether it is a character string drawing command (step S11). If it is a font designation command, the process proceeds to the typeface (font) selection processing (step S12) by the typeface selection unit 123. In this typeface selection process, the selected font is registered as the current font as will be described in detail later, and if font replacement has occurred, the font information before replacement (designated as a font specification command) Information) is registered, and replacement occurrence information indicating that font replacement has occurred is also registered.
[0037]
If the determination in step S11 is a character string drawing command, it is determined whether font replacement has occurred in the current font based on the replacement occurrence information (step S13). If font replacement has not occurred, there will be no overlap between characters, no unnatural narrowing or spread (opening) between characters, and the state between characters will be in the standard state. The code is acquired (step S14), and then the process proceeds to a process of generating a bitmap of characters corresponding to the current font and the character code in the bitmap image generation unit 122 (step S15). The bitmap generated here is drawn at a designated position in the page buffer 141 (step S16).
[0038]
Subsequently, it is determined whether or not drawing of all the characters in the character string has been completed (step S17). If drawing of all the characters has not been completed, the processes in steps S14 to S16 described above are repeated. Execute. When drawing of all characters in the character string is completed, the series of character drawing command processing ends.
[0039]
If it is determined in step S13 that font substitution has occurred, the character spacing calculation unit 124 calculates the character spacing between the current drawn character and the next drawn character, and predicts the state between the characters, that is, the character spacing. Judgment of overlapping, character spacing too narrow or too wide ,That From the determination result, an enlargement / reduction ratio for the current drawn character is obtained, and the process proceeds to processing for registering the enlargement / reduction ratio for all characters in the character string in the RAM 14 as an enlargement / reduction ratio table (step S18).
[0040]
An enlargement / reduction ratio table registered in the RAM 14 is shown in FIG. As can be seen from the figure, the enlargement / reduction ratio table is composed of font information before replacement corresponding to the current font, the appeared character code, and the enlargement / reduction ratio corresponding thereto. The enlargement / reduction ratio table needs to exist for the types of fonts that have appeared. The enlargement / reduction ratio table may be generated for each character string drawing command and discarded after the drawing is completed, may be generated for each page drawing unit and discarded after the page drawing is completed, or may be generated for each job drawing unit. Can be discarded.
[0041]
By generating the enlargement / reduction ratio table in units of character string drawing commands and discarding them after drawing, the enlargement / reduction ratio at the time of drawing the same font becomes equal between the same character codes in the designated character code string. By generating the enlargement / reduction ratio table in units of page drawing and discarding it after the page drawing is completed, the enlargement / reduction ratio at the time of drawing the same font becomes equal between the same character codes having the same font attribute in the same page. By generating and discarding the enlargement / reduction ratio table for each job drawing unit, the enlargement / reduction ratio at the time of drawing the same font becomes equal between the same character codes having the same font attribute in the same job.
[0042]
Here, the scaling ratio when drawing the same font is the same between the same character codes in the specified character code string. Do By adopting this method, the enlargement / reduction ratio can be updated for each character code string, so that there is an advantage that the storage capacity of the RAM 14 for storing the enlargement / reduction ratio table can be reduced. On the other hand, although the enlargement / reduction ratio at the time of drawing the same font is made equal between the same character codes having the same font attribute in the same job, the storage capacity of the RAM 14 for storing the enlargement / reduction ratio table is slightly increased. Since the enlargement / reduction ratio at the time of drawing of the same font can be made equal throughout the same job, there is an advantage that a character string having a better appearance can be drawn.
[0043]
Considering the strengths and weaknesses of these two methods, the scaling ratio when rendering the same font, which is a method positioned between the two, is made equal between the same character codes having the same font attributes in the same page It is considered preferable to adopt the method. This is because, by adopting this method, the enlargement / reduction ratio does not vary in units of character strings in the same page without increasing the storage capacity of the RAM 14 storing the enlargement / reduction ratio table. Allows better-looking character strings to be drawn
[0044]
After the process of step S18 is completed, the character code of the current font is obtained, and further, the enlargement / reduction rate that matches the pre-replacement font information and character code of the current drawn character is obtained from the enlargement / reduction rate table registered in the RAM 14. (Step S19). Subsequently, the process proceeds to processing of generating a bitmap of characters corresponding to the current font and character code in the bitmap image generation unit 122 (step S20). After this processing is completed, the character size necessary for generating the bitmap image is corrected with the enlargement / reduction ratio acquired in step S19 to generate the enlarged / reduced bitmap, and the generated bitmap is designated in the page buffer 141. Drawing at the position (step S21).
[0045]
Subsequently, it is determined whether or not drawing of all the characters in the character string has been completed (step S22). If not finished, the processes of steps S19 to S21 are repeated. When all the characters in the character string have been drawn, the series of character drawing command processing ends.
[0046]
[Typeface selector 123]
Next, the processing of the typeface selection unit 123 will be described in detail. FIG. 5 is a flowchart illustrating an example of a processing procedure of the typeface selection unit 123.
[0047]
Here, as a premise, as shown in FIG. 6, the font data is represented by a font name, a font family name, and a flag indicating whether there is a font thickness and inclination (generally called Italic). Shall. The characters included in each font are the character code and data for drawing the character (in the figure, it is outline data, but there are also bitmap data and stroke data) and the character width. And height. Further, in order to support a plurality of fonts, a plurality of font data are assumed to exist.
[0048]
The typeface selection unit 123 first acquires a font name from a font designation command (step S31), and then searches for whether there is font data having a font name that matches the acquired font name (step S32). ). Then, based on the result of this search process, it is determined whether or not a font with a matching font name exists in the font data (step S33). If there is a font with a matching font name, the font name designated by the font designation command is registered as the current font (step S34), and then "no font substitution occurs" is registered (step S35). The selection process ends.
[0049]
On the other hand, if there is no font with the matching font name, the family name is acquired from the font designation command (step S36), and then whether or not there is font data having a family name that matches the acquired family name. The process proceeds to search processing (step S37). Then, based on the result of this search process, it is determined whether or not a font with a matching family name exists in the font data (step S38).
[0050]
If there is a font having the same family name, a font having the same thickness and inclination specified by the font specifying command is selected from the font data having the same family name (step S39), and the selected font is selected as the current font. While registering as a font, the font before replacement is registered as the current pre-replacement font (step S40). Finally, “font replacement occurrence” (this corresponds to the above-described replacement occurrence information) is registered (step S41), and the series of font selection processing is terminated.
[0051]
If it is determined in step S38 that the font having the same family name does not exist in the font data, an appropriate font is selected (step S42), and then the process proceeds to step S40. Here, the reason why an appropriate font is selected is that, in the case of a font whose family name does not match, no matter which font is selected, there is not much difference. Thereafter, the selected font is registered as the current font, the pre-replacement font is registered as the pre-replacement font (step S40), and finally "font replacement occurs" is registered (step S41), and a series of font selection processes is performed. Exit.
[0052]
[Character spacing calculator 124]
Finally, the processing of the character spacing calculation unit 124 will be described in detail. FIG. 7 is a flowchart illustrating an example of a processing procedure of the character interval calculation unit 124.
[0053]
First, the character spacing calculation unit 124 acquires the current pre-replacement font information and the current font information registered in the typeface selection process described above (step S51). Subsequently, the character code and drawing position information of the current drawing character and the drawing position information of the next drawing character are acquired from the character drawing command (step S52). Since the enlargement / reduction ratio of an arbitrary character can be determined from the acquired character code of the drawn character and the current pre-replacement font information, the current pre-replacement table is stored in the enlargement / reduction ratio table stored in the RAM 14 based on this information. A search is performed to determine whether there is a calculated enlargement / reduction ratio that matches the font and the character code (step S53).
[0054]
Subsequently, the search result of the calculated enlargement / reduction ratio is determined (step S54). If the enlargement / reduction ratio has been calculated for the current drawing character, whether the enlargement / reduction ratio calculation has been completed for all the characters in the drawing command. (Step S55), and if not completed, the process returns to step S52 and the same process is executed again. If it is determined that the enlargement / reduction ratio is not calculated for the current drawing character, the enlargement / reduction ratio calculation process described below is executed.
[0055]
FIG. 8 shows a specific example of information used for the enlargement / reduction ratio. In FIG. 8, “to” is the current drawn character, and “to” is the next drawn character. In the enlargement / reduction ratio calculation process, first, the character width is obtained from the font data corresponding to the character code in the font data designated by the current font (step S56). This corresponds to the width of the character drawn by replacement in FIG. Subsequently, the drawing pitch is calculated from the drawing start position of the current drawing character and the drawing start position of the next drawing character (step S57). Usually, since the drawing start position is given in the (x, y) two-dimensional coordinate system, the drawing start position of the current drawing character is (x1, y1), and the drawing start position of the next drawing character is (x2, y2). Then, the drawing pitch can be obtained by y2-y1.
[0056]
The difference between the drawing pitch thus obtained and the width of the character drawn after replacement, that is, (drawing pitch) − (width of the character drawn after replacement) is the current drawing character and the next drawing. Corresponds to the character spacing (including negative). Here, as shown in FIG. 8, since the drawing pitch is considered to be equal to the width of the drawing character originally assumed in the drawing command, (drawing pitch) − (character width corresponding to the font before replacement) is described above. It can be said that the character spacing in the reference state, that is, the character spacing when the character designated by the font designation command is drawn according to the character string drawing command. It can be said that the character spacing in this reference state is a regular character spacing.
[0057]
Then, when the regular character spacing is used as a reference value, the difference between the drawing pitch and the width of the character to be drawn, that is, the character spacing between the current drawn character and the next drawn character is larger than the reference value. If it is smaller, the next drawn character overlaps the current drawn character (character spacing is negative) or the character spacing is unnaturally too narrow. Conversely, if it is larger than the reference value, It can be said that the space between the drawn character and the next drawn character is unnaturally too wide (too open).
[0058]
Next, the character enlargement / reduction ratio is calculated and obtained from the width of the character drawn by replacement and the obtained drawing pitch (step S58). That is, (drawing pitch) / (width of characters drawn after replacement) is the enlargement / reduction ratio. Here, since the drawing pitch is considered to be equal to the width of the drawn character originally assumed by the drawing command, the character to be drawn after replacement is calculated by calculating the ratio with the width of the drawn character after replacement. So that they do not overlap with the characters drawn, or the character spacing is not unnaturally too narrow or too wide, in other words, the character spacing is a normal character spacing, that is, (drawing pitch)-(replacement). It is possible to set the enlargement / reduction ratio to the width of the character corresponding to the previous font.
[0059]
This enlargement / reduction ratio can be used as it is, or the obtained enlargement / reduction ratio may be too large or too small, and depending on the case, it depends on the font specified for the obtained enlargement / reduction ratio. You may make it use using the constant to do.
[0060]
Subsequently, the obtained enlargement / reduction ratio is registered in the RAM 14 as an enlargement / reduction ratio table (step S59). Thereafter, the process proceeds to step S55 to determine whether or not the enlargement / reduction ratio calculation has been completed for all characters in the rendering command. If not completed, the flow returns to the above-described series of scaling calculation flow.
[0061]
As described above, when there is no font that matches the usage request, the font with the specified attribute information is selected as the approximate font, preferably the closest font is selected, and the character code and the character are selected using the selected approximate font. When outputting characters based on the drawing position information, predict the state between the current drawn character and the next drawn character, and reduce or enlarge the current drawn character based on this prediction result. Therefore, it is possible to prevent the characters from being overlapped with each other and the character spacing from being too narrow or too wide in the drawn character string, so that a good-looking character string can be drawn.
[0062]
In particular, in order to predict the state between characters, for example, the character interval calculation unit 124 is used, and the character interval calculation unit 124 calculates the character interval between the current drawn character and the next drawn character, and uses this calculation result. By doing so, it is possible to reliably predict the state in which the characters overlap, the character spacing is unnaturally too narrow, or the unnaturally wide state, so the optimal reduction processing or enlargement for characters drawn based on the replaced font Processing can be performed.
[0063]
In the above embodiment, the case of horizontal writing has been described as an example to describe the outline of the character drawing process, but the present invention can also be applied to the case of vertical writing. That is, in the case of vertical writing, the same processing can be applied only by replacing the character width (horizontal width) with the character height (vertical width).
[0064]
In the above embodiment, in order to predict the state between characters, the character spacing processing unit 124 is used to calculate the character spacing between the current drawn character and the next drawn character, and based on the result of the calculation, the character spacing is determined. Although the state is predicted, the method is not limited to the method using the character interval processing unit 124. In short, if the state between characters of the current drawn character and the next drawn character can be predicted, the configuration is It doesn't matter.
[0065]
【The invention's effect】
As described above, according to the present invention, when there is no font that matches the use request, the font having the closest specified attribute information is selected as the approximate font, and the character code is selected using the selected approximate font. When the character is output based on the character drawing position information, the current drawn character and the next drawn character Among Character spacing Predict ,this Predicted Character spacing With corresponding reduction or enlargement By reducing or enlarging the current drawing character, it is possible to prevent the character string after drawing from being overlapped or over-opened, so that it is possible to realize a good-looking character string drawing.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a schematic configuration of an image processing apparatus according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating an example of a configuration of a character drawing command.
FIG. 3 is a flowchart illustrating an example of a processing procedure of a character drawing command processing unit.
FIG. 4 is a diagram illustrating an example of an enlargement / reduction ratio table.
FIG. 5 is a flowchart illustrating an example of a processing procedure of a typeface selection unit.
FIG. 6 is a diagram illustrating an example of font data.
FIG. 7 is a flowchart illustrating an example of a processing procedure of a character interval calculation unit.
FIG. 8 is a diagram showing a specific example of information used for the enlargement / reduction ratio.
FIG. 9 is a diagram illustrating a drawing example of a character string when the width of a designated font is narrower than the width of a replaced font.
FIG. 10 is a diagram illustrating a drawing example of a character string when the width of a designated font is wider than the width of a replaced font.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 ... Image processing apparatus, 11 ... Input I / F, 12 ... CPU, 13 ... ROM, 14 ... RAM, 15 ... Printer engine I / F, 20 ... Network, 30 ... Printer engine, 121 ... Character drawing command processing part, 122: Bitmap image generation unit, 123: Typeface selection unit, 124: Character spacing calculation unit

Claims (4)

任意のフォントを特定する情報とそのフォントの属性情報を基にしたフォントの使用要求に応じて、複数のフォントの中から所望のフォントを選択し、この選択したフォントを用いて文字コードおよび文字描画位置情報を基に文字を出力する画像処理装置であって、
前記複数のフォント中に前記使用要求に一致するフォントが存在する場合はそのフォントを選択し、存在しない場合は指定された属性情報が近いフォントを近似フォントとして選択する選択手段と、
前記選択手段によって選択されたフォントに対応する文字を当該フォントの文字コードおよび文字描画位置情報を基に描画する描画手段と、
前記選択手段によって前記近似フォントが選択されたとき、前記描画手段による今回の描画文字と次回の描画文字との間の文字間隔を予測する文字間隔予測手段と、
前記描画手段による今回の描画文字を前記文字間隔予測手段が予測した前記文字間隔に対応する縮小率または拡大率で縮小または拡大する制御手段と
を備えることを特徴とする画像処理装置。
A desired font is selected from a plurality of fonts in response to a request to use a font based on information specifying an arbitrary font and attribute information of the font, and a character code and a character drawing are performed using the selected font. An image processing apparatus that outputs characters based on position information,
A selection unit that selects a font that matches the use request in the plurality of fonts, and that selects a font having a specified attribute information that is close if the font does not exist;
Drawing means for drawing a character corresponding to the font selected by the selection means based on the character code and character drawing position information of the font;
When the approximate font is selected by the selection unit, a character interval prediction unit that predicts a character interval between the current drawn character and the next drawn character by the drawing unit ;
An image processing apparatus comprising: a control unit that reduces or enlarges a current drawn character by the drawing unit at a reduction rate or an enlargement rate corresponding to the character interval predicted by the character interval prediction unit .
前記制御手段は、前記文字間隔予測手段が予測した文字間隔が、文字列描画命令に応じて描画した際の文字相互間の間隔に対応する基準値よりも小のとき、前記描画手段による今回の描画文字を横書きの場合は横方向に、縦書きの場合は縦方向に縮小する
ことを特徴とする請求項記載の画像処理装置。
When the character interval predicted by the character interval prediction unit is smaller than a reference value corresponding to the interval between characters when drawing according to a character string drawing command, the control unit laterally when drawing characters horizontal, vertical image processing apparatus according to claim 1, wherein the reducing longitudinally for.
前記制御手段は、前記文字間隔予測手段が予測した文字間隔が、文字列描画命令に応じて描画した際の文字相互間の間隔に対応する基準値よりも大のとき、前記描画手段による今回の描画文字を横書きの場合は横方向に、縦書きの場合は縦方向に拡大する
ことを特徴とする請求項記載の画像処理装置。
When the character interval predicted by the character interval prediction unit is larger than a reference value corresponding to the interval between characters when drawing according to a character string drawing command, the control unit laterally when drawing characters horizontal, vertical image processing apparatus according to claim 1, wherein the expanding in the vertical direction in the case of.
任意のフォントを特定する情報とそのフォントの属性情報を基にしたフォントの使用要求に応じて、複数のフォントの中から所望のフォントを選択し、この選択したフォントを用いて文字コードおよび文字描画位置情報を基に文字を出力する画像処理方法であって、
前記複数のフォント中に前記使用要求に一致するフォントが存在する場合はそのフォントを選択し、存在しない場合は指定された属性情報が近いフォントを近似フォントとして選択し、
前記近似フォントを選択したとき、今回の描画文字と次回の描画文字との間の文字間隔を予測し、
この予測した前記文字間隔に対応する縮小率または拡大率で今回の描画文字を縮小または拡大して前記文字描画位置情報を基に描画する
ことを特徴とする画像処理方法。
A desired font is selected from a plurality of fonts in response to a request to use a font based on information specifying an arbitrary font and attribute information of the font, and a character code and a character drawing are performed using the selected font. An image processing method for outputting characters based on position information,
If there is a font that matches the use request among the plurality of fonts, select the font; if not, select a font that is close to the specified attribute information as an approximate font;
When selecting the approximate font, predict the character spacing between the current drawn character and the next drawn character,
An image processing method, wherein a current drawn character is reduced or enlarged at a reduction rate or an enlargement rate corresponding to the predicted character spacing and drawn based on the character drawing position information.
JP2002351978A 2002-12-04 2002-12-04 Image processing apparatus and image processing method Expired - Fee Related JP4140363B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002351978A JP4140363B2 (en) 2002-12-04 2002-12-04 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002351978A JP4140363B2 (en) 2002-12-04 2002-12-04 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2004184718A JP2004184718A (en) 2004-07-02
JP4140363B2 true JP4140363B2 (en) 2008-08-27

Family

ID=32753721

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002351978A Expired - Fee Related JP4140363B2 (en) 2002-12-04 2002-12-04 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP4140363B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4956366B2 (en) * 2007-10-16 2012-06-20 キヤノン株式会社 Image processing device
JP5244370B2 (en) * 2007-11-15 2013-07-24 株式会社日立製作所 Screen design specification creation method, screen design specification creation program, and screen design specification creation device
JP4665981B2 (en) 2008-03-21 2011-04-06 ブラザー工業株式会社 Image processing method, image processing program, and image processing apparatus
JP2010160210A (en) * 2009-01-06 2010-07-22 Sharp Corp Data display apparatus, data display method, computer program therefor, and recording medium with the computer program recorded thereon
JP5900803B2 (en) * 2013-09-18 2016-04-06 コニカミノルタ株式会社 DATA GENERATION DEVICE, DATA GENERATION PROGRAM, AND DATA GENERATION METHOD

Also Published As

Publication number Publication date
JP2004184718A (en) 2004-07-02

Similar Documents

Publication Publication Date Title
CN100449473C (en) Font downloading apparatus and font downloading method
US20100088606A1 (en) Image processing system, server apparatus, client apparatus, control method, and storage medium
US11281849B2 (en) System and method for printable document viewer optimization
KR970008546B1 (en) Character or graphic processing method
JP3576611B2 (en) Character generator and method
JP4140363B2 (en) Image processing apparatus and image processing method
JP5590960B2 (en) Image forming apparatus, image forming method, and program
JP4492082B2 (en) Image output control method, apparatus, and program
US20100118323A1 (en) Image forming apparatus
JPH1063448A (en) Method and system for memory allocation
CN111782158A (en) Method for generating dot matrix font of code spraying equipment and printing equipment
JP4785601B2 (en) Image forming apparatus
JP3749068B2 (en) Printing system, printing apparatus, and print image confirmation method
JPH05298305A (en) Document forming device
JP3215169B2 (en) Character processing apparatus and method
JP3470378B2 (en) Character information output device and method
JPH0777969A (en) Font rasterising device and method thereof
JP2002318680A (en) Image processor and image processing method
JP3863416B2 (en) Drawing apparatus and control method thereof
JPH07334326A (en) Printing system and method for presenting necessary recording time thereof
JPH09254459A (en) Character processing device, character process method and memory
JPH05108292A (en) Character processing method
JP4844364B2 (en) Image processing apparatus and program
JP3220437B2 (en) Output control device and method
JPH08297482A (en) Character processing device and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051124

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070411

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070717

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070918

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: 20080520

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080602

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

Free format text: PAYMENT UNTIL: 20110620

Year of fee payment: 3

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: 20110620

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120620

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130620

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140620

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees