JP2009271347A - Font plotting device and information processor - Google Patents

Font plotting device and information processor Download PDF

Info

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
Application number
JP2008122146A
Other languages
Japanese (ja)
Inventor
Takashi Sawazaki
高 澤崎
Yoshiyuki Ono
義之 小野
Akira Saito
明 齋藤
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 JP2008122146A priority Critical patent/JP2009271347A/en
Publication of JP2009271347A publication Critical patent/JP2009271347A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To paint out after plotting the outline of a glyph. <P>SOLUTION: The font plotting device includes: a memory for storing a plurality of pixel data showing the position of each pixel specified in a two-dimensional coordinate system; an instruction input means to which a first or second plotting instruction is input; an outline calculating means which specifies pixels through which the outline of the glyph passes as object pixels by using glyph data showing the outline of the glyph; a plotting position calculating means which calculates the coordinates of each object pixel in a two-dimensional coordinate system as a plotting position; an outline plotting means which performs outline plotting processing to write, in the memory, the pixel data showing the pixels through which the outline passes; and a paint-out means which performs paint-out processing to paint out the inside of the outline specified by the data written in the memory after finishing the outline plotting processing on the glyph to which the second plotting instruction is given, when the second plotting instruction is input to the instruction input means. <P>COPYRIGHT: (C)2010,JPO&INPIT

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. Patent Document 1 discloses a technique for drawing a composite glyph. According to Patent Literature 1, after rendering each part glyph on the cache, the rendering result is synthesized on the memory to obtain a composite glyph.

特開平6−067641号公報Japanese Patent Application Laid-Open No. 6-067641

特許文献1に記載の技術によっても、黒い丸に白抜き数字など、パーツグリフのレンダリングをした後に合成するのでは描画できない複合グリフがある。
これに対し本発明は、パーツグリフのアウトライン(輪郭線)を合成した後でレンダリング(塗り潰し)を行う技術を提供する。
Even with the technique described in Patent Literature 1, there are composite glyphs that cannot be drawn by rendering after rendering part glyphs such as white circles and white numerals.
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 information display apparatus 1 according to an embodiment of the present invention. The information display device 1 is an example of an information processing device. A CPU (Central Processing Unit) 10 is a control device that controls each element of the information display device 1. A ROM (Read Only Memory) 20 is a non-volatile storage device that stores programs and data necessary for starting and operating the information display device 1. In the present embodiment, the ROM 20 stores glyph data as data relating to fonts. The glyph data is data indicating the outline of the glyph and the direction of the outline (details will be described later). A RAM (Random Access Memory) 30 is a storage device used as a work area when the CPU 10 executes a program. The display body 40 is a device that displays an image according to supplied data, and in this example is an EPD (Electrophoretic Display). EPD is an example of a memory display. A VRAM (Video Random Access Memory) 50 is a storage device used for storing data to be displayed. The display control device 60 is a device that controls the display body 40 according to the data stored in the VRAM 50 under the control of the CPU 10. The input device 70 is a device used for inputting an instruction, data, etc. from a user, such as a button (rewrite button, page feed button, determination button, etc.), keypad, wheel, lever, touch panel, pen device, or the like. The bus 80 is a transmission path used for transmitting data and signals between elements. The bus controller 90 is a device that arbitrates a bus right (right to use a bus) for all devices (modules) connected to the bus 80. The font processor 100 is an apparatus used for drawing a font, and is an example of a font drawing apparatus.

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 CPU 10, ROM 20, RAM 30, VRAM 50, display control device 60, and font processor 100 are directly connected to the bus 80. With this configuration, the CPU 10, the display control device 60, and the font processor 100 can access the memories (ROM 20, RAM 30, and VRAM 50) independently of each other. A signal line between the CPU 10 and the font processor 100 is used for supplying a drawing start command from the CPU 10 to the font processor 100 and supplying a drawing completion notification from the font processor 100 to the CPU 10. A signal line between the CPU 10 and the display control device 60 is used to supply a screen update from the CPU 10 to the display control device 60 (that is, a transfer command to the display body 40). This signal line is unnecessary when a display body that is not a memory display body, such as a liquid crystal display, is used as the display body 40.

図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 font processor 100. The main controller 101 controls each element of the font processor 100. The main controller 101 has a register 102. The register 102 is used, for example, for storing an address of data to be read by the main controller 101. The font drawing controller 103 stores information necessary for font drawing, for example, affine transformation parameters. The font drawing controller 103 further stores whether the given instruction is DrawChar or DrawCharFill. DrawChar is a command for instructing execution of the contour drawing process (an example of a first drawing command). DrawCharFill is a command for instructing execution of contour drawing processing and painting processing (an example of a second drawing command). The contour drawing module 104 (an example of a contour drawing means) performs contour calculation processing, drawing position calculation processing, and contour drawing processing when the command DrawChar or the command DrawCharFill is given. First, the contour drawing module 104 calculates the contour of the glyph using the glyph data (contour calculation processing). In addition, the contour drawing module 104 calculates the position of the pixel for drawing the contour (drawing position calculation processing). The contour drawing module 104 further writes data indicating the calculated contour in the work memory 105 (contour drawing processing). When drawing a composite glyph, the contour drawing module 104 writes data indicating the contour of the first glyph into the work memory 105 and then writes data indicating the contour of the second glyph into the work memory 105. The work memory 105 is used as a rendering memory that stores data indicating gradations of pixels that are two-dimensionally arranged in a matrix (in this example, two gradations for filling or not filling). The paint module 106 (an example of paint means) performs paint processing, background composition processing, and transfer processing when an instruction DrawChar is given. First, the filling module 106 fills the inside of the outline drawn by the outline drawing module 104, that is, the area surrounded by the outline (filling process). In the filling process, for an area surrounded by two outlines, whether or not the area is filled is determined according to the directions of the two outlines (details will be described later). The filling module 106 further synthesizes the pixel and the background as necessary (background synthesis processing). The filling module 106 further outputs the generated pixel data (transfer process). The bus interface module 107 inputs and outputs signals and data to and from other elements such as the CPU 10, ROM 20, and RAM 30 via the bus 80. The main bus 108 and the sub bus 109 are transmission paths used for transmitting data and signals between elements.

