JP2001331166A - Character processor - Google Patents
Character processorInfo
- Publication number
- JP2001331166A JP2001331166A JP2000150303A JP2000150303A JP2001331166A JP 2001331166 A JP2001331166 A JP 2001331166A JP 2000150303 A JP2000150303 A JP 2000150303A JP 2000150303 A JP2000150303 A JP 2000150303A JP 2001331166 A JP2001331166 A JP 2001331166A
- Authority
- JP
- Japan
- Prior art keywords
- font data
- font
- division
- outline
- character
- 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
- 238000012545 processing Methods 0.000 claims abstract description 107
- 239000013598 vector Substances 0.000 claims abstract description 75
- 238000000034 method Methods 0.000 claims description 41
- 238000013500 data storage Methods 0.000 description 24
- 238000010586 diagram Methods 0.000 description 22
- 238000011161 development Methods 0.000 description 14
- 238000006243 chemical reaction Methods 0.000 description 10
- 238000007726 management method Methods 0.000 description 10
- 239000011159 matrix material Substances 0.000 description 10
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005429 filling process Methods 0.000 description 1
- 238000010422 painting Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Landscapes
- Document Processing Apparatus (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、アウトラインフォ
ントデータをビットマップ展開する文字処理装置に関す
るものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a character processing device for developing outline font data into a bit map.
【0002】[0002]
【従来の技術】図14は、一般的なアウトラインフォン
トデータをビットマップ展開する際の処理過程の一例の
説明図である。アウトラインフォントデータをビットマ
ップ形式に展開するためには、まず、要求された文字の
アウトラインフォントデータを2次記憶装置などから読
み込む。アウトラインフォントデータは、例えば図14
(A)に示すように、フォントの外形を示す直線ベクタ
や曲線ベクタの集合である。図14では文字「D」の例
を示している。2. Description of the Related Art FIG. 14 is an explanatory diagram showing an example of a process for developing general outline font data into a bitmap. To develop the outline font data into a bitmap format, the outline font data of the requested character is first read from a secondary storage device or the like. The outline font data is, for example, as shown in FIG.
As shown in (A), it is a set of linear vectors and curved vectors indicating the outline of the font. FIG. 14 shows an example of the character “D”.
【0003】次に、読み込んだ図14(A)に示すよう
なアウトラインフォントデータを、図14(B)に示す
ような指定されたサイズに変換するため、マトリクス変
換を行う。このとき、回転などを行う場合もある。さら
に、図14(C)に示すように、曲線ベクタについては
直線近似し、すべて直線ベクタに変換した後、スキャン
ラインごとに塗りつぶしの処理を行い、図14(D)に
示すようなビットマップに展開する。Next, matrix conversion is performed to convert the read outline font data as shown in FIG. 14A to a designated size as shown in FIG. 14B. At this time, rotation or the like may be performed. Further, as shown in FIG. 14 (C), the curve vector is approximated by a straight line, and after converting all to a straight line vector, a filling process is performed for each scan line to form a bit map as shown in FIG. 14 (D). expand.
【0004】また、曲線ベクタについて直線近似した場
合も含め、すべて直線ベクタで構成されたアウトライン
フォントデータをビットマップ展開する際には、従来は
直線ベクタで構成される多角形の各辺と出力デバイスの
各スキャンラインとの交点座標をDDA(Digita
l Differential Analyzer)な
どにより計算する。そして、計算した交点座標を、各ス
キャンライン毎にX座標値でソートして塗りつぶしの始
点と終点の対応を求め、その区間に対応したスキャンラ
インに平行な線分をメモリ上に描画していた。[0004] In addition, when outline font data composed entirely of linear vectors, including the case where a curved vector is linearly approximated, is developed into a bitmap, conventionally, each side of a polygon composed of linear vectors and an output device are used. The coordinates of the intersection with each scan line in DDA (Digital
1 Differential Analyzer) or the like. Then, the calculated intersection coordinates are sorted by the X coordinate value for each scan line to determine the correspondence between the start point and the end point of the filling, and a line segment parallel to the scan line corresponding to the section is drawn on the memory. .
【0005】このように、アウトラインフォントデータ
をビットマップ展開する処理は、各辺毎のDDAでの交
点計算やソートなどを含んでいる。これらの処理は非常
に重い処理であり、全体の処理速度を落とす大きな要因
となっている。そこで、専用ハードウエアによる高速化
が図られている。[0005] As described above, the process of developing outline font data into bitmaps includes calculation of intersections and sorting by DDA for each side. These processes are very heavy processes, and are a major factor in reducing the overall processing speed. Therefore, speeding up has been achieved by dedicated hardware.
【0006】しかし、比較的単純な凸多角形を描画する
場合にはよいが、入力される図形の複雑さに制約が無い
場合には、交点の個数にも制限がなく、ハードウエアで
構成することは非常に困難である。図15は、描画図形
の一例の説明図である。例えば図15(A)に示すよう
な単純な凸多角形では、各スキャンラインとの交点は2
点であり、交点計算やソートもハードウエアで簡単に行
うことができる。しかし、図15(B)に示すように凹
部を含んでいる場合や図15(C)のように辺の交差を
含んでいる場合には、各スキャンラインについて複数の
始点と終点の対が存在することになる。これらの場合、
交点がいくつ発生するか分からない状況においてDDA
などの交点計算を行うハードウエアを交点の数だけ設け
ることは不可能であるし、コストの観点から制限せざる
を得ない。また、個数が不明な多くの交点をソートして
対応を見つけるソート回路をハードウエアで構成するこ
とは非常に困難である。However, it is good to draw a relatively simple convex polygon, but if there is no restriction on the complexity of the input figure, there is no limitation on the number of intersections, and it is constituted by hardware. It is very difficult. FIG. 15 is an explanatory diagram of an example of a drawing graphic. For example, in a simple convex polygon as shown in FIG.
It is a point, and intersection calculation and sorting can be easily performed by hardware. However, when a concave portion is included as shown in FIG. 15B or when an intersection of sides is included as shown in FIG. 15C, a plurality of pairs of start points and end points exist for each scan line. Will do. In these cases,
DDA in a situation where you do not know how many intersections occur
It is impossible to provide the same number of pieces of hardware as the number of intersections, and the number of intersections must be limited from the viewpoint of cost. Also, it is very difficult to configure a sort circuit that sorts many intersections whose number is unknown and finds a correspondence by hardware.
【0007】このような問題を解決する試みとして、ソ
ートが発生しない部分図形に分割してビットマップデー
タを生成する手法がある。図16は、図形分割による描
画手法の一例の説明図である。図16(A)に示すよう
な直線ベクタで構成された多角形データを、図16
(B)に点線で示すように、底辺がスキャンラインに平
行な台形(四角形や三角形を含む)などのソートが発生
しない部分図形に分割する。分割された部分図形の一つ
を図16(C)に示している。このような分割された台
形などの部分図形をもとにビットマップ展開を行い、図
16(D)に示すビットマップデータを生成すればよ
い。As an attempt to solve such a problem, there is a method of generating bitmap data by dividing into partial figures in which sorting does not occur. FIG. 16 is an explanatory diagram of an example of a drawing method using figure division. Polygon data composed of straight line vectors as shown in FIG.
As shown by the dotted line in (B), the image is divided into partial figures such as trapezoids (including rectangles and triangles) whose bases are parallel to the scan line, where sorting does not occur. One of the divided partial figures is shown in FIG. The bitmap data shown in FIG. 16D may be generated by performing bitmap development based on such a divided figure such as a trapezoid.
【0008】さらに、例えば特開平11−144066
号公報に記載されている図形処理装置では、展開処理部
に2N個のDDA回路と2N個のデータをソート可能な
ソート回路を持ち、各スキャンラインでの描画線分数を
N本以下に制限した多角形に分割して処理している。ま
た、このような複数の多角形に分割したデータをキャッ
シュに登録することにより、展開処理を高速化する方法
も考案されている。Further, for example, Japanese Patent Application Laid-Open No. H11-144066
In the graphic processing apparatus described in Japanese Patent Application Laid-Open No. H10-264, the development processing unit has 2N DDA circuits and a sort circuit capable of sorting 2N data, and limits the number of drawing line segments in each scan line to N or less. It is divided into polygons and processed. Also, a method has been devised for accelerating the expansion processing by registering such data divided into a plurality of polygons in a cache.
【0009】しかしながら、このような複数の部分図形
に分割する場合には、分割する必要があるか否かを判定
しなければならない。この判定には、すべてのスキャン
ラインについてエッジの数が2Nを超えているか否かを
調べる必要があるため、処理に時間がかかるという問題
がある。さらに、要求されたすべての図形に対し分割判
定処理を行うため、さらに処理時間が長くなる。However, when dividing into such a plurality of partial figures, it is necessary to determine whether or not the division is necessary. In this determination, it is necessary to check whether or not the number of edges exceeds 2N for all scan lines. Further, since the division determination processing is performed for all the requested graphics, the processing time is further increased.
【0010】特に文書を描画する場合、各文字が1ない
し複数の図形で構成され、それらの図形に対して分割す
るか否かを判定しなければならないため、多大な処理時
間を要していた。しかし、実際には図形の分割を行うこ
とは少なく、多くの場合、分割判定処理の処理時間が無
駄になっていた。In particular, when drawing a document, each character is composed of one or a plurality of figures, and it must be determined whether or not to divide these figures, which requires a great deal of processing time. . However, in practice, the figure is rarely divided, and in many cases, the processing time of the division determination processing is wasted.
【0011】[0011]
【発明が解決しようとする課題】本発明は、上述した事
情に鑑みてなされたもので、高速な文字の展開処理が可
能な文字処理装置を提供することを目的とするものであ
る。SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a character processing apparatus capable of high-speed character expansion processing.
【0012】[0012]
【課題を解決するための手段】本発明は、アウトライン
フォントデータをビットマップ展開する文字処理装置に
おいて、アウトラインフォントデータと、そのアウトラ
インフォントデータについて複数の多角形に分割する必
要があるか否かを判別するための分割判定フラグとをフ
ォント情報管理手段で管理している。そして、要求のあ
ったフォントについてビットマップ展開する際に分割判
定フラグを参照し、分割する必要がある場合に分割処理
手段で複数の図形に分解する。このように、分割する必
要があるか否かを予め分割判定フラグとして持っている
ので、従来必要であった分割判定処理を省略し、高速な
ビットマップ展開処理を行うことが可能である。SUMMARY OF THE INVENTION According to the present invention, in a character processing apparatus for developing outline font data into a bit map, outline font data and whether or not it is necessary to divide the outline font data into a plurality of polygons are determined. The division determination flag for determination is managed by font information management means. Then, when a bitmap is developed for the requested font, the division determination flag is referred to, and when it is necessary to divide the font, the figure is decomposed into a plurality of figures by the division processing means. As described above, whether or not division is necessary is previously stored as a division determination flag, so that conventionally required division determination processing can be omitted, and high-speed bitmap expansion processing can be performed.
【0013】なお、フォントの描画の際には、90度回
転したフォントが要求される場合がある。回転しない場
合と90度回転した場合とではスキャンラインとの交差
するベクタが異なるため、例えば分割判定フラグとし
て、回転しない場合と回転した場合のそれぞれについ
て、分割する必要があるか否かを示す情報を保持させて
おくとよい。これによって、90度回転したフォントが
要求された場合でも、分割処理を行わなくて済み、高速
なビットマップ展開処理を行うことができる。When drawing a font, a font rotated by 90 degrees may be required. Since the vector intersecting with the scan line is different between the case where the rotation is not performed and the case where the rotation is performed by 90 degrees, for example, as a division determination flag, information indicating whether or not it is necessary to perform division for each of the case where the rotation is not performed and the case where the rotation is performed Should be kept. As a result, even when a font rotated by 90 degrees is requested, the division processing does not need to be performed, and high-speed bitmap development processing can be performed.
【0014】[0014]
【発明の実施の形態】図1は、本発明の文字処理装置の
実施の一形態を示すブロック図である。図中、1は入力
部、2は制御部、3はフォント情報管理部、4は直線ベ
クタ生成部、5は分割処理部、6はフォントキャッシュ
部、7は展開処理部、8は出力部である。入力部1は、
ユーザによる指示や外部からの入力により、フォントの
種類を表すフォントID、文字コード、文字サイズ、文
字の回転の有無を表すフラグなど、種々の文字データを
受け取って制御部2に送る。FIG. 1 is a block diagram showing an embodiment of a character processing apparatus according to the present invention. In the figure, 1 is an input unit, 2 is a control unit, 3 is a font information management unit, 4 is a straight line vector generation unit, 5 is a division processing unit, 6 is a font cache unit, 7 is a development processing unit, and 8 is an output unit. is there. The input unit 1
Various character data, such as a font ID representing a font type, a character code, a character size, and a flag representing the presence or absence of rotation of a character, are received and sent to the control unit 2 by a user's instruction or an external input.
【0015】制御部2は、要求された文字のフォントI
D、文字コード、文字サイズをフォントキャッシュ部6
に転送し、該当するフォントデータが登録されている場
合は、登録されているフォントデータを受け取る。以下
の説明では、フォントデータはすべて直線ベクタで表さ
れたアウトラインフォントデータであるものとするが、
これに限られるものではない。またこの場合にはフォン
トデータには分割判定フラグも含まれているものとす
る。受け取ったフォントデータは、分割処理部5に転送
する。分割処理部5において必要に応じて複数の図形に
分割されたアウトラインフォントデータを受け取り、展
開処理部7にビットマップ展開させる。また、該当する
フォントデータがフォントキャッシュ部6に登録されて
いない場合は、まずフォント情報管理部3から該当する
アウトラインフォントデータおよび分割判定フラグを読
み出し、曲線ベクタについては直線ベクタ生成部4で直
線近似した後、キャッシュ部6に登録する。次に、直線
ベクタ生成部4で曲線ベクタについて直線近似した後の
アウトラインフォントデータに対して、分割処理部5に
おいて、分割判定フラグに応じて分割が必要な場合は複
数の図形に分割したアウトラインフォントデータを生成
させる。最後に展開処理部7に対し、ビットマップ展開
を行わせる。ビットマップ展開を行った結果は、出力部
8に出力する。The control unit 2 controls the font I of the requested character.
Font cache 6 for D, character code, and character size
When the corresponding font data is registered, the registered font data is received. In the following description, it is assumed that all font data is outline font data represented by a straight line vector,
However, it is not limited to this. In this case, it is assumed that the font data also includes a division determination flag. The received font data is transferred to the division processing unit 5. The division processing unit 5 receives the outline font data divided into a plurality of figures as necessary, and causes the development processing unit 7 to perform bitmap development. When the corresponding font data is not registered in the font cache unit 6, first, the corresponding outline font data and the division determination flag are read from the font information management unit 3, and the straight line vector generation unit 4 performs linear approximation for the curved vector. After that, the information is registered in the cache unit 6. Next, the outline font data obtained by linearly approximating the curve vector by the straight line vector generation unit 4 is divided into a plurality of figures by the division processing unit 5 when the outline font data is divided according to the division determination flag. Generate data. Finally, the expansion processing unit 7 is caused to perform bitmap expansion. The result of the bitmap expansion is output to the output unit 8.
【0016】フォント情報管理部3は、アウトラインフ
ォントデータを保持しており、要求されたフォントID
および文字コードに対応するアウトラインフォントデー
タを読み込み、文字サイズや回転の有無などに応じたマ
トリクス変換を行った後、制御部2に転送する。さら
に、複数の多角形に分割する必要があるか否かを判別す
る分割判定フラグを保持しており、アウトラインフォン
トデータに対応する分割判定フラグを読み込み、同様に
制御部2に転送する。The font information management unit 3 holds outline font data, and receives a requested font ID.
After reading the outline font data corresponding to the character code and performing matrix conversion in accordance with the character size and the presence or absence of rotation, the font data is transferred to the control unit 2. Further, it holds a division judgment flag for judging whether or not it is necessary to divide the polygon into a plurality of polygons, reads the division judgment flag corresponding to the outline font data, and transfers it to the control unit 2 in the same manner.
【0017】直線ベクタ生成部4は、フォント情報管理
部3で読み込んだアウトラインフォントデータに曲線ベ
クタが含まれている場合、その曲線ベクタを微小な直線
ベクタで近似する処理を行う。これによってすべて直線
ベクタで構成されたアウトラインフォントデータを生成
する。もちろん、最初からすべて直線ベクタで構成され
ているアウトラインフォントデータについては、この直
線ベクタ生成部4の処理は必要ない。When the outline font data read by the font information management unit 3 includes a curve vector, the straight line vector generation unit 4 performs a process of approximating the curve vector with a minute straight line vector. As a result, outline font data composed entirely of linear vectors is generated. Of course, the processing of the straight line vector generation unit 4 is not necessary for outline font data that is composed entirely of straight line vectors from the beginning.
【0018】分割処理部5は、すべて直線ベクタで構成
されているアウトラインフォントデータについて、その
アウトラインフォントデータに対応する分割判定フラグ
が分割の必要がある旨を示している場合、各スキャンラ
インでの描画線分数を制限した部分図形に分割したアウ
トラインフォントデータを生成する。When the division determination flag corresponding to the outline font data indicates that the outline font data needs to be divided, the division processing unit 5 performs the processing for each scan line. Generate outline font data divided into partial figures with limited drawing line segments.
【0019】フォントキャッシュ部6は、すべて直線ベ
クタで構成されているアウトラインフォントデータおよ
び対応する分割判定フラグを含むフォントデータを登録
する。次に同じフォントID、文字コード、文字サイズ
のデータが要求されたら、フォントキャッシュ部6から
該当するフォントデータを読み込み、制御部2に転送す
る。ここでは、登録するアウトラインフォントデータと
して、直線ベクタ生成部4で曲線ベクタを直線近似した
分割処理前のアウトラインフォントデータとするが、も
ちろん、例えば分割処理部5で必要に応じて複数の図形
に分割処理した後のアウトラインフォントデータを登録
してもよい。この場合には、既に分割処理されているの
で、分割判定フラグは不要である。The font cache unit 6 registers outline font data, which is composed entirely of linear vectors, and font data including a corresponding division determination flag. Next, when data of the same font ID, character code, and character size is requested, the corresponding font data is read from the font cache unit 6 and transferred to the control unit 2. Here, the outline font data to be registered is the outline font data before the division process in which the straight line vector generation unit 4 linearly approximates the curve vector, but of course, the division processing unit 5 divides the outline vector data into a plurality of figures as necessary. The outline font data after the processing may be registered. In this case, since the division processing has already been performed, the division determination flag is unnecessary.
【0020】展開処理部7は、必要に応じて分割処理部
5で分割処理したアウトラインフォントデータをビット
マップ展開し、制御部2に転送する。The expansion processing section 7 performs bitmap expansion of the outline font data divided by the division processing section 5 as necessary, and transfers the outline font data to the control section 2.
【0021】出力部8は、前記展開処理部7でビットマ
ップ展開したデータを制御部2から受け取り、プリンタ
やディスプレイ装置などの出力デバイスに転送する。こ
れによって、印刷や表示が行われる。The output unit 8 receives from the control unit 2 the data that has been bit-mapped by the expansion processing unit 7, and transfers the data to an output device such as a printer or a display device. Thereby, printing and display are performed.
【0022】図2は、本発明の文字処理装置の実施の一
形態における全体の動作の一例を示すフローチャートで
ある。S41において、入力部1からフォントID、文
字コード、文字サイズ、文字の回転の有無を表すフラグ
など、種々の文字データを取得し、制御部2に送る。FIG. 2 is a flowchart showing an example of the overall operation of the character processing apparatus according to the embodiment of the present invention. In S41, various character data such as a font ID, a character code, a character size, and a flag indicating whether or not the character is rotated are acquired from the input unit 1 and sent to the control unit 2.
【0023】S42において、制御部2は、要求された
文字のフォントID、文字コード、文字サイズをフォン
トキャッシュ部6に転送し、該当するフォントデータが
登録されているか否かを調べる。フォントキャッシュ部
6に登録されていれば、S46において、フォントキャ
ッシュ部6からアウトラインフォントデータ及び分割判
定フラグを含むフォントデータを読み込み、S43〜S
45の処理を省略してS47へ進む。このようにフォン
トキャッシュ部6に登録されているフォントについては
S43〜S45の処理を省略できるので、処理全体を高
速化することができる。In S42, the control unit 2 transfers the font ID, character code, and character size of the requested character to the font cache unit 6, and checks whether or not the corresponding font data is registered. If the font data is registered in the font cache unit 6, the font data including the outline font data and the division determination flag is read from the font cache unit 6 in S46.
The process skips the step 45 and proceeds to S47. As described above, since the processing of S43 to S45 can be omitted for the fonts registered in the font cache unit 6, the entire processing can be speeded up.
【0024】また、S42においてフォントキャッシュ
部6に該当するフォントデータが登録されていない場合
には、S43において、要求された文字(フォントI
D、文字コードなど)に対応するアウトラインフォント
データ及び分割判定フラグを読み込み、マトリクス変換
を行う。そしてS44において、アウトラインフォント
データ中に曲線ベクタが含まれていれば、直線ベクタ生
成部4で曲線ベクタを直線近似して、すべて直線ベクタ
から構成されるアウトラインフォントデータを生成す
る。S45において、すべて直線ベクタで構成されるア
ウトラインフォントデータと、フォントID、文字コー
ド、文字サイズなどの情報および分割判定フラグを含む
フォントデータをフォントキャッシュ部6に転送し、登
録する。登録したフォントデータは、後で同じ文字が要
求されたときにS46において読み出され、利用され
る。If the font data corresponding to the font data is not registered in the font cache unit 6 in S42, the requested character (font I
D, character code, etc.) and the division determination flag are read, and matrix conversion is performed. In step S44, if the outline font data includes a curve vector, the straight line vector generation unit 4 linearly approximates the curve vector to generate outline font data including all the straight line vectors. In step S45, the outline font data, which is composed entirely of straight-line vectors, and the font data including information such as the font ID, character code, and character size, and the division determination flag are transferred to the font cache unit 6 and registered. The registered font data is read out and used in S46 when the same character is requested later.
【0025】S47において、分割判定フラグが分割の
必要がある旨を示しているか否かを調べる。そして分割
判定フラグが分割の必要がある旨を示しているときに
は、S48において、分割処理部5はすべて直線ベクタ
で構成されているアウトラインフォントデータについ
て、各スキャンラインでの描画線分数を制限した部分図
形に分割したアウトラインフォントデータを生成する。
分割判定フラグが分割の必要がない旨を示しているとき
には、S48の処理をスキップしてS49へ進む。In S47, it is checked whether or not the division determination flag indicates that the division is necessary. When the division determination flag indicates that the division is necessary, in S48, the division processing unit 5 sets the part of the outline font data, which is composed of all the linear vectors, in which the number of drawing line segments in each scan line is limited. Generate outline font data divided into figures.
When the division determination flag indicates that there is no need for division, the process of S48 is skipped and the process proceeds to S49.
【0026】S49において、必要に応じて図形の分割
を行った後のアウトラインフォントデータをもとに、展
開処理部7でビットマップ展開する。そしてS50にお
いて、展開処理部7でビットマップ展開されたデータを
出力部8へ転送する。In step S49, the development processing unit 7 performs bitmap development based on the outline font data obtained by dividing the graphic as necessary. Then, in S50, the data subjected to bitmap development by the development processing unit 7 is transferred to the output unit 8.
【0027】このような動作を、入力される文字の数だ
け繰り返して行うことになる。このように本発明の文字
処理装置では、分割処理が必要か否かを判断する際に、
従来のように実際にスキャンラインごとに分割の要否を
判定する処理を行わず、分割判定フラグを用いて判断す
るので、高速な処理が可能である。Such an operation is repeated by the number of input characters. As described above, in the character processing device of the present invention, when determining whether the division process is necessary,
Since the determination using the division determination flag is not performed as in the related art without actually performing the process of determining whether or not the division is necessary for each scan line, high-speed processing is possible.
【0028】次に、本発明の文字処理装置の実施の一形
態における主要部の詳細について説明する。図3は、フ
ォント情報管理部3の一例を示すブロック図である。図
中、11はアウトラインフォントデータ読込部、12は
アウトラインフォントデータ格納部、13は分割判定フ
ラグ読込部、14は分割判定フラグ格納部、15はマト
リクス変換部である。Next, the details of the main part of an embodiment of the character processing apparatus of the present invention will be described. FIG. 3 is a block diagram illustrating an example of the font information management unit 3. In the figure, 11 is an outline font data reading unit, 12 is an outline font data storage unit, 13 is a division determination flag reading unit, 14 is a division determination flag storage unit, and 15 is a matrix conversion unit.
【0029】アウトラインフォントデータ格納部12
は、各文字に対応するアウトラインフォントデータが登
録されている。図4は、アウトラインフォントデータ格
納部12内のアウトラインフォントデータのデータ構造
の一例を示す説明図である。アウトラインフォントデー
タは、図4(A)に示すように、フォントの種類を表す
フォントIDと、マップと称した文字コードのテーブル
を対応させている。さらに、それぞれのフォントの種類
ごとに設けられたマップにおいて、図4(B)に示すよ
うに、文字コードと、文字を構成するアウトラインフォ
ントデータへのポインタを保持している。さらに、アウ
トラインフォントデータは、図4(C)に示すように、
各文字ごとに描画命令数とその描画命令数だけの描画命
令及び必要とする座標値などによって構成されている。
ここで、描画命令数は1文字分のデータに含まれる描画
命令の数を表す。また、描画命令はカレントポイントの
移動や、直線描画、曲線描画などの命令を表す。移動先
の相対座標が座標として表されている。このようなデー
タ構造によって、例えばフォントIDと文字コードが指
定されれば、これらによって特定されたポインタが指し
示すアドレスを参照し、描画命令数を取り出し、以後、
描画命令数だけの描画命令及び付随する座標値などのデ
ータを取り出すことによって、所望のアウトラインフォ
ントデータを取得することができる。Outline font data storage unit 12
Is registered with outline font data corresponding to each character. FIG. 4 is an explanatory diagram showing an example of the data structure of the outline font data in the outline font data storage unit 12. In the outline font data, as shown in FIG. 4A, a font ID indicating a font type is associated with a character code table called a map. Further, in a map provided for each font type, as shown in FIG. 4B, a character code and a pointer to outline font data constituting the character are held. Furthermore, as shown in FIG. 4C, the outline font data
Each character is composed of the number of drawing commands, drawing commands corresponding to the number of drawing commands, required coordinate values, and the like.
Here, the number of drawing commands represents the number of drawing commands included in data for one character. The drawing command represents a command for moving the current point, drawing a straight line, drawing a curve, and the like. The relative coordinates of the movement destination are represented as coordinates. If a font ID and a character code are specified by such a data structure, for example, the address indicated by the pointer specified by these is referred to, the number of drawing instructions is extracted, and thereafter,
The desired outline font data can be obtained by extracting data such as the drawing commands corresponding to the drawing commands and the associated coordinate values.
【0030】分割判定フラグ格納部14は、各アウトラ
インフォントデータに対応付けて分割判定フラグを保持
している。上述のように、分割判定フラグは、文字の図
形を複数の図形に分割する必要があるか否かを判別する
ためのフラグである。アウトラインフォントデータごと
に、あらかじめ分割の必要があるか否かを調べておき、
それぞれのアウトラインフォントデータに対応付けて分
割判定フラグとして保持している。図5は、分割判定フ
ラグ格納部14におけるデータ構造の一例の説明図であ
る。例えば図5(A)に示すように、文字コードと分割
判定フラグを対応付けて保持しておくことができる。も
ちろん、文字の書体によって分割判定フラグが異なるこ
とも予想されるので、フォントIDごとに設けておいて
もよい。ここで、分割判定フラグは、文字の回転がない
時のみ分割の必要がある場合は01、文字が90度回転
する時のみ分割の必要がある場合は10、文字の回転に
関係なく分割が必要な場合は11、分割の必要がない場
合は00として示している。The division determination flag storage unit 14 holds a division determination flag in association with each outline font data. As described above, the division determination flag is a flag for determining whether it is necessary to divide a character figure into a plurality of figures. For each outline font data, check in advance whether it is necessary to divide it,
It is held as a division determination flag in association with each outline font data. FIG. 5 is an explanatory diagram of an example of a data structure in the division determination flag storage unit 14. For example, as shown in FIG. 5A, a character code and a division determination flag can be stored in association with each other. Of course, it is expected that the division determination flag will be different depending on the font of the character, so that it may be provided for each font ID. Here, the division determination flag is set to 01 when division is necessary only when there is no rotation of the character, 10 when division is necessary only when the character is rotated 90 degrees, and division is necessary regardless of the rotation of the character. In this case, 11 is shown, and when there is no need for division, 00 is shown.
【0031】具体的には、図5(B)に示す文字「価」
では、破線で示すスキャンラインにおいて5本の線分が
交差する。ここで、展開処理部7に8個のDDA回路が
設けられているものとし、描画線分数を4(すなわちベ
クタ数は8)に制限する場合には、制限を越えるため図
形の分割が必要である。しかし、この文字「価」は、9
0度回転した場合には、スキャンラインごとの描画線分
数は最大で3であり、図形の分割を必要としない。その
ため、この文字「価」に対する分割判定フラグとしては
01が格納される。一方、図5(C)に示す文字「言」
は、そのままの状態ではスキャンラインごとの描画線分
数は最大で2であり、図形の分割は必要ない。しかし、
図5(C)に示すように90度回転した場合には、スキ
ャンラインごとの描画線分数は最大で6となり、図形の
分割が必要である。そのため、この文字「言」に対応す
る分割判定フラグとしては10が格納される。また、例
えば「齋」などのように複雑な形状の文字では、そのま
までも、また90度回転しても図形の分割が必要な場合
があり、そのような文字に対しては分割判定フラグとし
て11が格納される。さらに、例えば文字「一」のよう
に、そのままでも、また90度回転しても図形の分割が
必要ない文字に対しては、分割フラグとして00が格納
される。Specifically, the character "value" shown in FIG.
Then, five line segments intersect in the scan line indicated by the broken line. Here, it is assumed that the development processing unit 7 is provided with eight DDA circuits, and when the number of drawing line segments is limited to four (that is, the number of vectors is eight), the figure division is required because the limit is exceeded. is there. However, this character "value" is 9
When rotated by 0 degrees, the number of drawing line segments for each scan line is 3 at the maximum, and there is no need to divide a figure. Therefore, 01 is stored as the division determination flag for the character "value". On the other hand, the character "word" shown in FIG.
In this case, the number of drawing line segments for each scan line is 2 at the maximum, and there is no need to divide a figure. But,
When rotated by 90 degrees as shown in FIG. 5C, the number of drawing line segments for each scan line is 6 at the maximum, and the figure needs to be divided. Therefore, 10 is stored as the division determination flag corresponding to the character “word”. Further, for a character having a complicated shape such as “sai”, for example, a figure may need to be divided as it is or even if rotated by 90 degrees. Is stored. Further, 00 is stored as a division flag for a character such as the character "1" which does not need to be divided even if rotated as it is or rotated by 90 degrees.
【0032】アウトラインフォントデータ読込部11
は、制御部2からフォントIDや文字コードなどの文字
データを受け取り、フォントIDと文字コードに対応す
るアウトラインフォントデータをアウトラインフォント
データ格納部12から読み込んで、文字の大きさや回転
などの指示情報とともにマトリクス変換部15へ渡す。
また、フォントIDや文字コードなどを分割判定フラグ
読込部13に渡す。Outline font data reading unit 11
Receives character data such as a font ID and a character code from the control unit 2 and reads outline font data corresponding to the font ID and the character code from the outline font data storage unit 12 together with instruction information such as character size and rotation. It is passed to the matrix conversion unit 15.
In addition, it passes the font ID and the character code to the division determination flag reading unit 13.
【0033】分割判定フラグ読込部13は、アウトライ
ンフォントデータ読込部11から渡されるフォントID
や文字コードなどを元に、対応する分割判定フラグを分
割判定フラグ格納部14から読み出し、制御部2に転送
する。The division determination flag reading unit 13 receives the font ID passed from the outline font data reading unit 11
The corresponding division determination flag is read out from the division determination flag storage unit 14 based on the password and the character code, and is transferred to the control unit 2.
【0034】マトリクス変換部15は、アウトラインフ
ォントデータ読込部11から渡される指示情報をもとに
アウトラインフォントデータに対してマトリクス変換を
行って制御部2に転送する。The matrix conversion unit 15 performs matrix conversion on the outline font data based on the instruction information passed from the outline font data reading unit 11 and transfers the data to the control unit 2.
【0035】フォント情報管理3は、このような構成に
よって、アウトラインフォントデータ読込部11は、制
御部2から渡されるフォントIDおよび文字コードに対
応するアウトラインフォントデータをアウトラインフォ
ントデータ格納部12から読み込む。そして、文字サイ
ズや回転の有無などに応じたマトリクス変換をマトリク
ス変換部15で行った後、制御部2に転送する。一方、
分割判定フラグ読込部13では、アウトラインフォント
データ読込部11から渡されるフォントIDや文字コー
ドなどに従い、読み出したアウトラインフォントデータ
に対応する分割判定フラグを分割判定フラグ格納部14
から読み込み、同様に制御部2に転送する。In the font information management unit 3 having such a configuration, the outline font data reading unit 11 reads outline font data corresponding to the font ID and the character code passed from the control unit 2 from the outline font data storage unit 12. Then, the matrix conversion unit 15 performs matrix conversion according to the character size, the presence or absence of rotation, and the like, and then transfers it to the control unit 2. on the other hand,
The division determination flag reading unit 13 stores the division determination flag corresponding to the read outline font data in the division determination flag storage unit 14 according to the font ID and the character code passed from the outline font data reading unit 11.
And transfers it to the control unit 2 in the same manner.
【0036】次に、直線ベクタ生成部4について詳細に
説明する。直線ベクタ生成部4は、フォント情報管理部
3で読み込んだアウトラインフォントデータ中に曲線ベ
クタが含まれている場合に、その曲線ベクタを微小な直
線ベクタで近似する処理を行う。このとき、例えば近似
した直線ベクタと曲線ベクタとの誤差が、予め指定され
ている精度以下となるようにする。Next, the straight line vector generator 4 will be described in detail. When the outline font data read by the font information management unit 3 includes a curve vector, the straight line vector generation unit 4 performs a process of approximating the curve vector with a minute straight line vector. At this time, for example, an error between the approximated straight line vector and the curved line vector is set to be equal to or less than a predetermined accuracy.
【0037】図6は、直線ベクタ生成部4における直線
ベクタの生成動作の一例の説明図である。例えば曲線ベ
クタには、図6(A)に示すような4つの制御点A〜D
で表現されるベジエ曲線が使われる。この場合、直線ベ
クタを生成する処理は、まず図6(B)に示すように各
制御点間の中点A’〜D’及び線分A’B’,B’C’
の中点E,Fを求め、さらに線分EFの中点Gを求め
る。そして線分ADの中点D’と中点Gとの距離dを求
める。この距離dが予め指定されている値以下の場合、
直線ベクタADあるいは直線ベクタAG、GDで曲線を
近似する。もし、距離dが予め指定されている値より大
きい場合には、制御点AA’EGにより表現される曲線
ベクタと制御点GFC’Dにより表現される曲線ベクタ
に分割し、同様の処理を繰り返す。このようにして分割
された曲線ベクタにおける距離dが予め指定されている
値以下となるまで分割を繰り返し、すべての分割された
曲線ベクタにおける距離dが予め指定されている値以下
となったとき、始点Aから順に分割された曲線の始点と
終点を結ぶ直線ベクタを取得する。このようにして曲線
ベクタを直線ベクタで近似することができる。FIG. 6 is an explanatory diagram of an example of the operation of generating a straight line vector in the straight line vector generation section 4. For example, the curve vector includes four control points A to D as shown in FIG.
The Bezier curve represented by is used. In this case, the process of generating a straight line vector is performed, first, as shown in FIG. 6B, the middle points A ′ to D ′ between the control points and the line segments A′B ′, B′C ′
Are obtained, and the midpoint G of the line segment EF is obtained. Then, a distance d between the midpoint D 'of the line segment AD and the midpoint G is obtained. If this distance d is equal to or less than a predetermined value,
A curve is approximated by a straight line vector AD or straight line vectors AG and GD. If the distance d is larger than a predetermined value, the distance d is divided into a curve vector represented by the control point AA'EG and a curve vector represented by the control point GFC'D, and the same processing is repeated. The division is repeated until the distance d in the curve vector divided in this way becomes equal to or less than a predetermined value, and when the distance d in all the divided curve vectors becomes equal to or less than a predetermined value, A straight line vector connecting the start point and the end point of the curve divided in order from the start point A is obtained. In this way, the curve vector can be approximated by the straight line vector.
【0038】このような方法によって曲線ベクタを1な
いし複数の直線ベクタにより近似することができる。こ
のような曲線ベクタの直線ベクタによる近似は、アウト
ラインフォントデータ中のすべての曲線ベクタに対して
行われる。生成した直線ベクタは制御部2に転送され
る。By such a method, a curved vector can be approximated by one or a plurality of linear vectors. Such approximation of a curved vector by a straight line vector is performed for all the curved vectors in the outline font data. The generated straight line vector is transferred to the control unit 2.
【0039】次に、分割処理部5について詳細に説明す
る。分割処理部5は、分割判定フラグが分割の必要があ
る旨を示している場合、各スキャンラインでの描画線分
数を制限した部分図形に分割したアウトラインフォント
データを生成する。図形分割の必要性の有無は分割判定
フラグによって判断できるが、図5に示したように回転
を行わない場合と文字を90度回転する場合における値
を有している場合には、そのアウトラインフォントデー
タが90度回転されたものであるか否かを加味して、こ
の分割処理部5において部分図形に分割する処理を行う
か否かを決定することになる。Next, the division processing section 5 will be described in detail. When the division determination flag indicates that the division is necessary, the division processing unit 5 generates outline font data that is divided into partial figures in which the number of drawing line segments in each scan line is limited. The necessity of the graphic division can be determined by the division determination flag. However, as shown in FIG. In consideration of whether or not the data is rotated by 90 degrees, it is determined whether or not the division processing unit 5 performs the process of dividing the data into partial figures.
【0040】線分はエッジ間を塗りつぶすことによって
得られるので、線分の数をiとしたとき、エッジ(直線
ベクタ)の数は2iとなる。最大のエッジの数は、例え
ば展開処理部7におけるDDAの数やソート可能な直線
ベクタの数などによって決定することができる。最大の
エッジ数を2N(最大の描画線分数をN)としたとき、
分割処理部5は2Nを超える数のエッジについて別の1
ないし複数の図形として分割する処理を行う。Since a line segment is obtained by painting the space between edges, when the number of line segments is i, the number of edges (straight line vectors) is 2i. The maximum number of edges can be determined based on, for example, the number of DDAs in the expansion processing unit 7 and the number of sortable linear vectors. When the maximum number of edges is 2N (the maximum number of drawing line segments is N),
The division processing unit 5 sets another 1 for the number of edges exceeding 2N.
Or a process of dividing the image into a plurality of figures.
【0041】分割処理部5における図形分割の処理方法
は任意であるが、ここでは例として、特開平11−14
4066号公報に記載されているアルゴリズムを用いる
こととし、概略について述べる。図7は、分割処理部5
の動作の一例を示すフローチャートである。まずS61
において、処理対象スキャンラインを表すYcをエッジ
が存在する範囲の最小値Yminに設定する。The processing method for dividing the figure in the division processing section 5 is arbitrary.
The algorithm described in Japanese Patent No. 4066 will be used, and the outline will be described. FIG. 7 shows the division processing unit 5
5 is a flowchart showing an example of the operation of FIG. First S61
, Yc representing the scan line to be processed is set to the minimum value Ymin of the range where the edge exists.
【0042】次にS62において、処理対象スキャンラ
インYcを開始点とするエッジが存在するか否かを判定
する。存在しなければS66に移る。処理対象スキャン
ラインYcを開始点とするエッジが存在する場合には、
S63において、エッジの数を示す変数countに、
処理対象スキャンラインYcを開始点とするエッジの数
jを加える。そしてS64において、変数countの
値をエッジの最大数2Nと比較する。変数countの
値が2Nを超えている場合には、S65において、エッ
ジの数が2N以下となるように図形の分割処理を行う。
また、変数countの値が2N以下の場合には、S6
5における分割処理を行わずにS66へ進む。Next, in S62, it is determined whether or not there is an edge starting from the scan line Yc to be processed. If not, the process moves to S66. If there is an edge starting from the scan line Yc to be processed,
In S63, a variable count indicating the number of edges is set to:
The number j of edges starting from the scan line Yc to be processed is added. Then, in S64, the value of the variable count is compared with the maximum number of edges 2N. If the value of the variable count exceeds 2N, in S65, a graphic dividing process is performed so that the number of edges becomes 2N or less.
If the value of the variable count is equal to or less than 2N, S6
The process proceeds to S66 without performing the division process in S5.
【0043】次にS66において、処理対象のスキャン
ラインYcを終点とするエッジが存在するか否かを判定
する。存在しなければS67をスキップしてS68へ進
む。処理対象のスキャンラインYcを終点とするエッジ
が存在する場合には、S67において、変数count
から、処理対象スキャンラインYcを終点とするエッジ
の数kを引く。Next, in S66, it is determined whether or not there is an edge ending with the scan line Yc to be processed. If not, the process skips S67 and proceeds to S68. If there is an edge ending with the scan line Yc to be processed, in step S67, the variable count
Is subtracted from the number k of edges ending at the scan line Yc to be processed.
【0044】S68において、処理対象スキャンライン
Ycが、エッジの存在する範囲の最大値であるYmax
と等しいか否かを判定する。等しい場合には処理を終了
する。異なる場合は、S69において、処理対象スキャ
ンラインYcの値を1増加させて次のスキャンラインを
処理対象スキャンラインとし、S62に戻って新たな処
理対象スキャンラインについての処理を行う。In S68, the scan line Yc to be processed is set to the maximum value Ymax of the range where the edge exists.
It is determined whether it is equal to or not. If they are equal, the process ends. If different, in S69, the value of the processing target scan line Yc is incremented by 1 to make the next scan line a processing target scan line, and the process returns to S62 to perform processing for a new processing target scan line.
【0045】このようにしてエッジの存在する範囲の最
小値Yminから最大値Ymaxまでの各スキャンライ
ンについて、スキャンラインに交差する辺の数が2Nを
超えている部分のエッジを別の図形として分割する。ま
た、最小値Yminから最大値Ymaxまでのすべての
スキャンラインでエッジの数が2N以下になるまで分割
を繰り返し、分割後のアウトラインフォントデータを制
御部2に転送する。In this manner, for each scan line from the minimum value Ymin to the maximum value Ymax in the range where the edge exists, the edge of the portion where the number of sides intersecting the scan line exceeds 2N is divided as another figure. I do. Further, division is repeated until the number of edges becomes 2N or less in all scan lines from the minimum value Ymin to the maximum value Ymax, and the outline font data after division is transferred to the control unit 2.
【0046】図8は、分割処理部5における分割処理の
具体例の説明図である。ここではN=4とする。最小値
Yminから処理対象スキャンラインYcを順に進めて
ゆくと、最小値YminからY1まではエッジの数が2
であるので、2N(=8)は超えない。処理対象スキャ
ンラインYcがY1となると、終点となるエッジが2個
発生するが、新たなエッジが10個発生し、2N個を超
えてしまう。そのため、例えば図8(B)に示す図形
と、図8(C)に示す図形とに分割する。これによっ
て、すべてのスキャンラインにおいてそれぞれの図形に
おけるエッジの数が2N以下となる。そのため分割を終
了し、それぞれのアウトラインフォントデータを制御部
2に転送する。もちろん図8(B)、(C)に示した分
割例は一例であって、別の部分図形を分割してもよい。FIG. 8 is an explanatory diagram of a specific example of the division processing in the division processing section 5. Here, N = 4. When the scan line Yc to be processed is sequentially advanced from the minimum value Ymin, the number of edges is 2 from the minimum value Ymin to Y1.
Therefore, it does not exceed 2N (= 8). When the processing target scan line Yc becomes Y1, two end edges occur, but ten new edges occur, exceeding 2N. Therefore, for example, the figure is divided into the figure shown in FIG. 8B and the figure shown in FIG. As a result, the number of edges in each figure becomes 2N or less in all scan lines. Therefore, the division is ended, and each outline font data is transferred to the control unit 2. Of course, the division example shown in FIGS. 8B and 8C is an example, and another partial figure may be divided.
【0047】次に、フォントキャッシュ部6について詳
細に説明する。図9は、フォントキャッシュ部6の一例
を示すブロック図である。図中、21はフォントキャッ
シュ制御部、22はフォントデータ記憶部である。フォ
ントデータ記憶部22は、すべて直線ベクタで構成され
たアウトラインフォントデータや対応する分割判定フラ
グなどを含むフォントデータを、フォントID、文字コ
ード、フォントサイズなどの文字データと対応付けて記
憶する。フォントキャッシュ制御部21は、フォントデ
ータ記憶部22へのフォントデータの登録や、登録され
ているフォントデータの検索及び読み出し、さらにはフ
ォントデータ記憶部22が満杯になったときのフォント
データの削除処理など、フォントデータ記憶部22に対
する各種の制御を行う。Next, the font cache unit 6 will be described in detail. FIG. 9 is a block diagram illustrating an example of the font cache unit 6. In the figure, 21 is a font cache control unit, and 22 is a font data storage unit. The font data storage unit 22 stores outline font data including all linear vectors and font data including a corresponding division determination flag in association with character data such as a font ID, a character code, and a font size. The font cache control unit 21 registers the font data in the font data storage unit 22, searches and reads the registered font data, and deletes the font data when the font data storage unit 22 is full. For example, various controls for the font data storage unit 22 are performed.
【0048】図10は、フォントキャッシュ部6におい
てフォントデータを読み出す際の動作の一例を示すフロ
ーチャートである。S71において、フォントキャッシ
ュ制御部21が制御部2からフォントID、文字コー
ド、文字サイズ等の文字データを取得する。そしてS7
2において、該当するフォントデータがフォントデータ
記憶部22に登録されているか否かを調べる。フォント
データが登録されている場合は、S73において、該当
するフォントデータが格納されている先頭アドレスをポ
インタPtに代入する。さらにS74において、当該フ
ォントデータに対応するキャッシュヒットした回数を記
憶するカウンタの値を1増加させる。このカウンタの値
は、フォントデータ記憶部22からフォントデータを削
除する際に用いる。FIG. 10 is a flowchart showing an example of the operation when reading font data in the font cache unit 6. In S71, the font cache control unit 21 acquires character data such as a font ID, a character code, and a character size from the control unit 2. And S7
In step 2, it is checked whether the corresponding font data is registered in the font data storage unit 22. If the font data is registered, in S73, the start address where the corresponding font data is stored is substituted for the pointer Pt. Further, in S74, the value of the counter storing the number of cache hits corresponding to the font data is increased by one. The value of this counter is used when deleting font data from the font data storage unit 22.
【0049】一方、受け取った文字データに対応するフ
ォントデータがフォントデータ記憶部22に登録されて
いない場合には、S75において、ポインタPtにNU
LLを代入する。On the other hand, if the font data corresponding to the received character data is not registered in the font data storage section 22, the pointer Pt is set to NU in S75.
Substitute LL.
【0050】そしてS76において、S73あるいはS
75で値をセットしたポインタPtを制御部2に転送す
る。制御部2では、ポインタPtがNULLであれば、
フォントデータがフォントキャッシュ部6に登録されて
いなかったものと判断し、NULL以外であれば、ポイ
ンタPtに格納されているアドレスをもとにフォントデ
ータを適宜フォントデータ記憶部22から読み出すこと
ができる。この例では制御部2に対してフォントデータ
へのポインタを返す例を示したが、これに限らず、フォ
ントデータ自体を制御部2に転送してもよい。At S76, S73 or S
The pointer Pt whose value has been set at 75 is transferred to the control unit 2. In the control unit 2, if the pointer Pt is NULL,
It is determined that the font data has not been registered in the font cache unit 6, and if the font data is not NULL, the font data can be appropriately read from the font data storage unit 22 based on the address stored in the pointer Pt. . In this example, an example in which a pointer to the font data is returned to the control unit 2 has been described. However, the present invention is not limited to this, and the font data itself may be transferred to the control unit 2.
【0051】図11は、フォントキャッシュ部6におい
てフォントデータを登録する際の動作の一例を示すフロ
ーチャートである。S81において、フォントキャッシ
ュ制御部21は、制御部2からフォントID、文字コー
ド、フォントサイズなどの文字データ、すべて直線ベク
タで構成されたアウトラインフォントデータ、および、
対応する分割判定フラグを取得する。FIG. 11 is a flowchart showing an example of the operation when the font data is registered in the font cache unit 6. In step S81, the font cache control unit 21 sends character data such as a font ID, a character code, and a font size from the control unit 2, outline font data including all linear vectors, and
Obtain the corresponding division determination flag.
【0052】S82において、アウトラインフォントデ
ータのデータ量を調べ、フォントデータ記憶部22に十
分なメモリの空きがあるか否か確認する。メモリの空き
がある場合はS83の処理をスキップしてS84へ進
む。フォントデータ記憶部22に十分な空きがない場合
には、S83において、フォントデータ記憶部22から
フォントデータを削除する。フォントデータの削除は利
用度の低いものから削除することが望ましく、そのため
にキャッシュヒットした回数を記憶するカウンタを参照
してその値が小さいフォントデータから削除するとよ
い。このようなフォントデータの削除を、新たなフォン
トデータを登録するために十分な空き容量が確保できる
まで繰り返す。In S82, the data amount of the outline font data is checked, and it is checked whether or not there is sufficient memory space in the font data storage unit 22. If there is free space in the memory, the process of S83 is skipped and the process proceeds to S84. If there is not enough space in the font data storage unit 22, the font data is deleted from the font data storage unit 22 in S83. It is desirable to delete the font data from the ones with the lowest usage. For this purpose, it is preferable to delete the font data having a smaller value by referring to a counter that stores the number of cache hits. Such deletion of the font data is repeated until a sufficient free space for registering new font data can be secured.
【0053】フォントデータ記憶部22に十分な空き容
量が存在する場合、あるいは、十分な空き容量を確保し
た後に、S84において、S81で取得したフォントI
D、文字コード、文字サイズなどの文字データをキーと
し、アウトラインフォントデータ、0に初期化したカウ
ンタ、および分割判定フラグを含むフォントデータをフ
ォントデータ記憶部に登録する。If there is sufficient free space in the font data storage unit 22, or after securing sufficient free space, in S84, the font I obtained in S81 is obtained.
Using character data such as D, character code, and character size as keys, outline font data, a counter initialized to 0, and font data including a division determination flag are registered in the font data storage unit.
【0054】この例では、フォントデータ記憶部22に
必要な空き容量がなくなった場合、キャッシュヒットし
た回数が少ないフォントデータから削除する方法を示し
たが、この方法に限られるものではない。例えばデータ
量が大きいフォントデータから削除する方法や、最初に
登録したデータから削除する方法、アクセス時刻を保持
している場合にはアクセス時刻が古いものから削除する
方法など、本発明の構成を変更しない範囲で各種の方法
を適用することが可能である。In this example, when the necessary free space in the font data storage unit 22 is exhausted, the method of deleting from the font data having a small number of cache hits is described. However, the present invention is not limited to this method. For example, the configuration of the present invention is changed such as a method of deleting from font data having a large data amount, a method of deleting from the first registered data, and a method of deleting from the oldest access time when the access time is retained. Various methods can be applied as long as they do not occur.
【0055】また、フォントデータ記憶部22に登録す
るフォントデータは、必要に応じて直線ベクタ生成部4
で曲線ベクトルを直線近似した後のアウトラインフォン
トデータだけでなく、必要に応じて分割処理部5で複数
の図形に分割した後のアウトラインフォントデータの両
方またはどちらか一方を登録するように構成することも
できる。The font data to be registered in the font data storage section 22 is stored in the linear vector generation section 4 as necessary.
Not only the outline font data obtained after linear approximation of the curve vector but also the outline font data obtained by dividing into a plurality of figures by the division processing unit 5 as necessary. Can also.
【0056】次に、展開処理部7について説明する。図
12は、展開処理部7の一例を示すブロック図である。
図中、31はDDA部、32はソート部、33はメモリ
描画部である。上述のように、展開処理部7は、制御部
2から受け取ったアウトラインフォントデータをもと
に、ビットマップ展開する処理を行う。Next, the expansion processing section 7 will be described. FIG. 12 is a block diagram illustrating an example of the expansion processing unit 7.
In the figure, 31 is a DDA unit, 32 is a sorting unit, and 33 is a memory drawing unit. As described above, the expansion processing unit 7 performs the process of bitmap expansion based on the outline font data received from the control unit 2.
【0057】DDA部31は、スキャンラインと直線ベ
クタとの交点を求める。DDA部31は2N個設けられ
ており、N本分の描画線分に対応するエッジを並行して
求めることができる。ソート部32は、DDA部31で
算出された2N個のエッジについて、その座標値でソー
トする。メモリ描画部33は、ソート部32でソートさ
れた結果から、塗り潰しを行う始点と終点の対を求め、
その間を指定された描画色で図示しないメモリに描画す
る。The DDA unit 31 finds an intersection between the scan line and the straight line vector. The 2D DDA units 31 are provided, and edges corresponding to N drawing line segments can be obtained in parallel. The sorting unit 32 sorts the 2N edges calculated by the DDA unit 31 based on the coordinate values. The memory drawing unit 33 obtains a pair of a start point and an end point to be filled from the result sorted by the sorting unit 32,
In the meantime, drawing is performed in a memory (not shown) with the designated drawing color.
【0058】ここで、DDA部31及びソート部32
は、2N個のデータに対応した構成を有している。その
ため、この展開処理部7において一度に展開可能なエッ
ジ数は2N個である。任意の文字図形を描画する際には
エッジ数が2N個を超える場合があるが、その場合には
分割処理部5において複数の図形に分割している。その
ため、個々の図形についてはエッジが2N個以下となる
ように予め処理されており、このような2N個のDDA
部31及び2N個のデータをソートするソート部32に
よって対応することができる。Here, the DDA section 31 and the sort section 32
Has a configuration corresponding to 2N data. Therefore, the number of edges that can be expanded at one time in the expansion processing unit 7 is 2N. When an arbitrary character figure is drawn, the number of edges may exceed 2N. In such a case, the division processing unit 5 divides the figure into a plurality of figures. Therefore, each graphic is pre-processed so that the number of edges is 2N or less.
This can be handled by a unit 31 and a sorting unit 32 that sorts 2N pieces of data.
【0059】図13は、展開処理部7における動作の一
例を示すフローチャートである。ここでは一例として、
特開平11−144066号公報に記載されているアル
ゴリズムを用いることとし、以下、概略のみについて述
べる。まずS91において、処理対象スキャンラインを
表す変数Ycを、描画する図形の存在範囲のY座標の最
小値Yminに設定して処理を開始する。FIG. 13 is a flowchart showing an example of the operation of the expansion processing section 7. Here, as an example,
The algorithm described in Japanese Patent Application Laid-Open No. 11-144066 is used, and only an outline will be described below. First, in S91, a process is started by setting a variable Yc representing a scan line to be processed to the minimum value Ymin of the Y coordinate of the existing range of the figure to be drawn.
【0060】S92において、DDA部31を用いて、
処理対象スキャンラインYcと各辺(各直線ベクタ)と
の交点のX座標の座標値Xcをそれぞれ計算する。次に
S93において、交点の計算を行ったDDA部31から
座標値Xcの値を全てソート部32に出力し、ソート部
32はこれを昇順になるようにソートし、メモリ描画部
33に出力する。そしてS94において、メモリ描画部
33は、ソート済みの座標値Xcを先頭から2個ずつ取
り出して対にし、その対となった座標値の間の水平線分
(スキャンライン)を塗りつぶして描画する。In S92, using the DDA unit 31,
The coordinate value Xc of the X coordinate of the intersection between the processing target scan line Yc and each side (each straight line vector) is calculated. Next, in S93, the DDA unit 31 that has calculated the intersection outputs all the coordinate values Xc to the sorting unit 32, and the sorting unit 32 sorts the values in ascending order and outputs them to the memory drawing unit 33. . Then, in S94, the memory drawing unit 33 takes out the sorted coordinate values Xc two by two from the top and forms a pair, and draws and draws a horizontal line (scan line) between the paired coordinate values.
【0061】S95において、処理対象スキャンライン
Ycを1だけ増加させ、次のスキャンラインを処理対象
とする。S96において、新たな処理対象スキャンライ
ンYcの値が、描画する図形の存在範囲のY座標最大値
Ymaxより大きいか否かをチェックする。もし処理対
象スキャンラインYcの値がY座標最大値Ymax以下
であれば、S92に戻って、新たな処理対象スキャンラ
インについての描画処理を行う。このような処理を順次
繰り返し、処理対象スキャンラインYcの値がY座標最
大値Ymaxよりも大きくなったことがS96で検出さ
れたら処理を終了する。In S95, the scan line Yc to be processed is increased by one, and the next scan line is set as a process target. In S96, it is checked whether or not the value of the new scan line Yc to be processed is larger than the maximum Y-coordinate Ymax of the existing range of the figure to be drawn. If the value of the processing target scan line Yc is equal to or smaller than the Y coordinate maximum value Ymax, the process returns to S92, and the drawing processing is performed for a new processing target scan line. Such processing is sequentially repeated, and when it is detected in S96 that the value of the processing target scan line Yc has become larger than the Y coordinate maximum value Ymax, the processing ends.
【0062】このようにして1つの図形についてのビッ
トマップ展開処理を行うことができる。上述のように、
エッジを2Nより多く有する文字については分割処理部
5において複数の図形に分割されている。このような場
合には、上述の1図形に対するビットマップ展開処理を
分割された各図形に対して行えばよい。In this way, the bitmap development processing for one figure can be performed. As mentioned above,
A character having more than 2N edges is divided into a plurality of figures by the division processing unit 5. In such a case, the bitmap development processing for one figure described above may be performed on each divided figure.
【0063】上述の動作の一例では、Y座標最小値Ym
inからY座標最大値Ymaxまでの各スキャンライン
について、毎回、各エッジの座標値XcをDDA部31
で計算してソートしている。しかし、描画する線分の追
加/削除/交差が生じた場合しかエッジの順番は変更さ
れず、従ってソートが必要にならない。そのため、描画
する線分の追加/削除/交差が発生するスキャンライン
で図形を分割し、ソートを不要にすることも可能であ
る。In one example of the above-described operation, the Y coordinate minimum value Ym
For each scan line from "in" to the Y coordinate maximum value Ymax, the coordinate value Xc of each edge is converted to the DDA unit 31 every time.
Is calculated and sorted. However, the order of edges is changed only when addition / deletion / intersection of a line segment to be drawn occurs, so that sorting is not required. For this reason, it is possible to divide a figure by a scan line where addition / deletion / intersection of a line segment to be drawn occurs, thereby making sorting unnecessary.
【0064】[0064]
【発明の効果】以上の説明から明らかなように、本発明
によれば、文字を制限されたハードウエアでビットマッ
プ展開するために複数の図形に分割処理する際に、その
分割処理の必要があるか否かを判別する分割判定フラグ
を予め保持している。そのため、従来行っていた分割判
定処理を省略することができ、高速な展開処理を実現す
ることが可能となる。さらに、分割判定フラグとして、
文字の回転の有無によって分割の必要があるか否かを判
別する情報を保持することにより、文字を回転させる必
要がある場合でも高速な展開処理を実現させることがで
きるという効果がある。As is apparent from the above description, according to the present invention, when a character is divided into a plurality of figures for bitmap expansion with limited hardware, it is necessary to perform the division processing. A division judgment flag for judging whether or not there is a flag is held in advance. Therefore, the division determination processing conventionally performed can be omitted, and high-speed expansion processing can be realized. Further, as a division determination flag,
By retaining information for determining whether or not division is necessary depending on whether or not the character is rotated, there is an effect that high-speed expansion processing can be realized even when the character needs to be rotated.
【図1】 本発明の文字処理装置の実施の一形態を示す
ブロック図である。FIG. 1 is a block diagram showing one embodiment of a character processing device of the present invention.
【図2】 本発明の文字処理装置の実施の一形態におけ
る全体の動作の一例を示すフローチャートである。FIG. 2 is a flowchart illustrating an example of an overall operation of the character processing apparatus according to the embodiment of the present invention.
【図3】 フォント情報管理部3の一例を示すブロック
図である。FIG. 3 is a block diagram illustrating an example of a font information management unit 3;
【図4】 アウトラインフォントデータ格納部12内の
アウトラインフォントデータのデータ構造の一例を示す
説明図である。FIG. 4 is an explanatory diagram showing an example of a data structure of outline font data in an outline font data storage unit 12;
【図5】 分割判定フラグ格納部14におけるデータ構
造の一例の説明図である。FIG. 5 is an explanatory diagram of an example of a data structure in a division determination flag storage unit 14.
【図6】 直線ベクタ生成部4における直線ベクタの生
成動作の一例の説明図である。FIG. 6 is a diagram illustrating an example of an operation of generating a straight line vector in the straight line vector generation unit 4.
【図7】 分割処理部5の動作の一例を示すフローチャ
ートである。FIG. 7 is a flowchart illustrating an example of the operation of the division processing unit 5;
【図8】 分割処理部5における分割処理の具体例の説
明図である。FIG. 8 is an explanatory diagram of a specific example of the division processing in the division processing unit 5;
【図9】 フォントキャッシュ部6の一例を示すブロッ
ク図である。FIG. 9 is a block diagram illustrating an example of a font cache unit 6;
【図10】 フォントキャッシュ部6においてフォント
データを読み出す際の動作の一例を示すフローチャート
である。FIG. 10 is a flowchart illustrating an example of an operation when reading font data in the font cache unit 6;
【図11】 フォントキャッシュ部6においてフォント
データを登録する際の動作の一例を示すフローチャート
である。FIG. 11 is a flowchart illustrating an example of an operation when registering font data in the font cache unit 6;
【図12】 展開処理部7の一例を示すブロック図であ
る。FIG. 12 is a block diagram illustrating an example of a development processing unit 7;
【図13】 展開処理部7における動作の一例を示すフ
ローチャートである。FIG. 13 is a flowchart illustrating an example of an operation of the expansion processing unit 7;
【図14】 一般的なアウトラインフォントデータをビ
ットマップ展開する際の処理過程の一例の説明図であ
る。FIG. 14 is an explanatory diagram of an example of a processing process when general outline font data is developed into a bitmap.
【図15】 描画図形の一例の説明図である。FIG. 15 is an explanatory diagram of an example of a drawing graphic.
【図16】 図形分割による描画手法の一例の説明図で
ある。FIG. 16 is an explanatory diagram of an example of a drawing technique based on graphic division.
1…入力部、2…制御部、3…フォント情報管理部、4
…直線ベクタ生成部、5…分割処理部、6…フォントキ
ャッシュ部、7…展開処理部、8…出力部、11…アウ
トラインフォントデータ読込部、12…アウトラインフ
ォントデータ格納部、13…分割判定フラグ読込部、1
4…分割判定フラグ格納部、15…マトリクス変換部、
21…フォントキャッシュ制御部、22…フォントデー
タ記憶部、31…DDA部、32…ソート部、33…メ
モリ描画部。DESCRIPTION OF SYMBOLS 1 ... input part, 2 ... control part, 3 ... font information management part, 4
... Linear vector generation unit, 5 ... Division processing unit, 6 ... Font cache unit, 7 ... Expansion processing unit, 8 ... Output unit, 11 ... Outline font data reading unit, 12 ... Outline font data storage unit, 13 ... Division determination flag Reading unit, 1
4 ... division determination flag storage unit, 15 ... matrix conversion unit,
21: Font cache control unit, 22: Font data storage unit, 31: DDA unit, 32: Sort unit, 33: Memory drawing unit.
Claims (5)
ップ展開する文字処理装置において、前記アウトライン
フォントデータと該アウトラインフォントデータについ
て複数の多角形に分割する必要があるか否かを判別する
ための分割判定フラグとを管理するフォント情報管理手
段と、前記分割判定フラグが分割の必要がある旨を示し
ているとき前記フォントの図形を複数の図形に分割した
アウトラインフォントデータを生成する分割処理手段
と、前記フォントの図形あるいは前記分割処理手段で分
割された図形のアウトラインフォントデータに基づいて
ビットマップ展開する展開処理手段を有することを特徴
とする文字処理装置。1. A character processing device for developing outline font data into a bitmap, wherein the outline font data and a division determination flag for determining whether or not the outline font data need to be divided into a plurality of polygons. Font information management means for managing the font; a division processing means for generating outline font data obtained by dividing the font graphic into a plurality of graphics when the division determination flag indicates that the font needs to be divided; A character processing apparatus, comprising: expansion processing means for bitmap expansion based on outline font data of a figure or a figure divided by the division processing means.
判定フラグとして文字の回転の有無によって分割処理が
必要か否かを示す情報を保持し、要求されたフォントの
回転の有無に応じて前記分割判定フラグを出力すること
を特徴とする請求項1に記載の文字処理装置。2. The font information management means holds information indicating whether or not a division process is necessary depending on whether or not a character is rotated as the division determination flag, and performs the division based on whether or not the requested font is rotated. The character processing device according to claim 1, wherein a determination flag is output.
アウトラインフォントデータのうち曲線で表現された部
分を直線近似したアウトラインフォントデータに変換す
る直線ベクタ生成手段をさらに有していることを特徴と
する請求項1または請求項2に記載の文字処理装置。3. The apparatus according to claim 1, further comprising a straight line vector generating means for converting a portion represented by a curve in the outline font data obtained from said font information managing means into outline font data obtained by linear approximation. The character processing device according to claim 1 or 2.
たアウトラインフォントデータ及び前記分割判定フラグ
を含むフォントデータを格納するフォントキャッシュ手
段を備え、該フォントキャッシュ手段に格納されている
フォントについては該フォントキャッシュ手段に格納さ
れているアウトラインフォントデータ及び分割判定フラ
グを用いることを特徴とする請求項3に記載の文字処理
装置。4. A font caching means for storing outline font data converted by said linear vector generating means and font data including said division determination flag, wherein said font cache means stores font data stored in said font caching means. 4. The character processing apparatus according to claim 3, wherein outline font data and a division determination flag stored in the means are used.
の図形のアウトラインフォントデータを含むフォントデ
ータを格納するフォントキャッシュ手段を備え、該フォ
ントキャッシュ手段に格納されているフォントについて
は該フォントキャッシュ手段に格納されているアウトラ
インフォントデータを前記展開処理手段に渡すことを特
徴とする請求項1ないし請求項4のいずれか1項に記載
の文字処理装置。5. A font cache means for storing font data including outline font data of a plurality of graphics divided by said division processing means, and fonts stored in said font cache means are stored in said font cache means. 5. The character processing apparatus according to claim 1, wherein the stored outline font data is passed to the expansion processing unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2000150303A JP2001331166A (en) | 2000-05-22 | 2000-05-22 | Character processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2000150303A JP2001331166A (en) | 2000-05-22 | 2000-05-22 | Character processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2001331166A true JP2001331166A (en) | 2001-11-30 |
Family
ID=18656034
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2000150303A Pending JP2001331166A (en) | 2000-05-22 | 2000-05-22 | Character processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2001331166A (en) |
-
2000
- 2000-05-22 JP JP2000150303A patent/JP2001331166A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5832530A (en) | Method and apparatus for identifying words described in a portable electronic document | |
JP2993673B2 (en) | Electronic file device | |
JP2001331166A (en) | Character processor | |
JP3146771B2 (en) | Font rasterizing apparatus and method | |
JPH11198465A (en) | Character output device | |
JP2000235383A (en) | Device and method for processing character | |
JP2993880B2 (en) | Electronic file device | |
JP4058197B2 (en) | Drawing apparatus, drawing method, and storage medium | |
JPH1185428A (en) | Method and device for forming image | |
JP3536894B2 (en) | Graphic processing unit | |
JPH0830725A (en) | Device and method for processing image | |
JP2993881B2 (en) | Keyword generation method | |
JPH11232473A (en) | Printing processor | |
JP2000242802A (en) | Graphic processor | |
JP2835056B2 (en) | High quality character pattern generation method | |
JP3603589B2 (en) | Image processing method and apparatus | |
JP2937508B2 (en) | Bitmap expansion method | |
JP2002132235A (en) | Cad data display device and method as well as computer readable recording medium | |
JPH08194458A (en) | Character processing device | |
JPH11272256A (en) | Character display control device and its control method | |
JPH0264696A (en) | Character processor | |
JP2000036040A (en) | Registration method of image data | |
JPH02241267A (en) | Picture information processor | |
JPH06102852A (en) | Font data generation and development system | |
JP2002216142A (en) | Image processor and image processing method |