JP2009271347A - Font plotting device and information processor - Google Patents
Font plotting device and information processor Download PDFInfo
- Publication number
- JP2009271347A JP2009271347A JP2008122146A JP2008122146A JP2009271347A JP 2009271347 A JP2009271347 A JP 2009271347A JP 2008122146 A JP2008122146 A JP 2008122146A JP 2008122146 A JP2008122146 A JP 2008122146A JP 2009271347 A JP2009271347 A JP 2009271347A
- Authority
- JP
- Japan
- Prior art keywords
- glyph
- contour
- command
- pixel
- data
- 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
Links
Images
Abstract
Description
本発明は、アウトラインフォントを描画する技術に関する。 The present invention relates to a technique for drawing an outline font.
グリフ(文字の可視化表現またはその構成部分から大きさ及び意匠を正規化した抽象表現)の形をコンピュータ上で表現するためのデータ形式として、アウトラインフォントが知られている。アウトラインフォントは、グリフの形状を、基準となる点の座標と輪郭線の集まりとして表現する形式である。ここで、必要に応じて、パーツとなるグリフ(以下「パーツグリフ」という)を組み合わせたグリフ(以下「複合グリフ」という)が用いられる。特許文献1は、複合グリフを描画する技術を開示している。特許文献1によれば、各パーツグリフについてキャッシュ上でレンダリングが行われた後、メモリ上でレンダリング結果が合成され、複合グリフが得られる。
An outline font is known as a data format for expressing on a computer the form of a glyph (a visual expression of characters or an abstract expression in which the size and design are normalized from its constituent parts). The outline font is a format that expresses the shape of a glyph as a collection of coordinates and outlines of a reference point. Here, a glyph (hereinafter referred to as a “composite glyph”) that is a combination of glyphs that become parts (hereinafter referred to as “parts glyph”) is used as necessary.
特許文献1に記載の技術によっても、黒い丸に白抜き数字など、パーツグリフのレンダリングをした後に合成するのでは描画できない複合グリフがある。
これに対し本発明は、パーツグリフのアウトライン(輪郭線)を合成した後でレンダリング(塗り潰し)を行う技術を提供する。
Even with the technique described in
On the other hand, the present invention provides a technique for rendering (filling) after synthesizing outlines of part glyphs.
本発明は、マトリクス状に配置された画素の階調を示すデータを記憶するメモリと、グリフの輪郭および前記輪郭の向きを示すグリフデータを記憶した記憶手段から読み出された第1のグリフデータが示す第1のグリフの輪郭線を示すデータを前記メモリに書き込み、さらに前記記憶手段から読み出された第2のグリフデータが示す第2のグリフの輪郭線を示すデータを前記メモリに書き込む輪郭描画手段と、前記メモリに記憶された画素のうち前記輪郭線の内部にある画素を塗り潰す塗り潰し処理であって、2本の輪郭線によって囲まれる領域については前記2本の輪郭線の向きに応じて前記領域が塗りつぶされるか否かが決定される塗り潰し処理を実行する塗り潰し手段とを有するフォント描画装置を提供する。
このフォント描画装置によれば、第1のグリフおよび第2のグリフの輪郭線が描かれた後で塗り潰しが行われる。
The present invention provides a first glyph data read from a memory for storing data indicating gradations of pixels arranged in a matrix, and a storage means for storing glyph data indicating the contour of the glyph and the direction of the contour. The data indicating the contour line of the first glyph indicated by is written in the memory, and the data indicating the contour line of the second glyph indicated by the second glyph data read from the storage means is written in the memory. A filling means for filling a pixel inside the contour line among the pixels stored in the memory, and a region surrounded by the two contour lines is set in the direction of the two contour lines; In accordance with the present invention, there is provided a font drawing apparatus having a filling means for executing a filling process for determining whether or not the region is filled.
According to this font drawing device, the first glyph and the second glyph are drawn after the outlines are drawn.
好ましい態様において、前記塗り潰し処理は、前記マトリクスの1つの行または1つの列を対象線とし、前記対象線に沿って一画素ずつ階調を決定する処理であって、前記対象線と前記輪郭線とが交わる向きに応じて増減するパラメータに応じて前記画素の階調を決定する処理であってもよい。
このフォント描画装置によれば、対象線と輪郭線とが交わる向きに応じて増減するパラメータに応じて画素の階調が決定される。
In a preferred aspect, the filling process is a process of setting one row or one column of the matrix as a target line and determining a gradation for each pixel along the target line, wherein the target line and the contour line In other words, the gradation of the pixel may be determined according to a parameter that increases or decreases depending on the direction in which the and intersect.
According to this font drawing apparatus, the gradation of a pixel is determined according to a parameter that increases or decreases according to the direction in which the target line and the contour line intersect.
別の好ましい態様において、前記パラメータは、前記対象線と前記輪郭線とがある向きで交わるときに増加し、前記対象線と前記輪郭線とが別の向きで交わるときに減少してもよい。
このフォント描画装置によれば、対象線と輪郭線とがある向きで交わるときに増加し、対象線と輪郭線とが別の向きで交わるときに減少するパラメータに応じて画素の階調が決定される。
In another preferable aspect, the parameter may be increased when the target line and the contour line intersect in a certain direction, and may be decreased when the target line and the contour line intersect in another direction.
According to this font drawing device, the gradation of a pixel is determined according to a parameter that increases when the target line and the contour line intersect with each other and decreases when the target line and the contour line intersect with each other. Is done.
また、本発明は、グリフの輪郭および前記輪郭の向きを示すグリフデータを記憶した記憶装置と、描画の対象となるグリフを対象グリフとして、前記対象グリフを特定する情報をスタックし、前記対象グリフが第1のパーツグリフおよび第2のパーツグリフから構成される複合グリフである場合には前記第1のパーツグリフおよび前記第2のパーツグリフを特定する情報をスタックするスタックと、前記スタックから順番に情報を読み出し、前記スタックにまだ情報がスタックされている場合には読み出した情報に対応するグリフデータを対象とする輪郭描画命令を発行し、前記スタックが空になった場合には読み出した情報に対応するグリフデータを対象とする輪郭描画および塗り潰し命令を発行する制御装置と、マトリクス状に配置された画素の階調を示すデータを記憶するメモリと、グリフの輪郭および前記輪郭の向きを示すグリフデータを記憶した記憶手段から読み出された第1のグリフデータが示す第1のグリフの輪郭線を示すデータを前記メモリに書き込み、さらに前記記憶手段から読み出された第2のグリフデータが示す第2のグリフの輪郭線を示すデータを前記メモリに書き込む輪郭描画手段と、前記メモリに記憶された画素のうち前記輪郭線の内部にある画素を塗り潰す塗り潰し処理であって、2本の輪郭線によって囲まれる領域については前記2本の輪郭線の向きに応じて前記領域が塗りつぶされるか否かが決定される塗り潰し処理を実行する塗り潰し手段とを有するフォント描画装置とを有する情報処理装置を提供する。
この情報処理装置によれば、第1のパーツグリフおよび第2のパーツグリフからなる複合グリフが描画される場合、第1のグリフおよび第2のグリフの輪郭線が描かれた後で塗り潰しが行われる。
The present invention also stacks information for specifying the target glyph, with the storage device storing glyph data indicating the outline of the glyph and the direction of the outline, and the glyph to be drawn as the target glyph. Is a composite glyph composed of a first part glyph and a second part glyph, a stack for stacking information identifying the first part glyph and the second part glyph, and in order from the stack If the information is still stacked on the stack, a contour drawing command for glyph data corresponding to the read information is issued, and the read information when the stack is empty And a control device that issues contour drawing and filling commands for glyph data corresponding to the A first glyph contour line indicated by a first glyph data read out from a memory storing data indicating the gradation of a pixel and a storage unit storing glyph contour and glyph data indicating the direction of the contour. Contour writing means for writing data indicating the contour line of the second glyph indicated by the second glyph data read out from the storage means, and writing the data indicating the second glyph data to the memory; Whether or not the region surrounded by the two contour lines is filled according to the direction of the two contour lines, which is a filling process for filling the pixels inside the contour line among the pixels. An information processing apparatus is provided that includes a font drawing apparatus having a filling unit that executes a filling process for which the determination is made.
According to this information processing apparatus, when a composite glyph composed of the first part glyph and the second part glyph is drawn, the filling is performed after the outlines of the first glyph and the second glyph are drawn. Is called.
1.構成
図1は、本発明の一実施形態に係る情報表示装置1のハードウェア構成を示す図である。情報表示装置1は、情報処理装置の一例である。CPU(Central Processing Unit)10は、情報表示装置1の各要素を制御する制御装置である。ROM(Read Only Memory)20は、情報表示装置1の起動・動作に必要なプログラムやデータを記憶する不揮発性の記憶装置である。本実施形態において、ROM20は、フォントに関するデータとしてグリフデータを記憶している。グリフデータとは、グリフの輪郭線および輪郭線の向きを示すデータである(詳細は後述)。RAM(Random Access Memory)30は、CPU10がプログラムを実行する際にワークエリアとして用いられる記憶装置である。表示体40は、供給されたデータに従った画像を表示する装置、この例ではEPD(Electrophoretic Display)である。EPDは、記憶性表示体の一例である。VRAM(Video Random Access Memory)50は、表示するデータの格納に用いられる記憶装置である。表示制御装置60は、CPU10の制御下で、VRAM50に記憶されているデータに従って表示体40を制御する装置である。入力装置70は、ユーザからの指示、データ等の入力に用いられる装置、例えば、ボタン(書き換えボタンやページ送りボタン、決定ボタンなど)・キーパッド・ホイール・レバー・タッチパネル・ペンデバイスなどである。バス80は、要素間のデータや信号の伝送に用いられる伝送路である。バスコントローラ90は、バス80に接続されているすべての装置(モジュール)について、バス権(バスを使用する権利)の調停を行う装置である。フォントプロセッサ100は、フォントの描画に用いられる装置であり、フォント描画装置の一例である。
1. Configuration FIG. 1 is a diagram showing a hardware configuration of an
CPU10・ROM20・RAM30・VRAM50・表示制御装置60・フォントプロセッサ100は、バス80に直接接続されている。この構成により、CPU10・表示制御装置60・フォントプロセッサ100は、それぞれ独立してメモリ(ROM20・RAM30・VRAM50)にアクセスすることができる。CPU10とフォントプロセッサ100間の信号線は、CPU10からフォントプロセッサ100への描画開始命令の供給、およびフォントプロセッサ100からCPU10への描画完了通知の供給に用いられる。CPU10および表示制御装置60間の信号線は、CPU10から表示制御装置60への画面更新(すなわち表示体40への転送命令)の供給に用いられる。この信号線は、表示体40として液晶ディスプレイ等、記憶性表示体でない表示体を用いた場合には不要である。
The
図2は、フォントプロセッサ100の構成を示す図である。メインコントローラ101は、フォントプロセッサ100の各要素を制御する。メインコントローラ101は、レジスタ102を有する。レジスタ102は、例えば、メインコントローラ101が読み出すべきデータのアドレスを記憶するのに用いられる。フォント描画コントローラ103は、フォント描画に必要な情報、例えばアフィン変換パラメータを記憶する。フォント描画コントローラ103はさらに、与えられた命令がDrawCharなのかDrawCharFillなのかを記憶する。DrawCharは、輪郭描画処理の実行を指示する命令である(第1の描画命令の一例)。DrawCharFillは、輪郭描画処理および塗り潰し処理の実行を指示する命令である(第2の描画命令の一例)。輪郭描画モジュール104(輪郭描画手段の一例)は、命令DrawCharまたは命令DrawCharFillが与えられた場合に、輪郭計算処理、描画位置計算処理および輪郭描画処理を行う。まず、輪郭描画モジュール104は、グリフデータを用いてグリフの輪郭を計算する(輪郭計算処理)。また、輪郭描画モジュール104は、輪郭線を描画する画素の位置を計算する(描画位置計算処理)。輪郭描画モジュール104はさらに、計算した輪郭を示すデータをワークメモリ105に書き込む(輪郭描画処理)。複合グリフを描画する場合、輪郭描画モジュール104は、第1のグリフの輪郭を示すデータをワークメモリ105に書き込んだ後さらに第2のグリフの輪郭を示すデータをワークメモリ105に書き込む。ワークメモリ105は、マトリクス状に2次元配置された画素の階調(この例では、塗り潰すか塗り潰さないかの2階調)を示すデータを記憶する、レンダリング用メモリとして用いられる。塗り潰しモジュール106(塗り潰し手段の一例)は、命令DrawCharが与えられた場合に、塗り潰し処理、背景合成処理および転送処理を行う。まず、塗り潰しモジュール106は、輪郭描画モジュール104により描画された輪郭の内部、すなわち輪郭線で囲まれた領域を塗り潰す(塗り潰し処理)。塗り潰し処理において、2本の輪郭線によって囲まれる領域については2本の輪郭線の向きに応じてその領域が塗りつぶされるか否かが決定される(詳細は後述)。塗り潰しモジュール106は、さらに、必要に応じて画素と背景を合成する(背景合成処理)。塗り潰しモジュール106は、さらに、生成した画素のデータを出力する(転送処理)。バスインターフェースモジュール107は、バス80を介してCPU10・ROM20・RAM30等の他の要素との間で信号やデータの入出力を行う。メインバス108およびサブバス109は、要素間のデータや信号の伝送に用いられる伝送路である。
FIG. 2 is a diagram illustrating the configuration of the
輪郭描画モジュール104と塗り潰しモジュール106との間の信号線は、輪郭描画処理の終了の通知に用いられる。フォント描画コントローラ103と塗り潰しモジュール106との間の信号線は、ワークメモリ105のビット幅、データの範囲などの情報の伝送に用いられる。塗り潰しモジュール106とメインバス108との間の信号線は、背景データの伝送、塗り潰し処理の結果の伝送に用いられる。特に説明しないがこれら以外の信号線も、必要なデータや命令の伝送に用いられる。また、2つのワークメモリ105は交互に用いられ、処理の高速化が図られる。
A signal line between the
図3は、情報表示装置1の外観を示す図である。情報表示装置1は、筐体の前面に表示体40の表示面、および入力装置70としてのボタン群を有する。
FIG. 3 is a diagram illustrating an appearance of the
2.動作
続いて、情報表示装置1の動作を説明する。ここではまず、グリフデータの構成について概説し、さらに従来技術および本実施形態のフォント描画方法について概説した後で、情報表示装置1の動作を詳細に説明する。
2. Operation Next, the operation of the
2−1.グリフデータの構成
図4は、グリフデータを例示する図である。グリフデータは、グリフの輪郭(アウトライン)を描くのに用いられる情報を含んでいる。この例で、グリフデータは、端点を特定する情報として点の座標と、2つの端点を結ぶ直線または曲線を特定する情報として直線または曲線を描画するコマンドを含む。D1〜D6は輪郭線上の点を表す。命令Moveは、点位置を移動させる命令である。命令Moveは、移動先の点の座標を引数として含む。命令Lineは、直線(線分)を描画させる命令である。命令Lineは、直線の終点の座標を引数として含む。図4の例では用いられていないが命令Curve2は2次のベジェ曲線を描画させる命令である。命令Curve2は、曲線の終点の座標および1つの制御点の座標を引数として含む。命令Curve3は、3次のベジェ曲線を描画させる命令である。命令Curve3は、曲線の終点の座標および2つの制御点の座標を引数として含む。命令EOCは、グリフデータの終端を示す。点D0は所定の基準点である。命令Move(D1)により、点位置がD0からD1に移動する。命令Line(D2)により、D1からD2まで直線が描画される。命令Line(D3)により、D2からD3まで直線が描画される。命令Curve3(D7,D8,D4)により、D3からD4までD7およびD8を制御点として3次のベジェ曲線が描画される。なお点D7およびD8は図示していない。以下同様にして、グリフデータにより図4に示されるような、向きを持った輪郭線が記述される。図4では理解を助けるためにグリフデータを図形的に示したが、グリフデータは実際には命令および点の座標を含むテキストデータまたはバイナリデータである。
2-1. Configuration of Glyph Data FIG. 4 is a diagram illustrating glyph data. The glyph data includes information used to draw the outline of the glyph. In this example, the glyph data includes a point coordinate as information for specifying an end point and a command for drawing a straight line or a curve as information for specifying a straight line or a curve connecting two end points. D1 to D6 represent points on the contour line. The command Move is a command for moving the point position. The command Move includes the coordinates of the destination point as an argument. The command Line is a command for drawing a straight line (line segment). The command Line includes the coordinates of the end point of the straight line as an argument. Although not used in the example of FIG. 4, the command Curve2 is a command for drawing a quadratic Bezier curve. The command Curve2 includes the coordinates of the end point of the curve and the coordinates of one control point as arguments. The command Curve3 is a command for drawing a cubic Bezier curve. The command Curve3 includes the coordinates of the end point of the curve and the coordinates of two control points as arguments. The instruction EOC indicates the end of glyph data. Point D0 is a predetermined reference point. The command Move (D1) moves the point position from D0 to D1. A straight line is drawn from D1 to D2 by the command Line (D2). A straight line is drawn from D2 to D3 by the command Line (D3). By a command Curve3 (D7, D8, D4), a cubic Bezier curve is drawn from D3 to D4 with D7 and D8 as control points. Points D7 and D8 are not shown. In the same manner, a contour line having an orientation as shown in FIG. 4 is described by the glyph data. In FIG. 4, glyph data is graphically shown to aid understanding, but the glyph data is actually text data or binary data including instructions and point coordinates.
2−2.従来技術および本実施形態のフォント描画方法
2−2−1.True Typeフォントで推奨されている方法
図5は、True Typeフォントで推奨されている描画方法を説明する図である。ここでは、グリフAおよびグリフBの2つのパーツグリフを合成して複合グリフを生成する例を説明する。まず、ROMに記憶されたグリフAおよびグリフBのグリフデータ(図5(A)および(B))は、あらかじめ設けられた輪郭データ用メモリ上で合成される(図5(C))。こうして、複合グリフのグリフデータが輪郭データ用メモリに記憶される。図5(A)−(C)では理解を助けるために図形として示しているが、記憶されているのはビットマップデータではなくグリフデータである。図中の矢印は輪郭線の向きを示している。
2-2. Font rendering method of the related art and the present embodiment 2-2-1. Method Recommended for True Type Font FIG. 5 is a diagram for explaining a drawing method recommended for the True Type font. Here, an example will be described in which two part glyphs, glyph A and glyph B, are combined to generate a composite glyph. First, the glyph data (FIGS. 5A and 5B) of the glyph A and the glyph B stored in the ROM are combined on a contour data memory provided in advance (FIG. 5C). Thus, the glyph data of the composite glyph is stored in the contour data memory. In FIGS. 5A to 5C, graphics are shown to aid understanding, but what is stored is glyph data, not bitmap data. The arrow in the figure indicates the direction of the contour line.
次に、複合グリフのグリフデータを用いて、レンダリング用メモリ上で輪郭線が描画される(図5(D))。レンダリング用メモリが記憶するのはマトリクス状に配置された複数の画素の各々について塗り潰すか塗り潰さないかを示すビットマップデータである。最後に、レンダリング用メモリ上において輪郭線の内部が塗り潰される(図5(E))。この方法によれば、レンダリング用メモリとは別に、輪郭データ用のメモリを設ける必要がある。 Next, a contour line is drawn on the rendering memory using the glyph data of the composite glyph (FIG. 5D). The rendering memory stores bitmap data indicating whether or not to fill each of a plurality of pixels arranged in a matrix. Finally, the inside of the outline is filled in the rendering memory (FIG. 5E). According to this method, it is necessary to provide a memory for contour data separately from the memory for rendering.
2−2−2.特許文献1による方法
図6は、特許文献1による描画方法を説明する図である。ROMに記憶されたグリフAおよびグリフBのグリフデータ(図5(A)および(B))を用いて、あらかじめ設けられたパーツ用キャッシュメモリに、グリフAおよびグリフBの輪郭線がそれぞれ描画される(図6(A)および(B))。パーツ用キャッシュメモリは、ビットマップデータを記憶する。次に、パーツ用キャッシュメモリ上においてグリフAおよびグリフBの輪郭線の内部が塗り潰される(図6(C)および(D))。最後に、レンダリング用メモリ上において塗り潰されたパーツグリフが合成される(図6(E))。
2-2-2. Method According to
この方法によれば、レンダリング用メモリとは別に、パーツ用キャッシュメモリを設ける必要がある。パーツ用キャッシュメモリは、合成するパーツグリフの数ぶん必要である。例えば、3つのパーツグリフを合成する複合グリフを描画するには、3つ分のパーツ用キャッシュメモリが必要である。また、次に説明するようにこの方法では複合グリフを正確に描画できない場合がある。 According to this method, it is necessary to provide a parts cache memory separately from the rendering memory. The part cache memory needs several parts glyphs to be synthesized. For example, to draw a composite glyph that combines three part glyphs, three parts of cache memory are required. In addition, as described below, there are cases where this method cannot accurately draw a composite glyph.
図7は、特許文献1による描画方法では正確に描画できない複合グリフを例示する図である。図7(D)は、得たい結果を示している。この表示を得るための理論上の輪郭線は図(C)に示されるとおりである。この複合グリフは、パーツグリフC(図7(A))およびパーツグリフD(図7(B))から構成される。しかし、これらのパーツグリフに対して特許文献1による描画方法を適用すると、パーツグリフを塗り潰してから合成するため、図7(E)のような結果が得られる。これは、本来得たい結果とは異なるものである。
FIG. 7 is a diagram illustrating a composite glyph that cannot be accurately drawn by the drawing method disclosed in
2−2−3.本実施形態による方法
図8は、本実施形態による描画方法を説明する図である。まず、ROMに記憶されたグリフAのグリフデータ(図5(A))を用いて、レンダリング用メモリにグリフAの輪郭線が描画される(図8(A))。さらに、レンダリング用メモリにグリフAの輪郭線が描画された状態で、グリフBのグリフデータ(図5(B))を用いて、レンダリング用メモリにグリフBの輪郭線が描画される(図8(B))。すなわち、グリフAの輪郭線の上にグリフBの輪郭線が上書きされる。最後に、レンダリング用メモリ上において輪郭線の内部が塗り潰される(図8(C))。
2-2-3. Method According to the Present Embodiment FIG. 8 is a diagram illustrating a drawing method according to the present embodiment. First, using the glyph data of the glyph A stored in the ROM (FIG. 5A), the outline of the glyph A is drawn in the rendering memory (FIG. 8A). Further, with the glyph A outline drawn in the rendering memory, the glyph B outline is drawn in the rendering memory using the glyph B glyph data (FIG. 5B) (FIG. 8). (B)). That is, the outline of glyph B is overwritten on the outline of glyph A. Finally, the inside of the contour line is filled on the rendering memory (FIG. 8C).
この方法によれば、レンダリング用メモリのほかに、輪郭データ用メモリやパーツ用キャッシュメモリを設ける必要はない。また、塗り潰し処理(詳細は後述)においては、2本の輪郭線で囲まれた領域については輪郭線の向きに応じて塗り潰すか塗り潰さないかが決定されるので、図7のような複合グリフも正確に描画できる。 According to this method, it is not necessary to provide a contour data memory and a parts cache memory in addition to the rendering memory. Also, in the filling process (details will be described later), it is determined whether or not the region surrounded by the two contour lines is to be painted or not according to the direction of the contour line. You can draw accurately.
2−3.情報表示装置1の動作
2−3−1.全体動作
図9は、情報表示装置1の動作を示すフローチャートである。図9に示されるフローは、フォントの描画を開始させるイベント、例えば、表示体40に表示される画像を更新するイベントを契機として開始される。ここでは、描画の対象となるグリフ(以下「対象グリフ」という)が図5(E)に示される複合グリフである場合を例に説明する。この複合グリフは、グリフA(図5(A))およびグリフB(図5(B))の2つのパーツグリフから構成される。以下の処理は、CPU10が、ROM20に記憶された制御プログラムに従って動作することにより行われる。
2-3. Operation of information display device 2-3-1. Overall Operation FIG. 9 is a flowchart showing the operation of the
ステップS100において、CPU10は、スタックを空にする。この例でスタックはLIFO(Last In First Out)であり、RAM30上に記憶領域が設けられている。また、CPU10は、レンダリング用メモリを初期化する。
ステップS110において、CPU10は、対象グリフのグリフ番号をスタックに積む(プッシュする)。グリフ番号は、グリフデータを特定する情報の一例である。
In step S100, the
In step S110, the
ステップS120において、CPU10は、スタックからグリフ番号を取得する(ポップする)。スタックはLIFOなので、最も新しいデータが取得される。
ステップS130において、CPU10は、取得したグリフ番号から、そのグリフ番号によって示されるグリフ(以下「取得グリフ」という)が複合グリフであるか判断する。この例でグリフデータは、そのグリフが複合グリフであるか単純グリフ(非複合グリフ)であるかを示すフラグを有しており、CPU10は、ROM20から取得グリフのフラグを読み出して判断する。取得グリフが複合グリフであると判断された場合(S130:YES)、CPU10は、処理をステップS140に移行する。取得グリフが複合グリフでないと判断された場合(S130:NO)、CPU10は、処理をステップS150に移行する。
In step S120, the
In step S130, the
ステップS140において、CPU10は、取得グリフを構成するパーツグリフのグリフ番号をすべてスタックに積む。パーツグリフのグリフ番号はグリフデータに記述されている。CPU10は、ROM20から取得グリフのグリフデータを読み出す。CPU10は、読み出したグリフデータから取得グリフを構成するパーツグリフを特定し、パーツグリフのグリフ番号をスタックに積む。パーツグリフのグリフ番号をスタックに積むと、CPU10は、処理を再びステップS120に移行する。
In step S140, the
ステップS150において、CPU10は、取得グリフのグリフデータを読み出す。
ステップS160において、CPU10は、スタックが空であるか判断する。スタックが空であると判断された場合(S160:YES)、CPU10は、処理をステップS180に移行する。スタックが空でないと判断された場合(S160:NO)、CPU10は、処理をステップS170に移行する。
In step S150, the
In step S160, the
ステップS170において、CPU10は、命令DrawCharを発行する。すなわち、CPU10は、命令DrawCharとともに、取得グリフのグリフデータが記憶されているアドレスをフォントプロセッサ100のレジスタ102に書き込む。
In step S170, the
CPU10から命令DrawCharを受け取ると、フォントプロセッサ100のメインコントローラ101は、フォント描画コントローラ103に、命令がDrawCharであることを記憶させる。さらに、メインコントローラ101は、ROM20からグリフデータを読み出し、輪郭描画モジュール104に、グリフデータに従った輪郭線を描画させる。輪郭描画モジュール104の動作は後述する。輪郭描画モジュール104は、ワークメモリ105に、グリフデータに従った輪郭線を描画する。受け取った命令がDrawCharである場合、塗り潰しモジュール106は処理を行わない。輪郭線の描画が完了すると、フォントプロセッサ100は、CPU10に輪郭線の描画完了を通知する。描画完了を通知されると、CPU10は、処理を再びステップS120に移行する。
When receiving the command DrawChar from the
ステップS180において、CPU10は、命令DrawCharFillを発行する。すなわち、CPU10は、命令DrawCharFillとともに、取得グリフのグリフデータが記憶されているアドレスをフォントプロセッサ100のレジスタ102に書き込む。
In step S180, the
CPU10から命令DrawCharFillを受け取ると、フォントプロセッサ100のメインコントローラ101は、フォント描画コントローラ103に、命令がDrawCharFillであることを記憶させる。さらに、メインコントローラ101は、ROM20からグリフデータを読み出し、輪郭描画モジュール104に、グリフデータに従った輪郭線を描画させる。すなわち、輪郭描画モジュール104は、ワークメモリ105に、グリフデータに従った輪郭線のビットマップデータを書き込む。受け取った命令がDrawCharFillである場合、塗り潰しモジュール106は、ワークメモリ105に記憶されているビットマップデータにおいて、輪郭線で囲まれた領域を塗り潰す塗り潰し処理を行う。塗り潰しモジュール106の動作は後述する。塗り潰し処理が完了すると、フォントプロセッサ100は、CPU10に塗り潰し完了を通知する。塗り潰し完了が通知されると、CPU10は、図9の処理を終了する。
When receiving the command DrawCharFill from the
ここで、図5(E)の複合グリフが描画される場合を例に、具体的な動作例を説明する。この例で、複合グリフのグリフ番号は150であり、グリフAおよびグリフBのグリフ番号はそれぞれ100および10である。まず最初に、スタックにはグリフ番号150が積まれる(ステップS110)。スタックからグリフ番号150が取得される(ステップS120)。グリフ番号150のグリフは複合グリフであるので(S130:YES)、パーツグリフのグリフ番号10および100がスタックに積まれる(ステップS140)。次に、スタックからグリフ番号100が取得される(ステップS120)。グリフ番号100のグリフ(グリフA)は単純グリフであるので(S130:NO)、グリフAのグリフデータが読み出される(ステップS150)。スタックにはまだグリフ番号10が詰まれているので空ではないから(S160:NO)、命令DrawCharが発行される(ステップS170)。ここでグリフAの輪郭線が描画される。次に、スタックからグリフ番号10が取得される(ステップS120)。グリフ番号10のグリフ(グリフB)は単純グリフであるので(S130:NO)、グリフBのグリフデータが読み出される(ステップS150)。スタック空になったので(S160:YES)、命令DrawCharFillが発行される(ステップS180)。ここで、グリフBの輪郭線が上書きされて複合グリフの輪郭線が描画され、さらに輪郭線の内部が塗り潰される。
Here, a specific operation example will be described by taking as an example the case where the composite glyph of FIG. In this example, the glyph number for the composite glyph is 150, and the glyph numbers for glyph A and glyph B are 100 and 10, respectively. First, the glyph number 150 is stacked on the stack (step S110). The glyph number 150 is acquired from the stack (step S120). Since the glyph of the glyph number 150 is a composite glyph (S130: YES), the
2−3−2.輪郭描画モジュール104の動作
本実施形態において、輪郭描画モジュール104は、グリフデータを用いて輪郭線を計算する輪郭計算処理を実行する機能、輪郭線が通る画素すなわち輪郭線を描画すべき位置を計算する描画位置計算処理を実行する機能、および輪郭線が通る画素のデータをワークメモリ105に書き込む輪郭描画処理を実行する機能を有する。ここでは輪郭計算処理および描画位置計算処理の詳細は省略するが、概要は次のとおりである。
2-3-2. Operation of
輪郭計算処理において、輪郭描画モジュール104は、与えられた命令(Move、Line、Curve2、Curve3、EOC)および点の座標に応じて、命令を生成する。輪郭計算処理により生成される命令は、Move、dVectorおよびEOCのいずれかである。命令MoveおよびEOCについては、グリフデータの項で説明したとおりである。命令dVectorは、命令Line、Curve2およびCurve3を所定の最小単位(例えば1画素)まで分解したものであり、輪郭線が通る画素すなわち塗り潰される点を特定する差分ベクトルを示す。
In the contour calculation process, the
描画位置計算処理において、輪郭描画モジュール104は、輪郭計算処理により生成された命令に応じて、ワークメモリ105に輪郭線として書き込まれる画素を特定する命令およびパラメータを生成する。描画位置計算処理により生成される命令は、Move、dVectorおよびEOCのいずれかである。また、描画位置計算処理により生成されるパラメータは、巻き数変化量dwnおよびストロークstrokeを含む。巻き数変化量dwnは、輪郭線の向きの変化を表す。輪郭線の向きは、ある基準線(例えば、その画素を通る水平線)と輪郭線が交わる向きにより定義される。基準線に対し輪郭線が下から上に向いている場合はdwn=1であり、基準線と輪郭線とが平行である場合はdwn=0であり、基準線に対し輪郭線が上から下に向いている場合はdwn=−1である。ストロークstrokeは、輪郭線がその画素を通ったことを示す。stroke=1の場合は輪郭線が通ったことを、stroke=0の場合は輪郭線が通っていないことを示す。
In the drawing position calculation process, the
図10は、輪郭描画モジュール104の動作、特に輪郭描画処理を示すフローチャートである。ステップS200において、輪郭描画モジュール104は、描画位置計算処理から与えられた命令がEOCであるか判断する。与えられた命令がEOCであると判断された場合(S200:YES)、輪郭描画モジュール104は、処理をステップS208に移行する。与えられた命令がEOCでないと判断された場合(S200:NO)、輪郭描画モジュール104は、処理をステップS201に移行する。
FIG. 10 is a flowchart showing the operation of the
ステップS201において、輪郭描画モジュール104は、与えられた命令がMoveであるか判断する。与えられた命令がMoveであると判断された場合(S201:YES)、ワークメモリ105にアクセスする必要がないので、輪郭描画モジュール104は、その画素については何も処理をしない。与えられた命令がMoveでないと判断された場合(S201:NO)、すなわち、命令dVectorが与えられた場合、輪郭描画モジュール104は、処理をステップS202に移行する。
In step S201, the
ステップS202において、輪郭描画モジュール104は、stroke=0かつdwn=0であるか判断する。stroke=0かつdwn=0であると判断された場合(S202:YES)、ワークメモリ105にアクセスする必要がないので、輪郭描画モジュール104は、その画素については何も処理をしない。stroke=0かつdwn=0でないと判断された場合(S202:NO)、輪郭描画モジュール104は、処理をステップS203に移行する。
In step S202, the
ステップS203において、輪郭描画モジュール104は、画素の位置から、その画素のデータを記憶しているワークメモリ105のアドレスを算出する。
ステップS204において、輪郭描画モジュール104は、ワークメモリ105のうちステップS203で算出されたアドレスから、画素のデータを読み出す。この例で画素のデータは、ストロークstroke(ストローク情報)および巻き数変化量dwnを含んでいる。複合グリフの場合はもちろん、単純グリフの場合でも、1つの画素で線が交わる場合など、ある画素に対して処理が複数回行われることがある。したがって、既に処理が行われた画素については、初期値以外のストローク情報および巻き数変化量dwnが記録されている。
In step S <b> 203, the
In step S204, the
ステップS205において、輪郭描画モジュール104は、ストローク情報を上書きする。描画位置計算処理から与えられたストロークがstroke=0である場合、輪郭描画モジュール104は、その画素のストローク情報を変更しない。与えられたストロークがstroke=1である場合、輪郭描画モジュール104は、その画素のストローク情報を、「1」に変更する。ステップS206において、輪郭描画モジュール104は、画素の巻き数変化量にdwnを加算する。例えば、画素の巻き数変化量として「2」が記憶されており与えられた巻き数変化量dwn=+1であった場合、画素の巻き数変化量は「3」となる。ステップS207において、輪郭描画モジュール104は、更新したデータでワークメモリ105上のデータを上書きする。
In step S205, the
ステップS208において、輪郭描画モジュール104は、輪郭描画処理が終了したことを塗り潰しモジュール106に通知する。
In step S208, the
2−3−3.塗り潰しモジュール106の動作
図11は、フォントプロセッサ100の塗り潰しモジュール106の動作を示すフローチャートである。本実施形態において、塗り潰しモジュール106は、輪郭線の内部を塗りつぶす塗りつぶし処理、グリフの画像と背景を合成する背景合成処理、および生成されたデータをVRAM50に転送する転送処理を実行する機能を有する。図11のフローは、図10のステップS208において輪郭描画モジュール104から塗り潰しモジュール106に輪郭描画処理の終了が通知されたことを契機として開始される。
2-3-3. Operation of
ステップS300において、塗り潰しモジュール106は、パラメータyを初期化する。ビットマップデータにおける画素はxy座標系を用いて特定される。xy座標系は、マトリクス状に配置された画素の左上端の画素を原点とし、右方向がx軸の正方向、下方向がy軸の正方向である。パラメータxおよびyは、画素の座標を示す。この例で、塗り潰しモジュール106は、y=yMinとしてパラメータyを初期化する。yMinはフォントが描画される領域のy座標の最小値である。以下、マトリクス状に配置された複数の画素のうちパラメータyで特定される行を「対象行」という。
In step S300, the filling
ステップS301において、塗り潰しモジュール106は、まだ対象行となっていない行があるか、具体的にはパラメータyがy≦yMaxを満たすか判断する。yMaxはフォントが描画される領域のy座標の最大値である。まだ処理されていない行があると判断された場合(S301:YES)、塗り潰しモジュール106は、処理をステップS302に移行する。処理されていない行はないと判断された場合(S301:NO)、塗り潰しモジュール106は、図11の処理を終了する。
In step S <b> 301, the filling
ステップS302において、塗り潰しモジュール106は、パラメータwnを初期化、すなわちパラメータwnにゼロを代入する。パラメータwnは巻き数(winding number)を示す。巻き数は、対象行と輪郭線とがある向き(例えば、上向き)で交わるときに増加し、対象行と輪郭線とが別の向き(例えば、下向き)で交わるときに減少する。
In step S302, the filling
ステップS303において、塗り潰しモジュール106は、パラメータxを初期化する。この例で、塗り潰しモジュール106は、x=xMinとしてパラメータxを初期化する。xMinはフォントが描画される領域のx座標の最小値である。塗り潰し処理において対象行のうちパラメータxで特定される画素を「対象画素」という。
In step S303, the filling
ステップS304において、塗り潰しモジュール106は、対象行の中にまだ対象画素となっていない画素があるか、具体的にはパラメータxがx≦xMaxを満たすか判断する。xMaxはフォントを描画する領域のx座標の最大値である。まだ対象画素となっていない画素があると判断された場合(S304:YES)、塗り潰しモジュール106は、処理をステップS306に移行する。対象画素となっていない画素は無いと判断された場合(S304:NO)、塗り潰しモジュール106は、処理をステップS305に移行する。
In step S304, the filling
ステップS305において、塗り潰しモジュール106は、パラメータyを更新する。この例で、塗り潰しモジュール106は、y=y+1としてパラメータyを更新する。パラメータyを更新すると、塗り潰しモジュール106は、処理をステップS301に移行する。
In step S305, the filling
ステップS306において、塗り潰しモジュール106は、対象画素の背景データ(背景の階調を示すデータ)を、ワークメモリ105に書き込む。背景データは、例えばRAM30から読み出される。
In step S <b> 306, the filling
ステップS307において、塗り潰しモジュール106は、ワークメモリ105に記憶されている輪郭を示すビットマップデータ(輪郭データ)から、巻き数変化量wdnを取得する。詳細には以下のとおりである。塗り潰しモジュール106は、パラメータxおよびyから、対象画素のデータを記憶しているアドレスを算出する。塗り潰しモジュール106は、算出されたアドレスから対象画素のデータを読み出す。塗り潰しモジュール106は、読み出されたデータから巻き数変化量wdnを抽出する。
In step S <b> 307, the filling
ステップS308において、塗り潰しモジュール106は、パラメータwnの値をwn=wn+dwnとして更新する。パラメータwnは対象行が更新されるたびにゼロに初期化される(ステップS302)から、パラメータwnは、対象行を基準点(この例では左端点)から1画素ずつ順番に、巻き数変化量wdnを積算した値である。
In step S308, the filling
図12は、巻き数wnの変化を例示する図である。図12(A)は、輪郭が描画されたビットマップデータの一部を示す。この例では、4本の輪郭線が描かれている。マトリクスの上部に記載されている矢印は、輪郭線の向きを示している。図12(B)は、図12(A)のビットマップデータのうち上から2行目の画素の巻き数の変化を示している。処理の始点(左端点)においては巻き数wnの初期値としてゼロが与えられる。1画素ずつ右に向かって処理され、輪郭線が現れるたびにその向きに応じて巻き数が増加または減少する。 FIG. 12 is a diagram illustrating a change in the number of turns wn. FIG. 12A shows a part of bitmap data in which a contour is drawn. In this example, four contour lines are drawn. An arrow written at the top of the matrix indicates the direction of the contour line. FIG. 12B shows a change in the number of turns of the pixels in the second row from the top in the bitmap data of FIG. At the start point (left end point) of processing, zero is given as the initial value of the number of turns wn. Each pixel is processed toward the right, and the number of turns increases or decreases each time a contour line appears.
再び図11を参照する。ステップS309において、塗り潰しモジュール106は、画素を塗り潰す条件が満たされたか判断する。ここでは、画素を塗り潰す条件として、巻き数wnとストロークstrokeの値が、(wn,stroke)=(0,0)以外であるという条件が用いられる。画素を塗り潰す条件が満たされたと判断された場合(S309:YES)、塗り潰しモジュール106は、処理をステップS310に移行する。画素を塗り潰す条件が満たされていないと判断された場合(S309:NO)、塗り潰しモジュール106は、処理をステップS311に移行する。
Refer to FIG. 11 again. In step S309, the filling
ステップS310において、塗り潰しモジュール106は、対象画素を塗り潰す。すなわち、対象画素の階調(カラー表示の場合、各色要素の階調)を指定された値にする。
In step S310, the
ステップS311において、塗り潰しモジュール106は、パラメータxをx=x+1として更新する。これにより対象画素が更新される。対象画素を更新すると、塗り潰しモジュール106は、処理をステップS304に移行する。
In step S311, the filling
以上の処理により、ワークメモリ105に記憶された輪郭線のビットマップデータの内部は塗りつぶされる。塗り潰しモジュール106は、こうして生成されたデータを、バスインターフェースモジュール107およびバス80を介してVRAM50に転送する。塗り潰し処理が完了すると、フォントプロセッサ100は、塗り潰し処理の完了をCPU10に通知する。
Through the above processing, the outline bitmap data stored in the
3.複数の文字を描画する例
以上において、1文字の複合グリフとして描画する例について説明したが、ここでは、複数の文字を示すグリフ「い」「ろ」「は」および「に」を含むグリフセットを一連の処理で描画する例を説明する。
3. An example of drawing a plurality of characters In the above, an example of drawing as a single character composite glyph has been described. Here, glyph sets including a plurality of characters “i”, “ro”, “ha”, and “ni” are shown. An example of drawing a series of processes will be described.
図13は、複数の文字を描画する場合の情報表示装置1の動作を示すフローチャートである。図13に示されるフローは、フォントの描画を開始させるイベント、例えば、表示体40に表示される画像を更新するイベントを契機として開始される。描画すべき複数の文字は、CPU10により指定される。
FIG. 13 is a flowchart showing the operation of the
ステップS500において、CPU10は、CPU10は、スタックを空にする。スタックはLIFOであり、RAM30上に記憶領域が設けられている。また、CPU10は、レンダリング用メモリを初期化する。
ステップS510において、CPU10は、一連の処理の対象となる複数のグリフのグリフ番号を、順番にスタックに積む。この例で、グリフ番号は、「に」、「は」、「ろ」、「い」の順番でスタックに積まれる。
In step S500, the
In step S510, the
ステップS520において、CPU10は、描画すべきグリフがあるか、すなわちスタックに積まれているグリフ番号があるか判断する。描画すべきグリフがあると判断された場合(S520:YES)、CPU10は、処理をステップS530に移行する。描画すべきグリフが無いと判断された場合(S520:NO)、CPU10は、処理をステップS580に移行する。
In step S520, the
ステップS530において、CPU10は、スタックからグリフ番号を読み出す。スタックはLIFOなので、読み出されるのは最も新しいグリフ番号である。
ステップS540において、CPU10は、読み出したグリフ番号により示されるグリフを対象グリフとして、命令DrawCharを発行する。命令DrawCharが発行されたときのフォントプロセッサ100の動作は既に説明したとおりである。
In step S530, the
In step S540, the
ステップS550において、CPU10は、レンダリング用メモリに余裕があるか判断する。「レンダリング用メモリに余裕がある」とは、レンダリング用メモリの記憶領域のうち、未使用の領域の大きさに関する所定の条件が満たされることをいう。「所定の条件」としては、例えば、現にレンダリング用メモリに書き込まれているグリフの数が所定のしきい値を超えたという条件が用いられる。あるいは、レンダリング用メモリの幅すなわち容量を、すべてのグリフの中で最長の幅を持つグリフの幅で割った値をしきい値として、レンダリング用メモリに書き込まれたグリフの数がそのしきい値に達したという条件が用いられてもよい。さらにあるいは、レンダリング用メモリのうちまだデータが書き込まれていない部分の容量が所定のしきい値よりも小さくなったという条件が用いられてもよい。レンダリング用メモリに余裕があると判断された場合(S550:YES)、CPU10は、処理をステップS520に移行する。レンダリング用メモリに余裕がないと判断された場合(S550:NO)、CPU10は、処理をステップS560に移行する。
In step S550, the
ステップS560において、CPU10は、ダミーデータすなわち空のグリフデータを読み出す。ステップS570において、CPU10は、ダミーデータを対象グリフのデータとして命令DrawCharFillを発行する。ダミーデータを読み出すのは、誤動作を防ぐためである。命令DrawCharFillが発行されたときのフォントプロセッサ100の動作は、既に説明したとおりである。命令DrawCharFillを発行すると、CPU10は、レンダリング用メモリを初期化し、処理をステップS520に移行する。
In step S560, the
ステップS580において、CPU10は、ダミーデータを読み出す。ステップS590において、CPU10は、ダミーデータを対象グリフのデータとして命令DrawCharFillを発行する。命令DrawCharFillを発行すると、CPU10は、図13のフローを終了する。ステップS580およびS590でダミーデータをロードし、命令DrawCharFillを発行するのは、輪郭線が描画されているがまだ塗り潰されていないグリフが存在する可能性があるためである。
In step S580, the
図14−16は、図13の処理の効果を説明する図である。図14は、各グリフの大きさおよびVRAM50上の描画範囲すなわちそのグリフが使用するVRAM50上の領域を示す図である。この例で、グリフ「い」は幅が10画素であり、VRAM50上において、x座標が2≦x≦11の範囲に描画される。グリフ「ろ」、「は」および「に」についても図14に示されているとおりである。「い」、「ろ」、「は」および「に」の4つのグリフは、VRAM50上において、x座標が2≦x≦54の範囲に描画される。
FIGS. 14-16 is a figure explaining the effect of the process of FIG. FIG. 14 is a diagram showing the size of each glyph and the drawing range on the
図15は、各グリフを個別に描画した場合、すなわち、本実施形態に係る描画方法を適用しなかった場合のメモリアクセス量を示す図である。この例で、メモリアクセスは1ワードを単位として行われる。1ワードは32ビットである。図15の表の左半分は、ワークメモリ105へのアクセスを示している。ワークメモリ105上において、1つの画素には2ビットが割り当てられている。グリフ「い」は幅が10画素であるから、メモリアクセス量は1ワードになる。グリフ「い」の高さは9画素であるので、1×9=9ワードのメモリアクセスが必要である。グリフ「ろ」、「は」および「に」についても図15に示されているとおりである。ワークメモリ105に対して、計40ワードのメモリアクセスが必要である。
FIG. 15 is a diagram showing the memory access amount when each glyph is drawn individually, that is, when the drawing method according to the present embodiment is not applied. In this example, memory access is performed in units of one word. One word is 32 bits. The left half of the table of FIG. 15 shows access to the
図15の表の右半分は、VRAM50へのアクセスを示している。VRAM50上において、1つの画素には1ビットが割り当てられている。VRAM50上において、メモリアクセスは、1ワードごとに区切られた領域、この例では、0≦x≦31、32≦x≦63の領域を単位として行われる。例えば、グリフ「い」はx座標が2≦x≦11の範囲に描画されるので、幅1ワード×高さ9画素=9ワードのメモリアクセスが必要である。また、グリフ「は」はx座標が30≦x≦40の範囲に描画されるので2つの領域をまたいでおり、幅2ワード×高さ10画素=20ワードのメモリアクセスが必要である。グリフ「ろ」および「に」についても図15に示されているとおりである。VRAM50に対して、計50ワードのメモリアクセスが必要である。ワークメモリ105へのアクセスおよびVRAM50へのアクセスを合わせると、合計で90ワードのメモリアクセスが必要である。
The right half of the table of FIG. 15 shows access to the
図16は、本実施形態に係る描画方法によるメモリアクセス量を示す図である。本実施形態によれば、4つのグリフはグリフ「いろはに」としてメモリアクセスが行われる。この場合、ワークメモリ105に対して44ワード、VRAM50に対して22ワードの計66ワードのメモリアクセスが必要になる。これは図15で説明した個別で描画する場合よりもメモリアクセス量が低減されている。
FIG. 16 is a diagram showing the memory access amount by the drawing method according to the present embodiment. According to this embodiment, four glyphs are accessed as a glyph “Irohani”. In this case, a total of 66 words of memory access are required, 44 words for the
以上で説明したように、本実施形態によれば、複数の文字を複数のグリフからなる複合グリフのように扱うことで、メモリアクセスが低減される。ワークメモリ105の方がVRAM50よりも高速である場合が多いので、メモリアクセスに要する時間という観点では、VRAM50へのアクセス量の方が寄与が高い場合が多い。本実施形態によれば、VRAM50へのアクセス量がより低減されるのでシステムの高速化が実現される。
As described above, according to the present embodiment, memory access is reduced by handling a plurality of characters like a composite glyph composed of a plurality of glyphs. Since the
4.他の実施形態
本発明は上述の実施形態に限定されるものではなく種々の変形実施が可能である。以下、変形例をいくつか説明する。変形例の説明において実施形態と共通する要素には共通の参照符号が用いられる。以下で説明する変形例のうち2つ以上のものが組み合わせて用いられてもよい。
4). Other Embodiments The present invention is not limited to the above-described embodiments, and various modifications can be made. Hereinafter, some modifications will be described. In the description of the modification, common reference symbols are used for elements that are common to the embodiment. Two or more of the modifications described below may be used in combination.
4−1.変形例1
図17は、変形例1に係る情報表示装置1の動作を示すフローチャートである。図9のフローに代わり、図17のフローが用いられてもよい。図17のフローにおいて、ステップS100−S150までの処理は図9のフローと共通である。図9のステップS160−180の処理に代わり、ステップS400−S430の処理が行われる。
4-1.
FIG. 17 is a flowchart showing the operation of the
ステップS400において、CPU10は、命令DrawCharを発行する。ステップS410において、CPU10は、スタックが空であるか判断する。スタックが空であると判断された場合(S410:YES)、CPU10は、処理をステップS420に移行する。スタックが空でないと判断された場合(S410:NO)、CPU10は、処理をステップS120に移行する。
In step S400, the
ステップS420において、CPU10は、ダミーデータ(空のグリフデータ)を読み出す。ステップS430において、CPU10は、ダミーデータを対象グリフのデータとして命令DrawCharFillを発行する。ステップS420でダミーデータを読み出すのは、誤動作を防ぐためである。ステップS400−S430の処理は、順番が異なっているものの、基本的には図9のステップS160−180の処理と同様に行われる。
In step S420, the
4−2.変形例2
グリフデータの形式は、図4で説明したものに限定されない。Move、Line、Curve2、Curve3、EOC以外の命令が用いられてもよい。曲線を記述する関数として、4次以上の高次のベジェ曲線が用いられてもよいし、ベジェ曲線以外の曲線が用いられてもよい。要は、グリフの輪郭および前記輪郭の向きを示すものであれば、どのような形式のデータが用いられてもよい。また、実施形態では、複合グリフが2つのパーツグリフから構成される例を説明したが、複合グリフは3つ以上のパーツグリフを含んでいてもよい。また、パーツグリフが複合グリフであってもよい。また、グリフデータは輪郭線を特定するものであればよく、輪郭線の向きは含まなくてもよい。さらに、図14のフローは複数のグリフが描画される場合に用いられる例として説明したが、単一の単純グリフが描画される場合に図14のフローが用いられてもよい。
4-2.
The format of the glyph data is not limited to that described with reference to FIG. Instructions other than Move, Line, Curve2, Curve3, and EOC may be used. As a function for describing a curve, a Bezier curve of a fourth or higher order may be used, or a curve other than a Bezier curve may be used. In short, any type of data may be used as long as it indicates the outline of the glyph and the direction of the outline. In the embodiment, an example in which the composite glyph is composed of two part glyphs has been described. However, the composite glyph may include three or more part glyphs. The part glyph may be a composite glyph. The glyph data only needs to specify the contour line, and does not need to include the direction of the contour line. Furthermore, although the flow of FIG. 14 has been described as an example used when a plurality of glyphs are drawn, the flow of FIG. 14 may be used when a single simple glyph is drawn.
4−3.変形例3
輪郭線の向きに応じて増減するパラメータは、実施形態で説明した巻き数wnに限定されない。巻き数wnは輪郭線の向きに応じて1ずつ増減するパラメータであったが、増減の単位は1でなくてもよい。また、実施形態では対象行を決めて、対象行について1画素ずつ横方向に処理を進める例を説明したが、処理の順序はこれに限定されない。対象列を決め、対象列について1画素ずつ縦方向に処理を進める構成としてもよい。この場合、巻き数変化量dwnは、輪郭線が右から左に向いている場合、輪郭線が鉛直方向を向いている場合、輪郭線が左から右に向いている場合で異なる。要は、輪郭線の向きに応じて増減するパラメータは、画素のマトリクスの1つの行または1つの列を対象線とし、対象線に沿って一画素ずつ処理していったときに、対象線と輪郭線とが交わる向きに応じて増減するものであれば、どのようなパラメータが用いられてもよい。さらに、このパラメータを用いて画素を塗り潰すか塗り潰さないかが決定されるのであれば、どのような処理が塗り潰し処理として用いられてもよい。
4-3. Modification 3
The parameter that increases or decreases according to the direction of the contour line is not limited to the number of turns wn described in the embodiment. The winding number wn is a parameter that increases or decreases by 1 according to the direction of the outline, but the unit of increase or decrease may not be 1. In the embodiment, the target row is determined and the processing is advanced in the horizontal direction pixel by pixel for the target row. However, the processing order is not limited to this. The target column may be determined and the processing may be advanced in the vertical direction pixel by pixel for the target column. In this case, the winding amount change amount dwn is different when the contour line is directed from right to left, when the contour line is directed in the vertical direction, and when the contour line is directed from left to right. In short, the parameter that increases or decreases depending on the direction of the contour line is the target line when processing one pixel or one pixel along the target line with one row or one column of the pixel matrix as the target line. Any parameter may be used as long as it increases or decreases according to the direction in which the contour line intersects. Furthermore, as long as it is determined whether to fill a pixel or not using this parameter, any process may be used as the fill process.
4−4.変形例4
実施形態において、輪郭描画モジュール104は、輪郭計算処理、描画位置計算処理、および輪郭描画処理を実行する機能、すなわち、輪郭計算手段、描画位置計算手段および輪郭描画手段としての機能を兼ね備えていた。しかし、これらの機能はそれぞれ別個のモジュールにより実現されてもよい。塗り潰しモジュール106についても同様である。
4-4.
In the embodiment, the
情報表示装置1のハードウェア構成は図1に示されるものに限定されない。必要な機能構成を実現できるものであれば、どのようなハードウェア構成を有する装置が用いられてもよい。フォントプロセッサ100についても同様である。また上述の実施形態では情報表示装置1が電子ペーパである例について説明したが、必要な機能を有するものであれば、パーソナルコンピュータ、PDA(Personal Digital Assistant)、携帯電話機など電子ペーパ以外の装置であってもよい。実施形態において情報表示装置1は表示装置(表示体107)を内蔵していたが、表示装置は外付けであってもよい。
The hardware configuration of the
上述の実施形態においてCPU10によって実行されるプログラムは、磁気記録媒体(磁気テープ、磁気ディスク(HDD(Hard Disk Drive)、FD(Flexible Disk))など)、光記録媒体(光ディスク(CD(Compact Disk)、DVD(Digital Versatile Disk))など)、光磁気記録媒体、半導体メモリ(フラッシュROMなど)などのコンピュータ読取り可能な記録媒体に記憶した状態で提供されてもよい。また、このプログラムは、インターネットのようなネットワーク経由でダウンロードされてもよい。
In the above-described embodiment, the program executed by the
1…情報表示装置、10…CPU、20…ROM、30…RAM、40…表示体、50…VRAM、60…表示制御装置、70…入力装置、80…バス、90…バスコントローラ、100…フォントプロセッサ、101…メインコントローラ、102…レジスタ、103…フォント描画コントローラ、104…輪郭描画モジュール、105…ワークメモリ、106…塗り潰しモジュール、107…バスインターフェースモジュール、108…メインバス、109…サブバス
DESCRIPTION OF
Claims (5)
グリフの輪郭線の描画を命令する第1の描画命令、またはグリフの輪郭線の描画および輪郭線の内部の塗り潰しを命令する第2の描画命令が入力される命令入力手段と、
前記第1の描画命令または前記第2の描画命令により描画が命令されたグリフの輪郭線を示すグリフデータを用いて、前記グリフの輪郭線が通過する画素を対象画素として特定する輪郭計算手段と、
前記2次元座標系における前記対象画素の座標を描画位置として計算する描画位置計算手段と、
前記メモリのうち、前記描画位置により特定される画素のデータを記憶する領域に、前記輪郭線が通る画素であることを示すデータを書き込む輪郭描画処理を実行する輪郭描画手段と、
前記命令入力手段に前記第2の描画命令が入力された場合、前記第2の描画命令で描画が命令されたグリフについて前記輪郭描画処理が完了した後で、前記メモリに書き込まれたデータにより特定される前記輪郭線の内部を塗り潰す塗り潰し処理を行う塗り潰し手段と
を有するフォント描画装置。 A memory that stores data of a plurality of pixels that are two-dimensionally arranged and whose positions are specified using a two-dimensional coordinate system;
A command input means for inputting a first drawing command for instructing drawing of a glyph outline, or a second drawing command for instructing drawing of a glyph outline and filling of the inside of the outline;
Contour calculation means for specifying, as a target pixel, a pixel through which the glyph contour passes, using glyph data indicating the contour of the glyph that has been commanded to be rendered by the first rendering command or the second rendering command; ,
Drawing position calculating means for calculating the coordinates of the target pixel in the two-dimensional coordinate system as a drawing position;
Contour drawing means for executing contour drawing processing for writing data indicating that the contour line passes through a region of the memory that stores pixel data specified by the drawing position;
When the second drawing command is input to the command input means, the contour drawing process is completed for the glyph commanded to be drawn by the second drawing command, and then specified by the data written in the memory A font rendering device comprising: filling means for performing a filling process for filling the inside of the contour line.
前記塗り潰し処理において、2本の輪郭線によって囲まれる領域については前記2本の輪郭線の向きに応じて前記領域が塗りつぶされるか否かが決定される
ことを特徴とする請求項1に記載のフォント描画装置。 The glyph data includes the direction of the contour line,
2. The filling process according to claim 1, wherein in the filling process, whether or not the area is filled is determined in accordance with a direction of the two outlines for the area surrounded by the two outlines. Font drawing device.
ことを特徴とする請求項2に記載のフォント描画装置。 The filling process is a process in which one row or one column of the matrix is set as a target line, and gradation is determined pixel by pixel along the target line, and the direction in which the target line and the outline intersect The font drawing apparatus according to claim 2, wherein it is a process of determining whether or not the pixel is to be filled according to a parameter that increases or decreases according to.
ことを特徴とする請求項3に記載のフォント描画装置。 The parameter increases when the target line and the contour line intersect in a certain direction, and decreases when the target line and the contour line intersect in another direction. Font drawing device.
描画すべき少なくとも1つのグリフを特定する情報をスタックするスタックと、
前記スタックから順番に情報を読み出し、前記スタックにまだ情報がスタックされている場合には読み出した情報に対応するグリフデータを対象とする第1の描画命令を発行し、前記スタックが空になった場合には読み出した情報に対応するグリフデータを対象とする第2の描画命令を発行する制御装置と、
2次元配置され、2次元座標系を用いて各画素の位置が特定される複数の画素のデータを記憶するメモリと、前記第1の描画命令または前記第2の描画命令が入力される命令入力手段と、前記第1の描画命令または前記第2の描画命令により描画が命令されたグリフの輪郭線を示すグリフデータを用いて、前記グリフの輪郭線が通過する画素を対象画素として特定する輪郭計算手段と、前記2次元座標系における前記対象画素の座標を描画位置として計算する描画位置計算手段と、前記メモリのうち、前記描画位置により特定される画素のデータを記憶する領域に、前記輪郭線が通る画素であることを示すデータを書き込む輪郭描画処理を実行する輪郭描画手段と、前記命令入力手段に前記第2の描画命令が入力された場合、前記第2の描画命令で描画が命令されたグリフについて前記輪郭描画処理が完了した後で、前記メモリに書き込まれたデータにより特定される前記輪郭線の内部を塗り潰す塗り潰し処理を行う塗り潰し手段とを有するフォント描画装置と
を有する情報処理装置。 A storage device storing glyph data indicating the outline of the glyph;
A stack for stacking information identifying at least one glyph to be drawn;
The information is read in order from the stack, and if the information is still stacked on the stack, a first rendering instruction for glyph data corresponding to the read information is issued, and the stack becomes empty A controller that issues a second rendering command for glyph data corresponding to the read information,
A memory that stores data of a plurality of pixels that are two-dimensionally arranged and each pixel's position is specified using a two-dimensional coordinate system, and a command input for inputting the first drawing command or the second drawing command And a contour that specifies a pixel through which the glyph contour passes as a target pixel using glyph data indicating the contour of the glyph that has been rendered by the first rendering command or the second rendering command. A calculation means; a drawing position calculation means for calculating the coordinates of the target pixel in the two-dimensional coordinate system as a drawing position; and an area for storing pixel data specified by the drawing position in the memory. A contour drawing means for executing a contour drawing process for writing data indicating that the pixel passes through the line; and the second drawing command when the second drawing command is input to the command input means. A font rendering apparatus comprising: a filling unit that performs a filling process for filling the inside of the contour line specified by the data written in the memory after the contour drawing process has been completed for the glyph for which rendering has been commanded by a command And an information processing apparatus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008122146A JP2009271347A (en) | 2008-05-08 | 2008-05-08 | Font plotting device and information processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008122146A JP2009271347A (en) | 2008-05-08 | 2008-05-08 | Font plotting device and information processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009271347A true JP2009271347A (en) | 2009-11-19 |
Family
ID=41437944
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008122146A Pending JP2009271347A (en) | 2008-05-08 | 2008-05-08 | Font plotting device and information processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009271347A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102184515A (en) * | 2011-04-13 | 2011-09-14 | 合肥芯硕半导体有限公司 | Method for filling ladder diagram in FPGA (Field Programmable Gate Array) |
CN111612864A (en) * | 2020-04-27 | 2020-09-01 | 厦门盈趣科技股份有限公司 | Drawing method and system based on photo and image recognition |
-
2008
- 2008-05-08 JP JP2008122146A patent/JP2009271347A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102184515A (en) * | 2011-04-13 | 2011-09-14 | 合肥芯硕半导体有限公司 | Method for filling ladder diagram in FPGA (Field Programmable Gate Array) |
CN102184515B (en) * | 2011-04-13 | 2013-02-06 | 合肥芯硕半导体有限公司 | Method for filling ladder diagram in FPGA (Field Programmable Gate Array) |
CN111612864A (en) * | 2020-04-27 | 2020-09-01 | 厦门盈趣科技股份有限公司 | Drawing method and system based on photo and image recognition |
CN111612864B (en) * | 2020-04-27 | 2023-05-09 | 厦门盈趣科技股份有限公司 | Drawing method and system based on photo and image recognition |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH03208094A (en) | Treatment of outline of symbol image of various sizes and computor display device | |
US8817034B2 (en) | Graphics rendering device, graphics rendering method, graphics rendering program, recording medium with graphics rendering program stored thereon, integrated circuit for graphics rendering | |
JP4400667B2 (en) | Drawing apparatus, image output apparatus, and program | |
EP1959398B1 (en) | Character rendering device, display device, and printing device | |
US7948494B2 (en) | Character rendering device, display device, and printer | |
JP3791259B2 (en) | Outline smoothing processing method | |
JP5172640B2 (en) | Vector drawing equipment | |
US20100238178A1 (en) | Information processing apparatus, control device, and program | |
JP4625269B2 (en) | CHARACTER IMAGE GENERATION DEVICE, CHARACTER IMAGE GENERATION METHOD, DISPLAY CONTROL DEVICE, CHARACTER IMAGE GENERATION PROGRAM, AND DISPLAY CONTROL PROGRAM | |
JP2009271347A (en) | Font plotting device and information processor | |
JP4570025B2 (en) | Controller driver and display panel driving method | |
EP0062669A1 (en) | Graphic and textual image generator for a raster scan display. | |
CN102592261B (en) | Vector diagram showing method and system | |
JP2009258381A (en) | Font drawing device and information processor | |
JP2005221853A (en) | Controller driver, mobile terminal, and display panel driving method | |
JP4760390B2 (en) | Image processing device | |
JP2009265329A (en) | Font drawing device and information processing device | |
JP4420083B2 (en) | Image processing circuit, display device and printing device | |
JP2009265413A (en) | Font drawing device and information processor | |
EP0744730A2 (en) | Display device with character masking function | |
JP2009265414A (en) | Information processor and control method | |
JP2009020364A (en) | Map display device and map display method | |
JP2005077750A (en) | Display device and character display control method | |
JP2005216146A (en) | Information display device, system and method | |
JPS6315617B2 (en) |