輪郭描画モジュール104と塗り潰しモジュール106との間の信号線は、輪郭描画処理の終了の通知に用いられる。フォント描画コントローラ103と塗り潰しモジュール106との間の信号線は、ワークメモリ105のビット幅、データの範囲などの情報の伝送に用いられる。塗り潰しモジュール106とメインバス108との間の信号線は、背景データの伝送、塗り潰し処理の結果の伝送に用いられる。特に説明しないがこれら以外の信号線も、必要なデータや命令の伝送に用いられる。また、2つのワークメモリ105は交互に用いられ、処理の高速化が図られる。   A signal line between the contour drawing module 104 and the filling module 106 is used to notify the end of the contour drawing process. A signal line between the font drawing controller 103 and the filling module 106 is used to transmit information such as the bit width and data range of the work memory 105. A signal line between the filling module 106 and the main bus 108 is used for transmission of background data and transmission of the result of the painting process. Although not specifically described, signal lines other than these are also used for transmitting necessary data and commands. In addition, the two work memories 105 are used alternately to increase the processing speed.

図3は、情報表示装置1の外観を示す図である。情報表示装置1は、筐体の前面に表示体40の表示面、および入力装置70としてのボタン群を有する。   FIG. 3 is a diagram illustrating an appearance of the information display device 1. The information display device 1 has a display surface of the display body 40 and a button group as the input device 70 on the front surface of the housing.

2.動作
続いて、情報表示装置1の動作を説明する。ここではまず、グリフデータの構成について概説し、さらに従来技術および本実施形態のフォント描画方法について概説した後で、情報表示装置1の動作を詳細に説明する。
2. Operation Next, the operation of the information display device 1 will be described. Here, first, the configuration of the glyph data will be outlined, and the operation of the information display device 1 will be described in detail after the prior art and the font drawing method of the present embodiment are outlined.

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 Patent Document 1 FIG. 6 is a diagram illustrating a drawing method according to Patent Document 1. Using the glyph data (FIGS. 5A and 5B) of glyph A and glyph B stored in the ROM, the contour lines of glyph A and glyph B are respectively drawn in the part cache memory provided in advance. (FIGS. 6A and 6B). The part cache memory stores bitmap data. Next, the insides of the contour lines of the glyph A and the glyph B are filled on the part cache memory (FIGS. 6C and 6D). Finally, the part glyph filled in the rendering memory is synthesized (FIG. 6E).

この方法によれば、レンダリング用メモリとは別に、パーツ用キャッシュメモリを設ける必要がある。パーツ用キャッシュメモリは、合成するパーツグリフの数ぶん必要である。例えば、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 Patent Document 1. FIG. 7D shows the result to be obtained. The theoretical outline for obtaining this display is as shown in FIG. This composite glyph is composed of a part glyph C (FIG. 7A) and a part glyph D (FIG. 7B). However, when the drawing method according to Patent Document 1 is applied to these part glyphs, since the parts glyphs are filled and then combined, the result shown in FIG. 7E is obtained. This is different from the result originally desired.

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 information display apparatus 1. The flow shown in FIG. 9 is triggered by an event for starting font drawing, for example, an event for updating an image displayed on the display body 40. Here, an example will be described in which a glyph to be drawn (hereinafter referred to as “target glyph”) is the composite glyph shown in FIG. This composite glyph is composed of two part glyphs, a glyph A (FIG. 5A) and a glyph B (FIG. 5B). The following processing is performed by the CPU 10 operating according to a control program stored in the ROM 20.

ステップS100において、CPU10は、スタックを空にする。この例でスタックはLIFO(Last In First Out)であり、RAM30上に記憶領域が設けられている。また、CPU10は、レンダリング用メモリを初期化する。
ステップS110において、CPU10は、対象グリフのグリフ番号をスタックに積む(プッシュする)。グリフ番号は、グリフデータを特定する情報の一例である。
In step S100, the CPU 10 empties the stack. In this example, the stack is a LIFO (Last In First Out), and a storage area is provided on the RAM 30. Further, the CPU 10 initializes the rendering memory.
In step S110, the CPU 10 loads (pushes) the glyph number of the target glyph on the stack. The glyph number is an example of information for specifying glyph data.

ステップS120において、CPU10は、スタックからグリフ番号を取得する(ポップする)。スタックはLIFOなので、最も新しいデータが取得される。
ステップS130において、CPU10は、取得したグリフ番号から、そのグリフ番号によって示されるグリフ(以下「取得グリフ」という)が複合グリフであるか判断する。この例でグリフデータは、そのグリフが複合グリフであるか単純グリフ(非複合グリフ)であるかを示すフラグを有しており、CPU10は、ROM20から取得グリフのフラグを読み出して判断する。取得グリフが複合グリフであると判断された場合(S130:YES)、CPU10は、処理をステップS140に移行する。取得グリフが複合グリフでないと判断された場合(S130:NO)、CPU10は、処理をステップS150に移行する。
In step S120, the CPU 10 acquires (pops) the glyph number from the stack. Since the stack is a LIFO, the newest data is acquired.
In step S130, the CPU 10 determines from the acquired glyph number whether the glyph indicated by the glyph number (hereinafter referred to as “acquired glyph”) is a composite glyph. In this example, the glyph data has a flag indicating whether the glyph is a composite glyph or a simple glyph (non-composite glyph), and the CPU 10 reads the flag of the acquired glyph from the ROM 20 and determines it. When it is determined that the acquired glyph is a composite glyph (S130: YES), the CPU 10 shifts the processing to step S140. When it is determined that the acquired glyph is not a composite glyph (S130: NO), the CPU 10 shifts the processing to step S150.

