JP2004126311A - Character processor, character processing method, and image forming apparatus - Google Patents

Character processor, character processing method, and image forming apparatus Download PDF

Info

Publication number
JP2004126311A
JP2004126311A JP2002291611A JP2002291611A JP2004126311A JP 2004126311 A JP2004126311 A JP 2004126311A JP 2002291611 A JP2002291611 A JP 2002291611A JP 2002291611 A JP2002291611 A JP 2002291611A JP 2004126311 A JP2004126311 A JP 2004126311A
Authority
JP
Japan
Prior art keywords
character
font
offset
output
fonts
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.)
Pending
Application number
JP2002291611A
Other languages
Japanese (ja)
Inventor
Satoru Orii
織井 悟
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2002291611A priority Critical patent/JP2004126311A/en
Publication of JP2004126311A publication Critical patent/JP2004126311A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)
  • Record Information Processing For Printing (AREA)
  • Document Processing Apparatus (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide character processing technology capable of adjusting character arrangement between a plurality of fonts, adjusting character arrangement balance inside a line, and performing output when characters with the plurality of fonts coexist in one line. <P>SOLUTION: A character processing method of selecting the fonts to be used for the respective characters to be an output object, reading the font data of the selected fonts, and outputting the characters on the basis of the read font data includes a process of deciding an offset regarding the character arrangement for the selected font and a process of deciding the character arrangement on the basis of the offset of the font selected for the character for the respective characters. The offset is decided with one of the selected fonts as a reference for instance. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、文字を適切に配置して出力するための文字処理技術に関し、特にユニコード(UNICODE)などの標準的な文字コード体系を用いて文字を指定する場合に適した文字処理技術に関する。
【0002】
【従来の技術】
文字データを取り扱う装置(コンピュータやプリンタなど)では、通常、各文字に文字コードを割り当て、該文字コードを用いて文字データを特定して処理する構成を採る。このような文字コード体系には、言語やプラットフォームに対応して種々のものが存在しており、通常、英語等の文字種類の少ない言語に対しては、文字を1バイトの文字コードで特定する体系(例えばASCIIコードなど;以下、「1バイト系」と呼ぶ。)が、日本語など文字種類の多い言語に対しては、文字を2バイトの文字コードで特定する体系(例えばJISコードなど;以下、「2バイト系」と呼ぶ。)が採用されている。
【0003】
近年、世界中の文字を表現可能な文字コード体系としてユニコードが提案され、その利用が広まりつつある(非特許文献1参照)。ユニコードでは、言語やプラットフォームに係わらず、すべての文字に2バイトで表される独立した番号を付与しているため、複数の言語が混在する場合や複数のプラットフォームでデータを共有する場合であっても、文字コード体系を切り替えることなく対応することが可能となる。
【0004】
【非特許文献1】ユニコード3.2(Unicode3.2)、ユニコード・コンソーシアム(The Unicode Consortium)、[平成14年9月10日検索]、インターネット<URL:http://www.unicode.org/unicode/reports/tr28/>
【0005】
【発明が解決しようとする課題】
ユニコードに対応している文字処理装置では、受け付けたユニコードに基づいて文字を特定し、装置が利用可能な従来フォントの中から前記特定した文字が含まれるフォントを選択し、前記選択したフォントを用いて前記特定した文字を出力する構成を採る場合が多い。
【0006】
このような構成では、ユニコードで各文字が指定されている文字列を出力する場合に、1ライン中に1バイト系のフォントと2バイト系のフォントとが混在する場合が起こりうる。
【0007】
しかし、1バイト系文字のフォントと、2バイト系文字のフォントとでは、文字を出力する際の基準となる位置(ベースライン)が異なる場合が多く、そのまま出力しようとすると、図6(b)に示すようにライン内の文字配置バランスが崩れ、違和感のある出力結果となってしまうという問題が生じる。
【0008】
そこで、本発明では、1ライン中に複数のフォントによる文字が混在する場合に、複数のフォント間における文字配置を調整し、ライン内の文字配置バランスを整えて出力することができる技術を提供することを目的とする。
【0009】
【課題を解決するための手段】
本発明の文字処理方法は、出力対象となる各文字について、使用するフォントを選択し、選択したフォントのフォントデータを読出し、読み出したフォントデータに基づいて文字を出力する文字処理方法であって、選択したフォントについて文字配置に関するオフセットを決定する第1工程と、文字ごとに、該文字について選択したフォントの前記オフセットに基づいて、文字配置を決定する第2工程と、を備えることを特徴とする。かかる構成によれば、複数のフォント間における文字配置を調整し、ライン内の文字配置バランスを整えて出力することができる。
【0010】
好適には、前記オフセットが、前記選択したフォントのうちの1つを基準として決定されることを特徴とする。かかる構成によれば、出力する文字列の中身に応じて適切に文字配置バランスを調整することが可能となる。
【0011】
好適には、前記オフセットが、出力する文字サイズに応じて決定されることを特徴とする。かかる構成によれば、文字サイズを変えて出力する場合にも適切に文字配置バランスを調整することが可能となる。
【0012】
好適には、出力対象となる各文字がユニコードにより特定されている場合に、第1工程及び第2工程を実行することを特徴とする。かかる構成によれば、ユニコードによる文字が特定されている場合であっても、従来のような位置ずれを起こすことなく文字を出力するこができる。
【0013】
好適には、前記選択したフォントには、1バイト系文字に対応するフォントと2バイト系文字に対応するフォントの少なくとも2つが含まれていることを特徴とする。かかる構成によれば、1バイト系文字に対応するフォント(主に欧文フォント)と2バイト系文字に対応するフォント(主に日本語フォント)が混在する場合であっても、従来のような位置ずれを起こすことなく文字を出力するこができる。
【0014】
本発明の文字処理装置は、出力対象となる各文字について、使用するフォントを選択し、選択したフォントのフォントデータを読出し、読み出したフォントデータに基づいて文字を出力する文字処理装置であって、選択したフォントについて文字配置に関するオフセットを決定する第1手段と、文字ごとに、該文字について選択したフォントの前記オフセットに基づいて、文字配置を決定する第2手段と、を備えることを特徴とする。かかる構成によれば、複数のフォント間における文字配置を調整し、ライン内の文字配置バランスを整えて出力することができる。
【0015】
本発明の画像形成装置は、本発明の文字処理装置を備えることを特徴とする。
【0016】
本発明のプログラムは、本発明の文字処理方法の各工程をコンピュータ上で実行させることを特徴とする。本発明のプログラムは、CD−ROM、磁気ディスク、半導体メモリなどの各種の記録媒体を通じてコンピュータにインストールまたはロードすることができる。
【0017】
なお、本明細書において、「手段」とは、単に物理的手段を意味するものではなく、その「手段」が有する機能をソフトウェアによって実現する場合も含む。また、1つの「手段」が有する機能が2つ以上の物理的手段により実現されても、2つ以上の「手段」の機能が1つの物理的手段により実現されても良い。
【0018】
【発明の実施の形態】
(第1の実施形態)
図面を参照して本発明の第1の実施形態を説明する。図1は、本実施形態のプリンタ1のハードウェア構成を表すブロック図である。
【0019】
プリンタ1は、用紙をプリンタ内に供給する給紙機構10、印字を行う印刷エンジン11、及び用紙をプリンタ機外に排出する排紙機構12等により構成される動力機構部2を備える。印刷エンジン11は、紙送機構、キャリッジ機構、印刷ヘッドなどを含んで構成される。
【0020】
これら動力機構部2を制御し印刷動作を行わせるのは、CPU(プロセッサ)13、ROM14、RAM15、LCDパネル及びLCDコントローラ16、通信インタフェース17等からなるプリンタ制御部3である。CPU13は、内部バスを介して各手段14〜17にアクセス可能に構成されており、ホスト装置から通信インタフェース17を介して送られてくる印刷ジョブに従い、動力機構部2を制御して実際に印刷動作を行なわせる。なお、動力機構部2が独立してCPUを備えていてもよく、その場合は、動力機構部2のCPUが、パラレルインタフェース等を介してCPU13と通信を行い、印刷エンジン11を制御して印刷動作を行わせることになる。
【0021】
動力機構部2、プリンタ制御部3の構成・動作は原則として従来のプリンタ装置の構成・動作と同様である。ただし、本プリンタ1は、1ライン中に複数のフォントによる文字が混在する場合に、文字配置を調整して印刷する機能を備えている点で、従来の構成と異なっている。
【0022】
図2に、プリンタ制御部3における機能構成図を示す。図に示すように、プリンタ制御部3は、受信手段20、解析/文字処理/イメージ生成手段(以下、「解析手段」と呼ぶ。)21、印刷制御手段22、フォントデータ記憶手段23、コード対応フォント記憶手段24、オフセット記憶手段25等を備えて構成される。上記の各手段は、ROM14又はRAM15に格納されるアプリケーションプログラムをCPU13が実行することにより機能的に実現される。なお、プリンタ制御部3は、上記の各手段のほか、一般的なプリンタが備える画像処理(サイズ変換処理、ノイズ除去処理など)手段などを備えることができる。
【0023】
受信手段20は、ホスト装置より、ネットワークを介して、例えばXHTMLTM−Print形式やPostScript形式で印刷ジョブ(印刷データ及び制御コマンド)を受信し、これを受信バッファに格納する。
【0024】
解析手段21は、受信バッファから印刷データを順番に読み出して解析し、後述するように必要に応じて文字配置を調整しながら、ラスタ形式の印刷イメージを1バンド分又は1ページ分生成し、イメージバッファに格納する。また、受信バッファから制御コマンドを順番に読み出し、これを解釈して、印刷制御手段22等に対して所定の指示(印字要求、紙送り要求、給紙/排紙要求など)を出力する。
【0025】
印刷制御手段22は、解析手段21から指示を受け取った場合、印刷エンジン11の紙送機構等を制御して印刷開始に必要な状態を整える。そして、前記指示が印字を要求するものであった場合、所定単位分(例えば1パス分)の印刷イメージをイメージバッファから印刷エンジン11に転送するともに、印刷エンジン11を制御しながら印刷を実行する。
【0026】
フォントデータ記憶手段23は、複数のフォントについて、フォントデータを記憶している。フォントデータは、例えば、フォントヘッダ(フォントID、フォントサイズ、フォントスタイル、フォントウェイトなど)、該フォントに含まれる各文字についての文字ヘッダ(文字ID、文字幅、文字高など)及び文字イメージデータ(例えば、ビットイメージデータ、又はベクトルイメージデータ)等を含んで構成される。フォントデータ記憶手段23は、フォントIDと文字IDを検索キーとして、対応する文字のイメージデータ等を抽出できるデータ構造となっていれば足り、原則として従来のフォントデータと同様のデータ構造とすることができる。例えば、文字IDとして従来の文字コードを用いてもよい。
【0027】
なお、プリンタ1は、通信ネットワークを介してフォントデータをダウンロードしたり、所定の記憶媒体を介してフォントデータをインストールすることで、フォントデータ記憶手段23を更新できる構成となっていることが望ましい。
【0028】
コード対応フォント記憶手段24は、ユニコードで特定される各文字と、該文字を出力する際に用いるフォントとの対応関係を記憶している。コード対応フォント記憶手段24のデータ構造は、例えば図3に示すような、ユニコードと、フォントID及び文字IDの組み合わせとを対応づけた表構造とすることができる。または、ユニコードと既存の文字コードとの変換テーブルと、既存の文字コードで特定される各文字と、該文字を出力する際に用いるフォントとの対応関係を記憶する構成としてもよい。
【0029】
ここで、ユニコードで特定される所定文字について出力可能なフォントが複数ある場合、どのフォントで出力するかについてユーザが指定でき、かかる指定に応じてコード対応フォント記憶手段24を更新できることが望ましい。この場合、ホスト装置において印刷ジョブ中に上記の指定情報を含め、プリンタ1において印刷ジョブから抽出した指定情報に基づいて対応関係を更新する構成や、プリンタに1おいてLCDパネル等16を介してユーザから直接指定を受け付けて対応関係を更新する構成などが考えられる。
【0030】
オフセット記憶手段25は、フォントデータ記憶手段23に記憶される各フォントについて、文字配置に関するオフセットを記憶している。オフセットは、複数のフォントによる文字を1ラインに出力した場合にライン内の文字配置バランスが整うように予め設定されたフォント間の相対的なずれ量であり、例えば横書き出力の場合であれば、所定の文字サイズ(以下、「オフセット設定サイズ」と呼ぶ。)で出力した場合における縦方向(上下方向)のずれ量(ドット数)により表すことができる。オフセット記憶手段25のデータ構造は、例えば図4に示すような、オフセットの基準となるフォントを行とし、オフセットを与えるフォントを列とした、マトリクス構造とすることができる。
【0031】
(文字配置の調整)
以下、図5を参照して、文字配置を調整しながら文字データの印刷イメージを生成する場合の処理フローについて説明する。なお、各ステップは処理内容に矛盾を生じない範囲で任意に順番を変更して又は並列に実行することができる。
【0032】
まず、解析手段21は、受信バッファから印刷データを読み出して解析し、印刷データ中の文字データにユニコードによる文字の指定が含まれているかどうかを判断する(S100)。ユニコードによる文字指定がある場合、1ライン中に複数のフォントによる文字が混在する可能性があるからである。
【0033】
ユニコードによる文字の指定が含まれていない場合、文字データについて従来と同様に印刷イメージを生成する(S109)。
【0034】
一方、ユニコードによる文字指定が含まれている場合は、ユニコードで指定される各文字について使用するフォントを選択する(S101)。具体的には、コード対応フォント記憶手段24を参照して、ユニコードとの対応関係に基づき、各文字についてフォントID及び文字IDを選択する。
【0035】
次に、解析手段21は、ライン(1行又は1列に出力する文字列)ごとに、該ライン中の各文字について選択した使用フォント(以下、「ライン使用フォント」と呼ぶ。)の数に基づいて、ライン内の文字配置調整を行うかどうかを判断する(S102)。
【0036】
ライン使用フォントが1つの場合は、該ラインについて従来と同様に印刷イメージを生成し(S110)、次のラインの処理へ移行する。
【0037】
一方、ライン使用フォントが複数ある場合は、該ラインについて、ライン使用フォントの中から基準となるフォントを決定する(S103)。ライン使用フォントのうちの1つを基準フォントとすることで、出力する文字列の中身に応じて適切にライン内の文字配置バランスを調整することが可能となる。
【0038】
基準フォントの決定方法としては、例えば予め各フォントについて優先度を設定しておき、選択したフォントのうち優先度が最も高いフォントを基準フォントとする構成が考えられる。一方、ユーザが基準フォントを指定できる構成としてもよい。この場合、ホスト装置において印刷ジョブ中に上記の指定情報を含め、プリンタにおいて印刷ジョブから抽出した指定情報に基づいて基準フォントを決定する構成や、プリンタにおいてLCDパネル等を介してユーザから直接指定を受け付けて基準フォントを決定する構成などが考えられる。
【0039】
次に、解析手段21は、オフセット記憶手段25を参照して、前記決定した基準フォントに基づき、ライン使用フォントに対応するオフセットを読み出す(S104)。
【0040】
次に、解析手段21は、ライン使用フォントごとに、オフセット設定サイズと、印刷ジョブで指定された出力文字サイズ(又は、LCDパネル等で指定された出力文字サイズ)とに基づき、出力文字サイズに対応するオフセット(以下、「修正オフセット」と呼ぶ。)を求める(S105)。例えば、オフセット設定サイズが10ポイント、出力文字サイズが20ポイント、オフセットが1ドットの場合、修正オフセットは1×(20/10)=2ドットとなる。
【0041】
次に、解析手段21は、対象とするライン中の各文字について順に、文字配置を調整しながら印刷イメージを生成する(S106〜S108)。
【0042】
具体的には、まずフォントデータ記憶手段23を参照し、処理対象となる文字について選択したフォントID及び文字IDに基づき、該文字のフォントサイズ、文字イメージデータ等を読み出す(S106)。
【0043】
次に、前記読み出した文字イメージデータについて、前記読み出したフォントサイズから、印刷ジョブ等で指定された出力文字サイズへ、サイズ変換する(S107)。サイズ変換は、文字イメージデータの形式(ビットイメージデータやベクトルイメージデータ)に応じて、従来と同様に行うことができる。
【0044】
次に、サイズ変換後の文字イメージデータを、該文字について選択したフォントの修正オフセットに基づき文字配置を調整して(展開位置をずらして)、イメージバッファに格納する(S108)。
【0045】
解析手段21は、処理対象とするライン中の全文字についてS106〜S108までの工程を繰り返し行う。そして、該ラインについて印刷イメージの生成が終了した段階で、次のラインがある場合はS102に戻り、無い場合は次の印刷データ(又は文字データ以外のデータ)の処理へ移行する。
【0046】
図6(a)に横書き出力に対して本発明を適用した場合の例を示す。図に示すように、かかる例では、1ライン中に1バイト系フォントによる「A」「B」等の文字と、2バイト系フォントによる「あ」「い」等の文字が混在して出力されている。また、オフセットは縦方向(上下方向)のずれ量により表されており、1バイト系フォントの修正オフセットは0(すなわち、1バイト系フォント=基準フォント)、2バイト系フォントの修正オフセットは−2ドットとなっている(図において上方向を+方向とする)。図6(a)からわかるように、本発明を適用して文字データを出力した場合、従来のようにオフセットを考慮せずに出力した場合に比べて(図6(b)参照)、複数のフォント間における文字配置がオフセットに基づいて上下方向に調整され、ライン内の文字配置バランスが整って出力されていることがわかる。
【0047】
このように、本実施形態では、ライン内の文字配置バランスが整うように予め設定されたフォント間の相対的なずれ量、すなわち文字配置に関するオフセットを記憶しておき、かかるオフセットに基づいて文字の配置を調整しながら出力する構成としているため、例えばユニコード等の標準的な文字コード体系で文字が指定された結果、1ライン中に複数のフォントによる文字が混在するような場合でも、フォント間の位置ずれを解消して、ライン内の文字配置バランスを良好に保って出力することが可能となる。
【0048】
(その他)
本発明は上記実施形態に限定されることなく、種々に変形して適用することが可能である。
【0049】
例えば、上記実施形態では、使用フォントを選択し、基準フォントを決定し、そして使用フォントそれぞれについて対応するオフセットを求めた上で、ユニコードにより指定された各文字について順に、文字配置を調整しながら印刷イメージを生成する構成としているが、基準フォントを固定とするか、最初の文字について使用するフォントを基準フォントとする等の構成を採用することで、ユニコードにより指定された各文字について順に、使用フォントを選択し、対応するオフセットを求め、文字配置を調整しながら印刷イメージを生成する構成とすることもできる。
【0050】
また例えば、基準フォントからの相対的な位置ずれをオフセットとする代わりに、ライン内に絶対位置を定め、かかる絶対位置からの位置ずれをオフセットとして用いる構成としてもよい(図6(c)参照)。この場合も上記同様、ユニコードにより指定された各文字について順に、使用フォントを選択し、対応するオフセットを求め、文字配置を調整しながら印刷イメージを生成する構成とすることができる。
【0051】
また例えば、上記実施形態では、ユニコードによる文字指定の有無に基づき、1ライン中に複数のフォントによる文字が混在するかどうかを判断する構成としているが、本発明はこのような構成に限られるものではない。例えば、ユニコード以外の標準的な文字コードに基づいて上記判断を行う構成としてもよく、またはプリンタ1において上記判断を行う代わりに、ホスト装置等から混在することを示す情報を受け付けた場合にS101以降の処理を適用する構成としてもよい。
【0052】
また例えば、上記実施形態では、ラインごとに文字位置調整を行うかどうかを判断する構成としているが、印刷ジョブやページごとにかかる判断を行う構成としてもよい。同様に、上記実施形態では、ラインごとに基準フォントを決定する構成としているが、印刷ジョブやページごとに基準フォントを決定する構成としてもよい。
【0053】
最後に、本発明の文字処理技術は、例えばインクジェットプリンタ、レーザプリンタ、ラベルプリンタ等の一般的にプリンタと呼ばれる機器のほか、画像形成機能を備えた種々の情報処理装置(コピー機、ファックス、ハンディターミナルなど)に対しても適用できる。また、プリンタ以外の装置、例えばパソコンや文字表示装置等において文字を出力する場合にも適用可能である。この場合、上記実施形態における印刷データや印刷イメージは、出力データや出力イメージとして把握されることになる。
【0054】
【発明の効果】
本発明によれば、1ライン中に複数のフォントによる文字が混在する場合に、複数のフォント間における文字配置を調整し、ライン内の文字配置バランスを整えて出力することができる。
【図面の簡単な説明】
【図1】第1実施形態におけるプリンタのハードウェア構成を示すブロック図である。
【図2】第1実施形態におけるプリンタ制御部の機能構成図を示すブロック図である。
【図3】コード対応フォント記憶手段のデータ構造を説明するための図である。
【図4】オフセット記憶手段のデータ構造を説明するための図である。
【図5】文字配置を調整しながら印刷イメージを生成する処理の流れを示すフローチャートである。
【図6】本発明を適用した場合の出力例を説明するための図である。
【符号の説明】
1 プリンタ、2 動力機構部、3 プリンタ制御部、10 給紙機構、11印刷エンジン、12 排紙機構、13 CPU、14 ROM、15 RAM、16 LCDパネル及びLCDコントローラ、17 通信インタフェース、20 受信手段、21 解析/文字処理/イメージ生成手段、22 印刷制御手段、23 フォントデータ記憶手段、24 コード対応フォント記憶手段、25 オフセット記憶手段
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a character processing technique for appropriately arranging and outputting characters, and more particularly to a character processing technique suitable for specifying a character using a standard character code system such as Unicode (UNICODE).
[0002]
[Prior art]
In a device that handles character data (such as a computer or a printer), a character code is usually assigned to each character, and character data is specified and processed using the character code. There are various types of such character code systems corresponding to languages and platforms. Usually, for a language with a small number of character types such as English, a character is specified by a one-byte character code. The system (for example, ASCII code; hereinafter, referred to as "1-byte system") has a system for specifying a character by a 2-byte character code (for example, JIS code; Hereinafter, it will be referred to as “2-byte system”).
[0003]
In recent years, Unicode has been proposed as a character code system capable of expressing characters from all over the world, and its use is spreading (see Non-Patent Document 1). In Unicode, regardless of language or platform, every character has an independent number represented by 2 bytes, so when multiple languages are mixed or data is shared by multiple platforms, Can be handled without switching the character code system.
[0004]
[Non-Patent Document 1] Unicode 3.2 (Unicode 3.2), Unicode Consortium (The Unicode Consortium), [Search on September 10, 2002], Internet <URL: http: // www. unicode. org / unicode / reports / tr28 / >>
[0005]
[Problems to be solved by the invention]
In a character processing device that supports Unicode, a character is specified based on the received Unicode, a font including the specified character is selected from conventional fonts that can be used by the device, and the selected font is used. In many cases, the specified character is output.
[0006]
In such a configuration, when outputting a character string in which each character is specified by Unicode, a case may occur in which one-byte fonts and two-byte fonts are mixed in one line.
[0007]
However, there are many cases where the reference position (baseline) for outputting a character differs between a 1-byte character font and a 2-byte character font. As shown in (1), there is a problem that the character arrangement balance in the line is lost, resulting in an unnatural output result.
[0008]
Therefore, the present invention provides a technique that, when characters of a plurality of fonts are mixed in one line, adjusts the character arrangement between the plurality of fonts, and balances the character arrangement in the line to output. The purpose is to:
[0009]
[Means for Solving the Problems]
The character processing method of the present invention is a character processing method for selecting a font to be used, reading font data of the selected font, and outputting characters based on the read font data, for each character to be output. A first step of determining an offset relating to the character arrangement for the selected font; and a second step of determining a character arrangement for each character based on the offset of the font selected for the character. . According to such a configuration, the character arrangement among a plurality of fonts can be adjusted, and the character arrangement within a line can be balanced and output.
[0010]
Preferably, the offset is determined with reference to one of the selected fonts. According to this configuration, it is possible to appropriately adjust the character arrangement balance according to the contents of the character string to be output.
[0011]
Preferably, the offset is determined according to a character size to be output. According to this configuration, it is possible to appropriately adjust the character arrangement balance even when the character size is changed and output.
[0012]
Preferably, when each character to be output is specified by Unicode, the first step and the second step are executed. According to such a configuration, even when a character by Unicode is specified, it is possible to output the character without causing a displacement as in the related art.
[0013]
Preferably, the selected font includes at least two of a font corresponding to 1-byte characters and a font corresponding to 2-byte characters. According to such a configuration, even when a font corresponding to 1-byte characters (mainly a European font) and a font corresponding to 2-byte characters (mainly a Japanese font) are mixed, the conventional position Characters can be output without any shift.
[0014]
The character processing device of the present invention is a character processing device that selects a font to be used for each character to be output, reads font data of the selected font, and outputs a character based on the read font data. A first means for determining an offset related to a character arrangement for a selected font, and a second means for determining a character arrangement for each character based on the offset of the font selected for the character. . According to such a configuration, the character arrangement among a plurality of fonts can be adjusted, and the character arrangement within a line can be balanced and output.
[0015]
An image forming apparatus according to the present invention includes the character processing device according to the present invention.
[0016]
A program according to the present invention causes each step of the character processing method according to the present invention to be executed on a computer. The program of the present invention can be installed or loaded on a computer through various recording media such as a CD-ROM, a magnetic disk, and a semiconductor memory.
[0017]
In this specification, “means” does not simply mean physical means, but also includes a case where functions of the “means” are realized by software. Further, the function of one “means” may be realized by two or more physical means, or the functions of two or more “means” may be realized by one physical means.
[0018]
BEST MODE FOR CARRYING OUT THE INVENTION
(1st Embodiment)
A first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram illustrating a hardware configuration of the printer 1 according to the present embodiment.
[0019]
The printer 1 includes a paper feed mechanism 10 for feeding paper into the printer, a print engine 11 for printing, and a power mechanism 2 including a paper discharge mechanism 12 for discharging paper to the outside of the printer. The print engine 11 includes a paper feed mechanism, a carriage mechanism, a print head, and the like.
[0020]
It is the printer control unit 3 including the CPU (processor) 13, the ROM 14, the RAM 15, the LCD panel and LCD controller 16, the communication interface 17 and the like that controls the power mechanism unit 2 to perform the printing operation. The CPU 13 is configured to be able to access each of the units 14 to 17 via the internal bus, and controls the power mechanism unit 2 according to a print job sent from the host device via the communication interface 17 to actually perform printing. Perform the operation. The power mechanism unit 2 may include an independent CPU. In this case, the CPU of the power mechanism unit 2 communicates with the CPU 13 via a parallel interface or the like, and controls the print engine 11 to perform printing. Operation.
[0021]
The configuration and operation of the power mechanism 2 and the printer controller 3 are basically the same as the configuration and operation of the conventional printer. However, this printer 1 is different from the conventional configuration in that the printer 1 has a function of adjusting the character arrangement and printing when characters of a plurality of fonts are mixed in one line.
[0022]
FIG. 2 shows a functional configuration diagram of the printer control unit 3. As shown in the figure, the printer control unit 3 includes a receiving unit 20, an analysis / character processing / image generation unit (hereinafter, referred to as an “analysis unit”) 21, a print control unit 22, a font data storage unit 23, It comprises a font storage means 24, an offset storage means 25 and the like. Each of the above means is functionally realized by the CPU 13 executing an application program stored in the ROM 14 or the RAM 15. The printer control unit 3 can include image processing (size conversion processing, noise removal processing, etc.) provided in a general printer, in addition to the above-described units.
[0023]
The receiving unit 20 receives a print job (print data and control command) from the host device via a network, for example, in an XHTML -Print format or a PostScript format, and stores it in a reception buffer.
[0024]
The analysis unit 21 sequentially reads and analyzes the print data from the reception buffer, and generates a raster-format print image for one band or one page while adjusting the character arrangement as necessary as described later. Store in buffer. In addition, the control commands are sequentially read from the reception buffer, interpreted, and predetermined instructions (such as a print request, a paper feed request, and a paper feed / discharge request) are output to the print control unit 22 and the like.
[0025]
When receiving an instruction from the analysis unit 21, the print control unit 22 controls the paper feeding mechanism of the print engine 11 and prepares a state necessary for starting printing. When the instruction is a request for printing, a print image of a predetermined unit (for example, one pass) is transferred from the image buffer to the print engine 11 and printing is executed while controlling the print engine 11. .
[0026]
The font data storage means 23 stores font data for a plurality of fonts. The font data includes, for example, a font header (font ID, font size, font style, font weight, etc.), a character header (character ID, character width, character height, etc.) for each character included in the font, and character image data ( For example, it includes bit image data or vector image data). The font data storage means 23 only needs to have a data structure capable of extracting image data and the like of the corresponding character using the font ID and the character ID as search keys, and in principle, have the same data structure as conventional font data. Can be. For example, a conventional character code may be used as the character ID.
[0027]
It is desirable that the printer 1 be configured so that the font data storage means 23 can be updated by downloading font data via a communication network or installing font data via a predetermined storage medium.
[0028]
The code correspondence font storage means 24 stores a correspondence relationship between each character specified by Unicode and a font used when outputting the character. The data structure of the code correspondence font storage means 24 may be a table structure as shown in FIG. 3, for example, in which Unicode is associated with a combination of a font ID and a character ID. Alternatively, a configuration may be employed in which a conversion table between Unicode and existing character codes, a correspondence relationship between each character specified by the existing character codes, and a font used when outputting the characters is stored.
[0029]
Here, when there are a plurality of fonts that can be output for the predetermined character specified by Unicode, it is desirable that the user can specify which font is to be output and that the code corresponding font storage unit 24 can be updated in accordance with the specification. In this case, the host device includes the above-mentioned designation information in the print job, and the printer 1 updates the correspondence relationship based on the designation information extracted from the print job. A configuration in which a correspondence is updated by directly receiving designation from a user may be considered.
[0030]
The offset storage unit 25 stores an offset relating to the character arrangement for each font stored in the font data storage unit 23. The offset is a relative shift amount between fonts set in advance so that the character arrangement balance in a line is balanced when characters of a plurality of fonts are output on one line. For example, in the case of horizontal writing output, It can be represented by the amount of displacement (the number of dots) in the vertical direction (vertical direction) when output is performed in a predetermined character size (hereinafter, referred to as “offset setting size”). The data structure of the offset storage means 25 may be a matrix structure, as shown in FIG. 4, for example, in which a font serving as a reference for an offset is a row and a font to which an offset is given is a column.
[0031]
(Adjustment of character arrangement)
Hereinafter, a processing flow when a print image of character data is generated while adjusting the character arrangement will be described with reference to FIG. The steps can be arbitrarily changed in order or executed in parallel within a range that does not cause inconsistency in the processing contents.
[0032]
First, the analysis unit 21 reads and analyzes the print data from the reception buffer, and determines whether or not the character data in the print data includes a character designation by Unicode (S100). This is because if there is a character designation by Unicode, there is a possibility that characters by a plurality of fonts are mixed in one line.
[0033]
If the character designation by Unicode is not included, a print image is generated for the character data in the same manner as in the related art (S109).
[0034]
On the other hand, when the character designation by Unicode is included, a font to be used for each character designated by Unicode is selected (S101). Specifically, a font ID and a character ID are selected for each character based on the correspondence with Unicode by referring to the code corresponding font storage means 24.
[0035]
Next, for each line (character string output in one line or one column), the analysis unit 21 determines the number of fonts used (hereinafter referred to as “line font”) selected for each character in the line. Based on this, it is determined whether or not to perform character arrangement adjustment within the line (S102).
[0036]
If there is only one line-use font, a print image is generated for the line in the same manner as in the related art (S110), and the process proceeds to the next line.
[0037]
On the other hand, if there are a plurality of line use fonts, a reference font is determined from the line use fonts for the line (S103). By using one of the line fonts as the reference font, it is possible to appropriately adjust the character arrangement balance in the line according to the contents of the character string to be output.
[0038]
As a method of determining the reference font, for example, a configuration in which priorities are set in advance for each font, and a font having the highest priority among the selected fonts is set as the reference font can be considered. On the other hand, a configuration in which the user can specify the reference font may be adopted. In this case, the host device includes the above specified information in the print job, and the printer determines the reference font based on the specified information extracted from the print job, or the printer directly specifies the specified font via the LCD panel or the like. A configuration that accepts and determines a reference font is conceivable.
[0039]
Next, the analysis unit 21 refers to the offset storage unit 25 and reads out an offset corresponding to the line use font based on the determined reference font (S104).
[0040]
Next, the analyzing unit 21 determines the output character size based on the offset setting size and the output character size specified in the print job (or the output character size specified on the LCD panel or the like) for each line use font. A corresponding offset (hereinafter, referred to as “correction offset”) is obtained (S105). For example, when the offset setting size is 10 points, the output character size is 20 points, and the offset is 1 dot, the correction offset is 1 × (20/10) = 2 dots.
[0041]
Next, the analysis unit 21 generates a print image while sequentially adjusting the character arrangement for each character in the target line (S106 to S108).
[0042]
Specifically, first, the font size and character image data of the character to be processed are read based on the font ID and character ID selected for the character to be processed with reference to the font data storage means 23 (S106).
[0043]
Next, the read character image data is subjected to size conversion from the read font size to an output character size specified in a print job or the like (S107). The size conversion can be performed in the same manner as in the related art according to the format of the character image data (bit image data or vector image data).
[0044]
Next, the character image data after the size conversion is stored in the image buffer by adjusting the character arrangement based on the correction offset of the font selected for the character (shifting the development position) (S108).
[0045]
The analysis unit 21 repeats the steps from S106 to S108 for all the characters in the line to be processed. Then, when the generation of the print image for the line is completed, if there is a next line, the process returns to S102, and if there is no next line, the process proceeds to the next print data (or data other than character data).
[0046]
FIG. 6A shows an example in which the present invention is applied to horizontal writing output. As shown in the figure, in such an example, characters such as "A" and "B" using a 1-byte font and characters such as "A" and "I" using a 2-byte font are output in one line. ing. The offset is represented by a shift amount in the vertical direction (vertical direction), and the correction offset of a 1-byte font is 0 (that is, 1-byte font = reference font), and the correction offset of a 2-byte font is -2. It is a dot (the upward direction is the + direction in the figure). As can be seen from FIG. 6A, when character data is output by applying the present invention, a plurality of character data are output as compared with the conventional case where output is performed without considering an offset (see FIG. 6B). It can be seen that the character arrangement between the fonts is adjusted in the vertical direction based on the offset, and the character arrangement within the line is balanced and output.
[0047]
As described above, in the present embodiment, a relative shift amount between fonts, that is, an offset related to the character arrangement, which is set in advance so as to balance the character arrangement within the line, is stored, and the character is offset based on the offset. Since the output is performed while adjusting the arrangement, even if characters are specified in a standard character code system such as Unicode and characters from multiple fonts are mixed in one line, It is possible to eliminate the misalignment and output the characters while keeping a good balance of the character arrangement in the line.
[0048]
(Other)
The present invention is not limited to the above embodiment, but can be applied in various modifications.
[0049]
For example, in the above-described embodiment, a font to be used is determined, a reference font is determined, and a corresponding offset is determined for each of the fonts to be used. Then, for each character specified by Unicode, printing is performed while adjusting the character arrangement in order. The image is generated, but the reference font is fixed, or the font used for the first character is used as the reference font. , A corresponding offset is obtained, and a print image is generated while adjusting the character arrangement.
[0050]
Further, for example, instead of using the relative displacement from the reference font as the offset, an absolute position may be determined in the line, and the displacement from the absolute position may be used as the offset (see FIG. 6C). . In this case, similarly to the above, it is possible to select a font to be used for each character specified by Unicode, obtain a corresponding offset, and generate a print image while adjusting the character arrangement.
[0051]
Further, for example, in the above embodiment, whether or not characters in a plurality of fonts are mixed in one line is determined based on whether or not a character is specified by Unicode. However, the present invention is limited to such a configuration. is not. For example, the configuration may be such that the determination is made based on a standard character code other than Unicode. May be applied.
[0052]
Further, for example, in the above embodiment, whether or not to perform the character position adjustment is determined for each line. However, the determination may be performed for each print job or each page. Similarly, in the above-described embodiment, the reference font is determined for each line. However, the reference font may be determined for each print job or each page.
[0053]
Finally, the character processing technology of the present invention can be applied to various types of information processing apparatuses having image forming functions (copying machines, fax machines, Terminal, etc.). Further, the present invention is also applicable to a case where characters are output by a device other than a printer, for example, a personal computer or a character display device. In this case, the print data and print image in the above embodiment are grasped as output data and output images.
[0054]
【The invention's effect】
According to the present invention, when characters of a plurality of fonts are mixed in one line, the character arrangement between the plurality of fonts can be adjusted, and the character arrangement in the line can be balanced and output.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a hardware configuration of a printer according to a first embodiment.
FIG. 2 is a block diagram illustrating a functional configuration diagram of a printer control unit according to the first embodiment.
FIG. 3 is a diagram for explaining a data structure of a code corresponding font storage unit.
FIG. 4 is a diagram for explaining a data structure of an offset storage unit.
FIG. 5 is a flowchart illustrating a flow of a process of generating a print image while adjusting a character arrangement.
FIG. 6 is a diagram for describing an output example when the present invention is applied.
[Explanation of symbols]
REFERENCE SIGNS LIST 1 printer, 2 power mechanism section, 3 printer control section, 10 paper feed mechanism, 11 print engine, 12 paper discharge mechanism, 13 CPU, 14 ROM, 15 RAM, 16 LCD panel and LCD controller, 17 communication interface, 20 receiving means , 21 analysis / character processing / image generation means, 22 print control means, 23 font data storage means, 24 code correspondence font storage means, 25 offset storage means

Claims (8)

出力対象となる各文字について、使用するフォントを選択し、選択したフォントのフォントデータを読出し、読み出したフォントデータに基づいて文字を出力する文字処理方法であって、
選択したフォントについて文字配置に関するオフセットを決定する第1工程と、
文字ごとに、該文字について選択したフォントの前記オフセットに基づいて、文字配置を決定する第2工程と、を備えることを特徴とする文字処理方法。
A character processing method of selecting a font to be used for each character to be output, reading font data of the selected font, and outputting a character based on the read font data,
A first step of determining an offset relating to the character arrangement for the selected font;
A second step of, for each character, determining a character arrangement based on the offset of the font selected for the character.
前記オフセットが、前記選択したフォントのうちの1つを基準として決定されることを特徴とする請求項1記載の文字処理方法。The method of claim 1, wherein the offset is determined based on one of the selected fonts. 前記オフセットが、出力する文字サイズに応じて決定されることを特徴とする請求項1又は2記載の文字処理方法。3. The character processing method according to claim 1, wherein the offset is determined according to a character size to be output. 出力対象となる各文字がユニコードにより特定されている場合に、第1工程及び第2工程を実行することを特徴とする請求項1乃至3のいずれか1項に記載の文字処理方法。4. The character processing method according to claim 1, wherein the first step and the second step are executed when each character to be output is specified by Unicode. 前記選択したフォントには、1バイト系文字に対応するフォントと2バイト系文字に対応するフォントの少なくとも2つが含まれていることを特徴とする請求項1乃至4のいずれか1項に記載の文字処理方法。5. The font according to claim 1, wherein the selected font includes at least two of a font corresponding to 1-byte characters and a font corresponding to 2-byte characters. Character processing method. 出力対象となる各文字について、使用するフォントを選択し、選択したフォントのフォントデータを読出し、読み出したフォントデータに基づいて文字を出力する文字処理装置であって、
選択したフォントについて文字配置に関するオフセットを決定する第1手段と、
文字ごとに、該文字について選択したフォントの前記オフセットに基づいて、文字配置を決定する第2手段と、を備えることを特徴とする文字処理装置。
A character processing apparatus for selecting a font to be used for each character to be output, reading font data of the selected font, and outputting a character based on the read font data,
First means for determining an offset related to the character arrangement for the selected font;
A second means for determining a character arrangement for each character based on the offset of the font selected for the character.
請求項6記載の文字処理装置を備えることを特徴とする画像形成装置。An image forming apparatus comprising the character processing device according to claim 6. 請求項1乃至5のいずれか1項に記載の文字処理方法をコンピュータで実行させるためのプログラム。A program for causing a computer to execute the character processing method according to claim 1.
JP2002291611A 2002-10-03 2002-10-03 Character processor, character processing method, and image forming apparatus Pending JP2004126311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002291611A JP2004126311A (en) 2002-10-03 2002-10-03 Character processor, character processing method, and image forming apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002291611A JP2004126311A (en) 2002-10-03 2002-10-03 Character processor, character processing method, and image forming apparatus

Publications (1)

Publication Number Publication Date
JP2004126311A true JP2004126311A (en) 2004-04-22

Family

ID=32283162

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002291611A Pending JP2004126311A (en) 2002-10-03 2002-10-03 Character processor, character processing method, and image forming apparatus

Country Status (1)

Country Link
JP (1) JP2004126311A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006195767A (en) * 2005-01-14 2006-07-27 Adobe Syst Inc Column typesetting device, column typesetting program, and recording medium recording this program
JP2015206986A (en) * 2014-04-23 2015-11-19 キヤノン株式会社 Information processor, control method thereof, program and recording medium
US9569705B2 (en) 2013-09-18 2017-02-14 Seiko Epson Corporation Method and system for configuring print character information

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006195767A (en) * 2005-01-14 2006-07-27 Adobe Syst Inc Column typesetting device, column typesetting program, and recording medium recording this program
US9569705B2 (en) 2013-09-18 2017-02-14 Seiko Epson Corporation Method and system for configuring print character information
JP2015206986A (en) * 2014-04-23 2015-11-19 キヤノン株式会社 Information processor, control method thereof, program and recording medium

Similar Documents

Publication Publication Date Title
JP4619899B2 (en) Image forming apparatus, image forming method, and image forming program
JP2005316950A (en) Data processing apparatus, data processing method, printer driver program, print control apparatus, print control method and printing system
JP2006243807A (en) Image processor, image processing method and program
US7973956B2 (en) High speed printing method and apparatus
US20040036903A1 (en) Printing apparatus
US20020060802A1 (en) Image forming apparatus and image forming method for processing data described with structured description language
JP2009053789A (en) Information processor, program, and computer-readable recording medium
JP2004126311A (en) Character processor, character processing method, and image forming apparatus
JP2009146321A (en) Information processor, information processing system, information processing method, information processing program, and recording medium
US8023124B2 (en) Printing apparatus and printing method
JP2004302978A (en) Printer control method, printer driver, and printer system
JPH09319530A (en) Printer driver
JPH1097391A (en) Printer system and print control method
US20040085564A1 (en) Image forming systems and image forming methods
US20040223181A1 (en) Control method relating to image formation and image formation method
JP4132634B2 (en) Document printing processing system and recording medium recording the program
JPH08249138A (en) Method and device for controlling output
JP2006268797A (en) Output data generation device, output data generation method and output data generation program
JP4399701B2 (en) Image forming apparatus and image forming method
JP2010181999A (en) Printing system, printer, and print control program
JP2010188598A (en) Printing apparatus, driver program and printing system
JP2006154912A (en) Document display, print system, method and storage medium
JP2010079620A (en) Image forming system, information processing apparatus, print control method and program
US20060055957A1 (en) Image forming apparatus
JP2005242990A (en) Distributed print processing system, distributed print processing program, distributed print processing method and print request terminal