ステップS140において、CPU10は、取得グリフを構成するパーツグリフのグリフ番号をすべてスタックに積む。パーツグリフのグリフ番号はグリフデータに記述されている。CPU10は、ROM20から取得グリフのグリフデータを読み出す。CPU10は、読み出したグリフデータから取得グリフを構成するパーツグリフを特定し、パーツグリフのグリフ番号をスタックに積む。パーツグリフのグリフ番号をスタックに積むと、CPU10は、処理を再びステップS120に移行する。   In step S140, the CPU 10 loads all the glyph numbers of the part glyphs constituting the acquired glyph on the stack. The glyph number of the part glyph is described in the glyph data. The CPU 10 reads the glyph data of the acquired glyph from the ROM 20. The CPU 10 identifies the part glyphs that form the acquired glyph from the read glyph data, and accumulates the glyph numbers of the part glyphs on the stack. When the glyph number of the part glyph is stacked on the stack, the CPU 10 shifts the process to step S120 again.

ステップS150において、CPU10は、取得グリフのグリフデータを読み出す。
ステップS160において、CPU10は、スタックが空であるか判断する。スタックが空であると判断された場合(S160:YES)、CPU10は、処理をステップS180に移行する。スタックが空でないと判断された場合(S160:NO)、CPU10は、処理をステップS170に移行する。
In step S150, the CPU 10 reads the glyph data of the acquired glyph.
In step S160, the CPU 10 determines whether the stack is empty. When it is determined that the stack is empty (S160: YES), the CPU 10 shifts the processing to step S180. When it is determined that the stack is not empty (S160: NO), the CPU 10 shifts the processing to step S170.

ステップS170において、CPU10は、命令DrawCharを発行する。すなわち、CPU10は、命令DrawCharとともに、取得グリフのグリフデータが記憶されているアドレスをフォントプロセッサ100のレジスタ102に書き込む。   In step S170, the CPU 10 issues an instruction DrawChar. That is, the CPU 10 writes the address where the glyph data of the acquired glyph is stored in the register 102 of the font processor 100 together with the instruction DrawChar.

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 CPU 10, the main controller 101 of the font processor 100 causes the font drawing controller 103 to store that the command is DrawChar. Further, the main controller 101 reads the glyph data from the ROM 20 and causes the contour drawing module 104 to draw a contour line according to the glyph data. The operation of the contour drawing module 104 will be described later. The contour drawing module 104 draws a contour line according to the glyph data in the work memory 105. If the received command is DrawChar, the fill module 106 does not perform processing. When the contour drawing is completed, the font processor 100 notifies the CPU 10 of the completion of the contour drawing. When notified of the completion of drawing, the CPU 10 shifts the process to step S120 again.

ステップS180において、CPU10は、命令DrawCharFillを発行する。すなわち、CPU10は、命令DrawCharFillとともに、取得グリフのグリフデータが記憶されているアドレスをフォントプロセッサ100のレジスタ102に書き込む。   In step S180, the CPU 10 issues an instruction DrawCharFill. That is, the CPU 10 writes the address where the glyph data of the acquired glyph is stored in the register 102 of the font processor 100 together with the command DrawCharFill.

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 CPU 10, the main controller 101 of the font processor 100 causes the font drawing controller 103 to store that the command is DrawCharFill. Further, the main controller 101 reads the glyph data from the ROM 20 and causes the contour drawing module 104 to draw a contour line according to the glyph data. That is, the contour drawing module 104 writes bitmap data of the contour line according to the glyph data in the work memory 105. When the received command is DrawCharFill, the fill module 106 performs a fill process for filling the area surrounded by the outline in the bitmap data stored in the work memory 105. The operation of the filling module 106 will be described later. When the painting process is completed, the font processor 100 notifies the CPU 10 of the completion of painting. When the completion of painting is notified, the CPU 10 ends the process of FIG.

ここで、図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 glyph numbers 10 and 100 of the part glyphs are stacked on the stack (step S140). Next, the glyph number 100 is acquired from the stack (step S120). Since the glyph with the glyph number 100 (glyph A) is a simple glyph (S130: NO), the glyph data of the glyph A is read (step S150). Since the stack is still not filled with glyph number 10 (S160: NO), the command DrawChar is issued (step S170). Here, the outline of the glyph A is drawn. Next, the glyph number 10 is acquired from the stack (step S120). Since the glyph of the glyph number 10 (glyph B) is a simple glyph (S130: NO), the glyph data of the glyph B is read (step S150). Since the stack is empty (S160: YES), the command DrawCharFill is issued (step S180). Here, the outline of the glyph B is overwritten, the outline of the composite glyph is drawn, and the inside of the outline is further filled.

2−3−2.輪郭描画モジュール104の動作
本実施形態において、輪郭描画モジュール104は、グリフデータを用いて輪郭線を計算する輪郭計算処理を実行する機能、輪郭線が通る画素すなわち輪郭線を描画すべき位置を計算する描画位置計算処理を実行する機能、および輪郭線が通る画素のデータをワークメモリ105に書き込む輪郭描画処理を実行する機能を有する。ここでは輪郭計算処理および描画位置計算処理の詳細は省略するが、概要は次のとおりである。
2-3-2. Operation of Outline Drawing Module 104 In this embodiment, the outline drawing module 104 calculates a contour calculation process for calculating an outline using glyph data, a pixel through which an outline passes, that is, a position where an outline should be drawn. A drawing position calculation process, and a contour drawing process of writing pixel data passing through the outline into the work memory 105. Details of the contour calculation process and the drawing position calculation process are omitted here, but the outline is as follows.

輪郭計算処理において、輪郭描画モジュール104は、与えられた命令(Move、Line、Curve2、Curve3、EOC)および点の座標に応じて、命令を生成する。輪郭計算処理により生成される命令は、Move、dVectorおよびEOCのいずれかである。命令MoveおよびEOCについては、グリフデータの項で説明したとおりである。命令dVectorは、命令Line、Curve2およびCurve3を所定の最小単位(例えば1画素)まで分解したものであり、輪郭線が通る画素すなわち塗り潰される点を特定する差分ベクトルを示す。   In the contour calculation process, the contour drawing module 104 generates a command according to a given command (Move, Line, Curve2, Curve3, EOC) and the coordinates of the point. The command generated by the contour calculation process is one of Move, dVector, and EOC. The instructions Move and EOC are as described in the glyph data section. The command dVector is obtained by decomposing the commands Line, Curve2, and Curve3 to a predetermined minimum unit (for example, one pixel), and indicates a difference vector that specifies a pixel through which an outline passes, that is, a point to be filled.

描画位置計算処理において、輪郭描画モジュール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 contour drawing module 104 generates a command and a parameter for specifying a pixel to be written as a contour line in the work memory 105 according to the command generated by the contour calculation process. The command generated by the drawing position calculation process is one of Move, dVector, and EOC. The parameters generated by the drawing position calculation process include the winding number change amount dwn and the stroke stroke. The winding number change amount dwn represents a change in the direction of the contour line. The direction of the contour line is defined by the direction in which the contour line intersects with a certain reference line (for example, a horizontal line passing through the pixel). When the contour line is directed from the bottom to the top with respect to the reference line, dwn = 1, and when the reference line and the contour line are parallel, dwn = 0, and the contour line with respect to the reference line is from top to bottom. Dwn = −1. The stroke stroke indicates that the outline has passed through the pixel. When stroke = 1, it indicates that the outline has passed, and when stroke = 0, it indicates that the outline has not passed.

図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 contour drawing module 104, particularly the contour drawing processing. In step S200, the contour drawing module 104 determines whether the command given from the drawing position calculation process is EOC. When it is determined that the given command is EOC (S200: YES), the contour drawing module 104 proceeds to step S208. When it is determined that the given command is not EOC (S200: NO), the contour drawing module 104 moves the process to step S201.

ステップS201において、輪郭描画モジュール104は、与えられた命令がMoveであるか判断する。与えられた命令がMoveであると判断された場合(S201:YES)、ワークメモリ105にアクセスする必要がないので、輪郭描画モジュール104は、その画素については何も処理をしない。与えられた命令がMoveでないと判断された場合(S201:NO)、すなわち、命令dVectorが与えられた場合、輪郭描画モジュール104は、処理をステップS202に移行する。   In step S201, the contour drawing module 104 determines whether the given command is Move. If it is determined that the given command is Move (S201: YES), the contour drawing module 104 does not perform any processing on the pixel because it is not necessary to access the work memory 105. When it is determined that the given command is not Move (S201: NO), that is, when the command dVector is given, the contour drawing module 104 proceeds to step S202.

ステップ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 contour drawing module 104 determines whether stroke = 0 and dwn = 0. If it is determined that stroke = 0 and dwn = 0 (S202: YES), it is not necessary to access the work memory 105, and therefore the contour drawing module 104 does not perform any processing on the pixel. When it is determined that stroke = 0 and dwn = 0 are not satisfied (S202: NO), the contour drawing module 104 proceeds to step S203.

ステップS203において、輪郭描画モジュール104は、画素の位置から、その画素のデータを記憶しているワークメモリ105のアドレスを算出する。
ステップS204において、輪郭描画モジュール104は、ワークメモリ105のうちステップS203で算出されたアドレスから、画素のデータを読み出す。この例で画素のデータは、ストロークstroke(ストローク情報)および巻き数変化量dwnを含んでいる。複合グリフの場合はもちろん、単純グリフの場合でも、1つの画素で線が交わる場合など、ある画素に対して処理が複数回行われることがある。したがって、既に処理が行われた画素については、初期値以外のストローク情報および巻き数変化量dwnが記録されている。
In step S <b> 203, the contour drawing module 104 calculates the address of the work memory 105 storing the pixel data from the pixel position.
In step S204, the contour drawing module 104 reads pixel data from the address calculated in step S203 in the work memory 105. In this example, the pixel data includes a stroke stroke (stroke information) and a winding number change amount dwn. In the case of a complex glyph, as well as in the case of a simple glyph, processing may be performed a plurality of times for a certain pixel, for example, when a line intersects one pixel. Therefore, stroke information other than the initial value and the number of turns change dwn are recorded for pixels that have already been processed.

ステップS205において、輪郭描画モジュール104は、ストローク情報を上書きする。描画位置計算処理から与えられたストロークがstroke=0である場合、輪郭描画モジュール104は、その画素のストローク情報を変更しない。与えられたストロークがstroke=1である場合、輪郭描画モジュール104は、その画素のストローク情報を、「1」に変更する。ステップS206において、輪郭描画モジュール104は、画素の巻き数変化量にdwnを加算する。例えば、画素の巻き数変化量として「2」が記憶されており与えられた巻き数変化量dwn=+1であった場合、画素の巻き数変化量は「3」となる。ステップS207において、輪郭描画モジュール104は、更新したデータでワークメモリ105上のデータを上書きする。   In step S205, the contour drawing module 104 overwrites the stroke information. When the stroke given from the drawing position calculation process is stroke = 0, the contour drawing module 104 does not change the stroke information of the pixel. When the given stroke is stroke = 1, the contour drawing module 104 changes the stroke information of the pixel to “1”. In step S206, the contour drawing module 104 adds dwn to the amount of change in the number of turns of the pixel. For example, when “2” is stored as the amount of change in the number of turns of the pixel and the given amount of change in the number of turns dwn = + 1, the amount of change in the number of turns of the pixel is “3”. In step S207, the contour drawing module 104 overwrites the data on the work memory 105 with the updated data.

ステップS208において、輪郭描画モジュール104は、輪郭描画処理が終了したことを塗り潰しモジュール106に通知する。   In step S208, the contour drawing module 104 notifies the paint module 106 that the contour drawing processing has been completed.

2−3−3.塗り潰しモジュール106の動作
図11は、フォントプロセッサ100の塗り潰しモジュール106の動作を示すフローチャートである。本実施形態において、塗り潰しモジュール106は、輪郭線の内部を塗りつぶす塗りつぶし処理、グリフの画像と背景を合成する背景合成処理、および生成されたデータをVRAM50に転送する転送処理を実行する機能を有する。図11のフローは、図10のステップS208において輪郭描画モジュール104から塗り潰しモジュール106に輪郭描画処理の終了が通知されたことを契機として開始される。
2-3-3. Operation of Filling Module 106 FIG. 11 is a flowchart showing the operation of the filling module 106 of the font processor 100. In the present embodiment, the fill module 106 has a function of executing a fill process for filling the inside of the contour line, a background composition process for synthesizing the glyph image and the background, and a transfer process for transferring the generated data to the VRAM 50. The flow in FIG. 11 is started when the contour drawing module 104 is notified of the end of the contour drawing processing in step S208 in FIG.

ステップS300において、塗り潰しモジュール106は、パラメータyを初期化する。ビットマップデータにおける画素はxy座標系を用いて特定される。xy座標系は、マトリクス状に配置された画素の左上端の画素を原点とし、右方向がx軸の正方向、下方向がy軸の正方向である。パラメータxおよびyは、画素の座標を示す。この例で、塗り潰しモジュール106は、y=yMinとしてパラメータyを初期化する。yMinはフォントが描画される領域のy座標の最小値である。以下、マトリクス状に配置された複数の画素のうちパラメータyで特定される行を「対象行」という。   In step S300, the filling module 106 initializes the parameter y. Pixels in the bitmap data are specified using the xy coordinate system. In the xy coordinate system, the pixel at the upper left corner of the pixels arranged in a matrix is the origin, the right direction is the positive direction of the x axis, and the lower direction is the positive direction of the y axis. The parameters x and y indicate pixel coordinates. In this example, the fill module 106 initializes the parameter y as y = yMin. yMin is the minimum value of the y coordinate of the area where the font is drawn. Hereinafter, a row specified by the parameter y among a plurality of pixels arranged in a matrix is referred to as a “target row”.

ステップS301において、塗り潰しモジュール106は、まだ対象行となっていない行があるか、具体的にはパラメータyがy≦yMaxを満たすか判断する。yMaxはフォントが描画される領域のy座標の最大値である。まだ処理されていない行があると判断された場合(S301:YES)、塗り潰しモジュール106は、処理をステップS302に移行する。処理されていない行はないと判断された場合(S301:NO)、塗り潰しモジュール106は、図11の処理を終了する。   In step S <b> 301, the filling module 106 determines whether there is a line that is not yet a target line, specifically, whether the parameter y satisfies y ≦ yMax. yMax is the maximum value of the y coordinate of the area where the font is drawn. If it is determined that there is a line that has not yet been processed (S301: YES), the paint module 106 moves the process to step S302. If it is determined that there is no unprocessed line (S301: NO), the filling module 106 ends the process of FIG.

ステップS302において、塗り潰しモジュール106は、パラメータwnを初期化、すなわちパラメータwnにゼロを代入する。パラメータwnは巻き数(winding number)を示す。巻き数は、対象行と輪郭線とがある向き(例えば、上向き)で交わるときに増加し、対象行と輪郭線とが別の向き(例えば、下向き)で交わるときに減少する。   In step S302, the filling module 106 initializes the parameter wn, that is, substitutes zero for the parameter wn. The parameter wn indicates the winding number. The number of turns increases when the target row and the contour line intersect in a certain direction (for example, upward), and decreases when the target row and the contour line intersect in another direction (for example, downward).

ステップS303において、塗り潰しモジュール106は、パラメータxを初期化する。この例で、塗り潰しモジュール106は、x=xMinとしてパラメータxを初期化する。xMinはフォントが描画される領域のx座標の最小値である。塗り潰し処理において対象行のうちパラメータxで特定される画素を「対象画素」という。   In step S303, the filling module 106 initializes the parameter x. In this example, the fill module 106 initializes the parameter x as x = xMin. xMin is the minimum value of the x coordinate of the area where the font is drawn. The pixel specified by the parameter x in the target row in the filling process is referred to as “target pixel”.

ステップS304において、塗り潰しモジュール106は、対象行の中にまだ対象画素となっていない画素があるか、具体的にはパラメータxがx≦xMaxを満たすか判断する。xMaxはフォントを描画する領域のx座標の最大値である。まだ対象画素となっていない画素があると判断された場合(S304:YES)、塗り潰しモジュール106は、処理をステップS306に移行する。対象画素となっていない画素は無いと判断された場合(S304:NO)、塗り潰しモジュール106は、処理をステップS305に移行する。   In step S304, the filling module 106 determines whether there is a pixel that is not yet a target pixel in the target row, specifically, whether the parameter x satisfies x ≦ xMax. xMax is the maximum value of the x coordinate of the area in which the font is drawn. If it is determined that there is a pixel that is not yet a target pixel (S304: YES), the paint module 106 moves the process to step S306. When it is determined that there is no pixel that is not the target pixel (S304: NO), the paint module 106 moves the process to step S305.

ステップS305において、塗り潰しモジュール106は、パラメータyを更新する。この例で、塗り潰しモジュール106は、y=y+1としてパラメータyを更新する。パラメータyを更新すると、塗り潰しモジュール106は、処理をステップS301に移行する。   In step S305, the filling module 106 updates the parameter y. In this example, the filling module 106 updates the parameter y with y = y + 1. When the parameter y is updated, the filling module 106 moves the process to step S301.

ステップS306において、塗り潰しモジュール106は、対象画素の背景データ(背景の階調を示すデータ)を、ワークメモリ105に書き込む。背景データは、例えばRAM30から読み出される。   In step S <b> 306, the filling module 106 writes the background data of the target pixel (data indicating the background gradation) in the work memory 105. The background data is read from the RAM 30, for example.

ステップS307において、塗り潰しモジュール106は、ワークメモリ105に記憶されている輪郭を示すビットマップデータ(輪郭データ)から、巻き数変化量wdnを取得する。詳細には以下のとおりである。塗り潰しモジュール106は、パラメータxおよびyから、対象画素のデータを記憶しているアドレスを算出する。塗り潰しモジュール106は、算出されたアドレスから対象画素のデータを読み出す。塗り潰しモジュール106は、読み出されたデータから巻き数変化量wdnを抽出する。   In step S <b> 307, the filling module 106 acquires the winding amount change amount wdn from the bitmap data (contour data) indicating the contour stored in the work memory 105. Details are as follows. The filling module 106 calculates an address storing data of the target pixel from the parameters x and y. The filling module 106 reads the data of the target pixel from the calculated address. The filling module 106 extracts the winding number change amount wdn from the read data.

ステップS308において、塗り潰しモジュール106は、パラメータwnの値をwn=wn+dwnとして更新する。パラメータwnは対象行が更新されるたびにゼロに初期化される(ステップS302)から、パラメータwnは、対象行を基準点(この例では左端点)から1画素ずつ順番に、巻き数変化量wdnを積算した値である。   In step S308, the filling module 106 updates the value of the parameter wn as wn = wn + dwn. Since the parameter wn is initialized to zero every time the target row is updated (step S302), the parameter wn is the amount of change in the number of turns in order from the reference point (in this example, the left end point) pixel by pixel. It is a value obtained by integrating wdn.

図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 module 106 determines whether a condition for filling a pixel is satisfied. Here, a condition that the number of windings wn and the stroke stroke is other than (wn, stroke) = (0, 0) is used as a condition for filling a pixel. If it is determined that the condition for filling the pixel is satisfied (S309: YES), the filling module 106 proceeds to step S310. If it is determined that the condition for filling the pixel is not satisfied (S309: NO), the filling module 106 proceeds to step S311.

ステップS310において、塗り潰しモジュール106は、対象画素を塗り潰す。すなわち、対象画素の階調(カラー表示の場合、各色要素の階調)を指定された値にする。   In step S310, the fill module 106 fills the target pixel. That is, the gradation of the target pixel (in the case of color display, the gradation of each color element) is set to a designated value.

ステップS311において、塗り潰しモジュール106は、パラメータxをx=x+1として更新する。これにより対象画素が更新される。対象画素を更新すると、塗り潰しモジュール106は、処理をステップS304に移行する。   In step S311, the filling module 106 updates the parameter x as x = x + 1. As a result, the target pixel is updated. When the target pixel is updated, the filling module 106 moves the process to step S304.

以上の処理により、ワークメモリ105に記憶された輪郭線のビットマップデータの内部は塗りつぶされる。塗り潰しモジュール106は、こうして生成されたデータを、バスインターフェースモジュール107およびバス80を介してVRAM50に転送する。塗り潰し処理が完了すると、フォントプロセッサ100は、塗り潰し処理の完了をCPU10に通知する。   Through the above processing, the outline bitmap data stored in the work memory 105 is filled. The filling module 106 transfers the data thus generated to the VRAM 50 via the bus interface module 107 and the bus 80. When the filling process is completed, the font processor 100 notifies the CPU 10 of the completion of the filling process.

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 information display device 1 when drawing a plurality of characters. The flow shown in FIG. 13 is triggered by an event for starting font drawing, for example, an event for updating an image displayed on the display body 40. A plurality of characters to be drawn is designated by the CPU 10.

ステップS500において、CPU10は、CPU10は、スタックを空にする。スタックはLIFOであり、RAM30上に記憶領域が設けられている。また、CPU10は、レンダリング用メモリを初期化する。
ステップS510において、CPU10は、一連の処理の対象となる複数のグリフのグリフ番号を、順番にスタックに積む。この例で、グリフ番号は、「に」、「は」、「ろ」、「い」の順番でスタックに積まれる。
In step S500, the CPU 10 empties the stack. The stack is a LIFO, and a storage area is provided on the RAM 30. Further, the CPU 10 initializes the rendering memory.
In step S510, the CPU 10 stacks the glyph numbers of a plurality of glyphs to be processed in a series on the stack in order. In this example, the glyph numbers are stacked on the stack in the order of “ni”, “ha”, “ro”, “i”.

ステップS520において、CPU10は、描画すべきグリフがあるか、すなわちスタックに積まれているグリフ番号があるか判断する。描画すべきグリフがあると判断された場合(S520:YES)、CPU10は、処理をステップS530に移行する。描画すべきグリフが無いと判断された場合(S520:NO)、CPU10は、処理をステップS580に移行する。   In step S520, the CPU 10 determines whether there is a glyph to be drawn, that is, whether there is a glyph number stacked on the stack. If it is determined that there is a glyph to be drawn (S520: YES), the CPU 10 shifts the processing to step S530. If it is determined that there is no glyph to be drawn (S520: NO), the CPU 10 shifts the processing to step S580.

ステップS530において、CPU10は、スタックからグリフ番号を読み出す。スタックはLIFOなので、読み出されるのは最も新しいグリフ番号である。
ステップS540において、CPU10は、読み出したグリフ番号により示されるグリフを対象グリフとして、命令DrawCharを発行する。命令DrawCharが発行されたときのフォントプロセッサ100の動作は既に説明したとおりである。
In step S530, the CPU 10 reads the glyph number from the stack. Since the stack is a LIFO, it is the latest glyph number that is read.
In step S540, the CPU 10 issues a command DrawChar with the glyph indicated by the read glyph number as the target glyph. The operation of the font processor 100 when the instruction DrawChar is issued is as already described.

ステップS550において、CPU10は、レンダリング用メモリに余裕があるか判断する。「レンダリング用メモリに余裕がある」とは、レンダリング用メモリの記憶領域のうち、未使用の領域の大きさに関する所定の条件が満たされることをいう。「所定の条件」としては、例えば、現にレンダリング用メモリに書き込まれているグリフの数が所定のしきい値を超えたという条件が用いられる。あるいは、レンダリング用メモリの幅すなわち容量を、すべてのグリフの中で最長の幅を持つグリフの幅で割った値をしきい値として、レンダリング用メモリに書き込まれたグリフの数がそのしきい値に達したという条件が用いられてもよい。さらにあるいは、レンダリング用メモリのうちまだデータが書き込まれていない部分の容量が所定のしきい値よりも小さくなったという条件が用いられてもよい。レンダリング用メモリに余裕があると判断された場合(S550:YES)、CPU10は、処理をステップS520に移行する。レンダリング用メモリに余裕がないと判断された場合(S550:NO)、CPU10は、処理をステップS560に移行する。   In step S550, the CPU 10 determines whether there is room in the rendering memory. “Rendering memory has room” means that a predetermined condition regarding the size of an unused area in the storage area of the rendering memory is satisfied. As the “predetermined condition”, for example, a condition that the number of glyphs currently written in the rendering memory exceeds a predetermined threshold is used. Alternatively, the threshold value is the number of glyphs written to the rendering memory, with the width of the rendering memory or capacity divided by the width of the longest glyph among all glyphs. The condition of reaching may be used. Further alternatively, a condition that the capacity of a portion of the rendering memory where data has not yet been written becomes smaller than a predetermined threshold value may be used. When it is determined that the rendering memory has a margin (S550: YES), the CPU 10 shifts the processing to step S520. When it is determined that there is no room in the rendering memory (S550: NO), the CPU 10 shifts the processing to step S560.

ステップS560において、CPU10は、ダミーデータすなわち空のグリフデータを読み出す。ステップS570において、CPU10は、ダミーデータを対象グリフのデータとして命令DrawCharFillを発行する。ダミーデータを読み出すのは、誤動作を防ぐためである。命令DrawCharFillが発行されたときのフォントプロセッサ100の動作は、既に説明したとおりである。命令DrawCharFillを発行すると、CPU10は、レンダリング用メモリを初期化し、処理をステップS520に移行する。   In step S560, the CPU 10 reads out dummy data, that is, empty glyph data. In step S570, the CPU 10 issues an instruction DrawCharFill with the dummy data as the data of the target glyph. The reason for reading the dummy data is to prevent malfunction. The operation of the font processor 100 when the instruction DrawCharFill is issued is as described above. When the command DrawCharFill is issued, the CPU 10 initializes the rendering memory, and the process proceeds to step S520.

ステップS580において、CPU10は、ダミーデータを読み出す。ステップS590において、CPU10は、ダミーデータを対象グリフのデータとして命令DrawCharFillを発行する。命令DrawCharFillを発行すると、CPU10は、図13のフローを終了する。ステップS580およびS590でダミーデータをロードし、命令DrawCharFillを発行するのは、輪郭線が描画されているがまだ塗り潰されていないグリフが存在する可能性があるためである。   In step S580, the CPU 10 reads out dummy data. In step S590, the CPU 10 issues a command DrawCharFill with the dummy data as the data of the target glyph. When the instruction DrawCharFill is issued, the CPU 10 ends the flow of FIG. The reason why the dummy data is loaded and the command DrawCharFill is issued in steps S580 and S590 is because there may be a glyph in which the outline is drawn but not yet filled.

図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 VRAM 50, that is, the area on the VRAM 50 used by the glyph. In this example, the glyph “i” has a width of 10 pixels and is drawn in the range of 2 ≦ x ≦ 11 on the VRAM 50. The glyphs “RO”, “HA” and “NI” are also as shown in FIG. The four glyphs “I”, “RO”, “HA” and “NI” are drawn on the VRAM 50 in the range where the x coordinate is 2 ≦ x ≦ 54.

図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 work memory 105. On the work memory 105, 2 bits are assigned to one pixel. Since the glyph “i” has a width of 10 pixels, the memory access amount is 1 word. Since the height of the glyph “I” is 9 pixels, memory access of 1 × 9 = 9 words is required. The glyphs “RO”, “HA” and “NI” are also as shown in FIG. A total of 40 words of memory access is required for the work memory 105.

図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 VRAM 50. On the VRAM 50, one bit is assigned to one pixel. On the VRAM 50, memory access is performed in units of areas divided for each word, in this example, areas of 0 ≦ x ≦ 31 and 32 ≦ x ≦ 63. For example, since the glyph “i” is drawn in the range where the x coordinate is 2 ≦ x ≦ 11, a memory access of 1 word width × 9 pixels height = 9 words is required. Also, the glyph “ha” is drawn in the range of x ≦ 30 ≦ x ≦ 40, so it spans two areas, and memory access of 2 words wide × 10 pixels high = 20 words is required. The glyphs “RO” and “NI” are also as shown in FIG. A total of 50 words of memory access is required for the VRAM 50. When the access to the work memory 105 and the access to the VRAM 50 are combined, a total of 90 words of memory access is required.

図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 work memory 105 and 22 words for the VRAM 50. In this case, the memory access amount is reduced as compared with the case of individual drawing described with reference to FIG.

以上で説明したように、本実施形態によれば、複数の文字を複数のグリフからなる複合グリフのように扱うことで、メモリアクセスが低減される。ワークメモリ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 work memory 105 is often faster than the VRAM 50, the amount of access to the VRAM 50 often contributes more in terms of the time required for memory access. According to the present embodiment, since the access amount to the VRAM 50 is further reduced, the system can be speeded up.

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. Modification 1
FIG. 17 is a flowchart showing the operation of the information display apparatus 1 according to the first modification. Instead of the flow of FIG. 9, the flow of FIG. 17 may be used. In the flow of FIG. 17, the processing from step S100 to S150 is common to the flow of FIG. Instead of steps S160-180 in FIG. 9, steps S400-S430 are performed.

ステップS400において、CPU10は、命令DrawCharを発行する。ステップS410において、CPU10は、スタックが空であるか判断する。スタックが空であると判断された場合(S410:YES)、CPU10は、処理をステップS420に移行する。スタックが空でないと判断された場合(S410:NO)、CPU10は、処理をステップS120に移行する。   In step S400, the CPU 10 issues an instruction DrawChar. In step S410, the CPU 10 determines whether the stack is empty. When it is determined that the stack is empty (S410: YES), the CPU 10 shifts the processing to step S420. When it is determined that the stack is not empty (S410: NO), the CPU 10 shifts the processing to step S120.

ステップS420において、CPU10は、ダミーデータ(空のグリフデータ)を読み出す。ステップS430において、CPU10は、ダミーデータを対象グリフのデータとして命令DrawCharFillを発行する。ステップS420でダミーデータを読み出すのは、誤動作を防ぐためである。ステップS400−S430の処理は、順番が異なっているものの、基本的には図9のステップS160−180の処理と同様に行われる。   In step S420, the CPU 10 reads dummy data (empty glyph data). In step S430, the CPU 10 issues a command DrawCharFill with the dummy data as the data of the target glyph. The reason why the dummy data is read in step S420 is to prevent malfunction. The processing of steps S400 to S430 is basically performed in the same manner as the processing of steps S160 to 180 in FIG. 9 although the order is different.

4−2.変形例2
グリフデータの形式は、図4で説明したものに限定されない。Move、Line、Curve2、Curve3、EOC以外の命令が用いられてもよい。曲線を記述する関数として、4次以上の高次のベジェ曲線が用いられてもよいし、ベジェ曲線以外の曲線が用いられてもよい。要は、グリフの輪郭および前記輪郭の向きを示すものであれば、どのような形式のデータが用いられてもよい。また、実施形態では、複合グリフが2つのパーツグリフから構成される例を説明したが、複合グリフは3つ以上のパーツグリフを含んでいてもよい。また、パーツグリフが複合グリフであってもよい。また、グリフデータは輪郭線を特定するものであればよく、輪郭線の向きは含まなくてもよい。さらに、図14のフローは複数のグリフが描画される場合に用いられる例として説明したが、単一の単純グリフが描画される場合に図14のフローが用いられてもよい。
4-2. Modification 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. Modification 4
In the embodiment, the contour drawing module 104 has functions of executing contour calculation processing, drawing position calculation processing, and contour drawing processing, that is, functions as contour calculation means, drawing position calculation means, and contour drawing means. However, these functions may be realized by separate modules. The same applies to the filling module 106.

情報表示装置1のハードウェア構成は図1に示されるものに限定されない。必要な機能構成を実現できるものであれば、どのようなハードウェア構成を有する装置が用いられてもよい。フォントプロセッサ100についても同様である。また上述の実施形態では情報表示装置1が電子ペーパである例について説明したが、必要な機能を有するものであれば、パーソナルコンピュータ、PDA(Personal Digital Assistant)、携帯電話機など電子ペーパ以外の装置であってもよい。実施形態において情報表示装置1は表示装置(表示体107)を内蔵していたが、表示装置は外付けであってもよい。   The hardware configuration of the information display device 1 is not limited to that shown in FIG. An apparatus having any hardware configuration may be used as long as the necessary functional configuration can be realized. The same applies to the font processor 100. In the above-described embodiment, an example in which the information display device 1 is electronic paper has been described. However, any device other than electronic paper, such as a personal computer, a PDA (Personal Digital Assistant), or a mobile phone, may be used as long as it has a necessary function. There may be. In the embodiment, the information display device 1 includes the display device (display body 107), but the display device may be externally attached.

上述の実施形態において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 CPU 10 includes a magnetic recording medium (magnetic tape, magnetic disk (HDD (Hard Disk Drive), FD (Flexible Disk)), etc.), optical recording medium (optical disk (CD (Compact Disk)). , DVD (Digital Versatile Disk), etc.), magneto-optical recording medium, semiconductor memory (flash ROM, etc.) and the like. The program may be downloaded via a network such as the Internet.

一実施形態に係る情報表示装置1のハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the information display apparatus 1 which concerns on one Embodiment. フォントプロセッサ100の構成を示す図である。2 is a diagram illustrating a configuration of a font processor 100. FIG. 情報表示装置1の外観を示す図である。1 is a diagram illustrating an appearance of an information display device 1. FIG. グリフデータを例示する図である。It is a figure which illustrates glyph data. True Typeフォントで推奨されている描画方法を説明する図である。It is a figure explaining the drawing method recommended with the True Type font. 特許文献1による描画方法を説明する図である。It is a figure explaining the drawing method by patent document 1. FIG. 正確に描画できない複合グリフを例示する図である。It is a figure which illustrates the composite glyph which cannot be drawn correctly. 本実施形態による描画方法を説明する図である。It is a figure explaining the drawing method by this embodiment. 情報表示装置1の動作を示すフローチャートである。3 is a flowchart showing an operation of the information display device 1. 輪郭描画モジュール104の動作を示すフローチャートである。5 is a flowchart showing the operation of the contour drawing module 104. 塗り潰しモジュール106の動作を示すフローチャートである。3 is a flowchart showing the operation of a filling module 106. 巻き数wnの変化を例示する図である。It is a figure which illustrates change of winding number wn. 複数の文字を描画する動作を示すフローチャートである。It is a flowchart which shows the operation | movement which draws a several character. 各グリフの大きさおよびVRAM50上の描画範囲を示す。The size of each glyph and the drawing range on the VRAM 50 are shown. 各グリフを個別に描画した場合のメモリアクセス量を示す。Indicates the memory access amount when each glyph is drawn individually. 本実施形態に係る描画方法によるメモリアクセス量を示す。The memory access amount by the drawing method concerning this embodiment is shown. 変形例1に係る情報表示装置1の動作を示すフローチャートである。10 is a flowchart showing an operation of the information display device 1 according to Modification 1.

符号の説明Explanation of symbols

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 SYMBOLS 1 ... Information display apparatus, 10 ... CPU, 20 ... ROM, 30 ... RAM, 40 ... Display body, 50 ... VRAM, 60 ... Display control apparatus, 70 ... Input device, 80 ... Bus, 90 ... Bus controller, 100 ... Font Processor: 101 ... Main controller, 102 ... Register, 103 ... Font drawing controller, 104 ... Outline drawing module, 105 ... Work memory, 106 ... Fill module, 107 ... Bus interface module, 108 ... Main bus, 109 ... Sub bus

Claims (5)

2次元配置され、2次元座標系を用いて各画素の位置が特定される複数の画素のデータを記憶するメモリと、
グリフの輪郭線の描画を命令する第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.
前記塗り潰し処理は、前記マトリクスの1つの行または1つの列を対象線とし、前記対象線に沿って一画素ずつ階調を決定する処理であって、前記対象線と前記輪郭線とが交わる向きに応じて増減するパラメータに応じて前記画素が塗りつぶされるかを決定する処理である
ことを特徴とする請求項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.
JP2008122146A 2008-05-08 2008-05-08 Font plotting device and information processor Pending JP2009271347A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (4)

* Cited by examiner, † Cited by third party
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)