JP3215179B2 - Hinting outline fonts - Google Patents

Hinting outline fonts

Info

Publication number
JP3215179B2
JP3215179B2 JP24082692A JP24082692A JP3215179B2 JP 3215179 B2 JP3215179 B2 JP 3215179B2 JP 24082692 A JP24082692 A JP 24082692A JP 24082692 A JP24082692 A JP 24082692A JP 3215179 B2 JP3215179 B2 JP 3215179B2
Authority
JP
Japan
Prior art keywords
data
hinting
size
coordinate
scaled
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP24082692A
Other languages
Japanese (ja)
Other versions
JPH0695643A (en
Inventor
稔 境井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP24082692A priority Critical patent/JP3215179B2/en
Publication of JPH0695643A publication Critical patent/JPH0695643A/en
Application granted granted Critical
Publication of JP3215179B2 publication Critical patent/JP3215179B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Controls And Circuits For Display Device (AREA)
  • Image Processing (AREA)
  • Image Generation (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、アウトラインフォント
のヒンティング時における精度誤差を除去したヒンティ
ング方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a hinting method for eliminating an error in accuracy when hinting an outline font.

【0002】[0002]

【従来の技術】図3は、アウトラインフォントの処理構
成図である。フォントファイル1から読み込まれたアウ
トラインデータは、展開部2において輪郭線として展開
され、次いで変倍処理部3で求める大きさに変倍され、
ヒンティング処理部4では、変倍されたアウトラインデ
ータに対して線幅補正などのヒンティングを施し、ラス
タライザ5で塗りつぶし処理が行われて輪郭内をドット
データ6に展開する。
2. Description of the Related Art FIG. 3 is a diagram showing a processing configuration of an outline font. The outline data read from the font file 1 is expanded as an outline in the expansion unit 2 and then scaled to the size required by the scaling unit 3.
The hinting processing unit 4 performs hinting such as line width correction on the scaled outline data, performs a filling process with the rasterizer 5, and develops the inside of the outline into dot data 6.

【0003】なお、上記した技術については、NIKK
EI BYTE/JUNE1992pp158−165
(文献1),同FEBRUARY 1992 pp11
2−123(文献2)において詳細に説明されている。
[0003] The above technology is described in NIKK
EI BYTE / JUNE1992pp158-165
(Reference 1), FEBRUARY 1992 pp11
This is described in detail in 2-123 (Reference 2).

【0004】以下の説明においては、ピクセルは格子点
を左下隅とする単位正方形であるものとし、従って、ピ
クセルの中心は、 (x+0.5 ,y+0.5) ただし、x,yは整数 にある。もちろん格子点をピクセル中心と仮定してもよ
い。
In the following description, it is assumed that a pixel is a unit square with a grid point at the lower left corner, and therefore, the center of the pixel is (x + 0.5, y + 0.5) where x and y are integers. . Of course, the grid point may be assumed to be the pixel center.

【0005】256×256ピクセルの空間でデザイン
された文字“H”を、13×13ピクセルに縮小する例
を用いて、従来技術の問題点を説明する。フォントファ
イル1から読み込まれたアウトラインデータは、図4に
示すように輪郭線として展開される。このアウトライン
データを13×13ピクセルに縮小すると、図5のデー
タが得られる。
[0005] The problem of the prior art will be described using an example in which a character "H" designed in a space of 256 x 256 pixels is reduced to 13 x 13 pixels. The outline data read from the font file 1 is developed as an outline as shown in FIG. When this outline data is reduced to 13 × 13 pixels, the data shown in FIG. 5 is obtained.

【0006】ここで、塗りつぶし処理のために、例えば
輪郭線の上または内部にピクセル中心のあるピクセルが
反転するという、塗りつぶし規則を採用すると、左側の
縦ステムは2ピクセルになり、右側の縦ステムは1ピク
セルになってしまう。
Here, when a filling rule is adopted in which, for example, a pixel having a pixel center on or inside a contour line is inverted for the filling process, the left vertical stem becomes two pixels and the right vertical stem becomes two pixels. Becomes one pixel.

【0007】また、各点のx,y座標を四捨五入する
と、縦ステムの太さが違ってしまう。一方、四捨五入で
はなく、切り上げや切り捨てを用いると、右側のステム
が太くなり、左側のステムが細くなってしまう。このよ
うな線幅がバラついたりする問題点については、前掲し
た文献1の163ページにおいても指摘されている。こ
れを解決する手法がヒンティングと呼ばれる技術であ
る。
When the x and y coordinates of each point are rounded off, the thickness of the vertical stem is different. On the other hand, when rounding up or rounding down is used instead of rounding, the stem on the right becomes thicker and the stem on the left becomes thinner. Such a problem that the line width fluctuates is pointed out also on page 163 of Document 1 mentioned above. A technique for solving this is a technique called hinting.

【0008】[0008]

【発明が解決しようとする課題】本出願人は先に、変倍
処理や丸めによって生じるステムの線幅のバラツキを効
果的に修正するアウトラインフォントの輪郭線補正方法
を提案した(特願平4−238629号)。この方法に
おいては、縦ステムの右側と横ステムの上側を丸め、縦
ステムの左側と下側には線幅補正(適合処理)を施すも
ので、その処理結果を図6に示す。
The present applicant has previously proposed an outline font outline correction method for effectively correcting variations in stem line widths caused by scaling and rounding (Japanese Patent Application No. Hei. -238629). In this method, the right side of the vertical stem and the upper side of the horizontal stem are rounded, and the left and lower sides of the vertical stem are subjected to line width correction (adaptation processing). The processing results are shown in FIG.

【0009】上記提案した輪郭線補正方法について、図
2の点1と点2に着目して説明する。デザイン時のx座
標は、点1が23であり、点2は49である。変倍され
た結果、点1のx座標は、23×13÷256=1.1
6796875であり、点2は49×13÷256=
2.48828125である。
The above-described proposed contour correction method will be described by focusing on points 1 and 2 in FIG. The x coordinate at the time of design is 23 at point 1 and 49 at point 2. As a result of scaling, the x coordinate of point 1 is 23 × 13 ÷ 256 = 1.1
6796875, and point 2 is 49 × 13 ÷ 256 =
2.48828125.

【0010】また、デザイン時の線幅26は、変倍され
て26×13÷256=1.3203125となる。そ
して、ヒンティングにおいては、まず変倍後の点2のx
座標が丸められて2になる。続いて、変倍後の点1に線
幅分加算してx座標が2.48828125(=1.1
6796875+1.3203125)となり、これが
丸められて2になる。最後に線分を丸めた1だけ減じて
1を得る。このようにして、図6に示すヒンティングさ
れたアウトラインデータが得られる。
The line width 26 at the time of design is scaled to 26 × 13 ÷ 256 = 1. Then, in the hinting, first, the x of the point 2 after the magnification is changed
The coordinates are rounded to two. Subsequently, by adding the line width to the point 1 after the scaling, the x coordinate becomes 2.48828125 (= 1.1).
6796875 + 1.3203125), which is rounded to 2. Finally, 1 is obtained by subtracting 1 by rounding the line segment. Thus, the hinted outline data shown in FIG. 6 is obtained.

【0011】ところが、小数部を表すのに使用されるn
ビットとデザインサイズD(2のk乗<D<2の(k+
1)乗)の関係が、k>nであるとき問題が生じる。す
なわち、具体例として上記した例を小数点以下を6ビッ
トで表現する系で処理すると、全く異なる結果を得る。
However, n used to represent a decimal part
Bit and design size D (2 k <D <2 (k +
A problem arises when the relation 1) is k> n. That is, when the above-described example is processed by a system that expresses the decimal part with 6 bits, a completely different result is obtained.

【0012】変倍後のx座標は、点1については1.1
71875となり、点2については2.484375と
なり、線幅は1.328125となる。従って、ヒンテ
ィングにおいて、点2のx座標は丸めると2になる。点
1に線幅分を加算すると、そのx座標は、2.5にな
る。これを丸めると3となる。最後に線分を丸めた1だ
け減じて2を得る。この結果、演算精度の低い処理系で
は、図7に示すように、左右のステムの幅が異なるアウ
トラインデータになるという問題がある。
The x coordinate after scaling is 1.1 for point 1.
71875, and for point 2, it is 2.484375, and the line width is 1.328125. Therefore, in hinting, the x coordinate of point 2 becomes 2 when rounded. When the line width is added to point 1, the x coordinate becomes 2.5. This is rounded to 3. Finally, the line segment is subtracted by the rounded one to obtain 2. As a result, as shown in FIG. 7, in a processing system with low calculation accuracy, there is a problem that outline data having different widths of right and left stems is obtained.

【0013】本発明の目的は、演算精度の低い処理系に
おいても正確な線幅補正を可能とするアウトラインフォ
ントのヒンティング方法を提供することにある。
It is an object of the present invention to provide an outline font hinting method that enables accurate line width correction even in a processing system with low calculation accuracy.

【0014】[0014]

【課題を解決するための手段】前記目的を達成するため
に、請求項1記載の発明では、ヒンテイング時の演算精
度が整数部に対してmビット、小数部に対してnビット
が割り当てられ、アウトラインフォントデータはX×Y
ピクセルの空間でデザインされ、該アウトラインフォン
トデータの変倍に用いられるデザインサイズDは2*k
<D<2*(k+1)を満たし(ただし、2*kは2の
k乗を表す)、該アウトラインフォントデータの変倍を
行うとき、すべての座標データおよび線幅データZに対
して、求めるサイズがSのとき、下記の式(1) Z’=
Z×S÷D 式(1) を用いて、変倍後のデータZ’を得て(ただし、Z’
は、その小数部がnビット(k>n)に収まるように丸
められている)、該変倍後のデータZ’に対してヒンテ
ィングを施すようにしたアウトラインフォントのヒンテ
ィング方法において、デザイン時におけるアウトライン
を構成する第1の輪郭点から軸方向に、対応する第2の
輪郭点までの距離が予め設定され、該第1の輪郭点と第
2の輪郭点の間の黒ドット数を表す線幅が予め設定さ
れ、前記サイズSに変倍されている前記第1の輪郭点の
座標データを、下記の式(2)を用いて、 Z”=Z’×D÷S 式(2) (Z’は、変倍後のデータであり、Z”はデザインサイ
ズDのデータ) デザインサイズDにおける第2の座標データに変換し、
前記サイズSに変倍されている前記距離を、前記式(2)
を用いてデザインサイズにおける第2の距離に変換し、
前記第2の座標データと前記第2の距離を加算して第3
の座標データを生成し、該第3の座標データを、前記式
(1)を用いてサイズSにおける第4の座標データに変換
し、前記線幅を前記式(1)を用いてサイズSにおける線
幅に変換し、該第4の座標データを丸め処理して第5の
座標データを生成し、該第5の座標データから、前記サ
イズSに変倍された黒ドット数を丸めた分だけ減じた第
6の座標データを生成し、生成された該第6の座標デー
タの位置に、前記第1の輪郭点を移動し、前記サイズに
変倍されている前記第2の輪郭点の座標データを丸め処
理することによってヒンティングを行うことを特徴とし
ている。
In order to achieve the above object, according to the first aspect of the present invention, the arithmetic precision at the time of hinting is assigned to m bits for the integer part and n bits for the decimal part, Outline font data is X × Y
Designed in pixel space, the design size D used to scale the outline font data is 2 * k
<D <2 * (k + 1) (where 2 * k represents 2 to the power of k), and when performing scaling of the outline font data, it is obtained for all coordinate data and line width data Z. When the size is S, the following equation (1) Z ′ =
Z × S ÷ D Equation (1) is used to obtain scaled data Z ′ (however, Z ′
In the outline font hinting method in which hinting is performed on the scaled data Z ′, the decimal part is rounded so as to fit into n bits (k> n). The distance from the first contour point constituting the outline at the time to the corresponding second contour point in the axial direction is set in advance, and the number of black dots between the first contour point and the second contour point is determined. The coordinate data of the first contour point, the line width of which is set in advance and scaled to the size S, is calculated using the following equation (2) as follows: Z ″ = Z ′ × D ÷ S Equation (2) (Z ′ is data after zooming, and Z ″ is data of design size D.) Convert to the second coordinate data of design size D,
The distance scaled to the size S is calculated by the equation (2).
Is converted to a second distance in the design size using
Adding the second coordinate data and the second distance to form a third
Is generated, and the third coordinate data is expressed by the formula
(1) is converted into fourth coordinate data in size S, the line width is converted into line width in size S using equation (1), and the fourth coordinate data is rounded. Fifth coordinate data is generated, and from the fifth coordinate data, sixth coordinate data is generated by subtracting the number of black dots scaled to the size S by a rounded amount. The hinting is performed by moving the first contour point to the position of the coordinate data, and rounding the coordinate data of the second contour point that has been scaled to the size.

【0015】請求項2記載の発明では、前記mの精度が
低く、k>nであるとき、k−n<p<m+n−kを満
たすpを選び、前記式(2)を用いてデザインサイズのデ
ータに変換するときに、該pを用いて、 Z(1)=Z’×2*p÷S 式(3) を計算し、次いで、 Z(2)=Z(1)×(D÷2*p) 式(4) を計算する(ただし、2*pは、2のp乗を表す)こと
を特徴としている。
According to the second aspect of the present invention, when the precision of the m is low and k> n, a p that satisfies kn <p <m + nk is selected, and the design size is calculated using the above equation (2). When converting to data of the following formula, Z (1) = Z ′ × 2 * p ÷ S Equation (3) is calculated using the p, and then Z (2) = Z (1) × (D ÷) 2 * p) The formula (4) is calculated (where 2 * p represents 2 to the power of p).

【0016】[0016]

【作用】演算精度の低い処理系においては、既に変倍さ
れた輪郭点の左端の座標値と距離を、デザイン時のデー
タに逆算し、逆算された座標値に距離を加算した座標値
を、変倍してから線幅補正のヒンティング処理を施し、
輪郭点の右端については、変倍後の座標値を丸め処理す
る。これにより、ヒンティング時の演算精度が低い処理
系であっても、精度誤差を除去することができ、正確な
線幅補正が可能となる。
In a processing system with low calculation accuracy, the coordinate value and the distance at the left end of the already scaled contour point are back calculated to the data at the time of design, and the coordinate value obtained by adding the distance to the back calculated coordinate value is After scaling, apply hinting processing for line width correction,
For the right end of the contour point, the coordinate value after scaling is rounded. As a result, even in a processing system having a low calculation accuracy at the time of hinting, an accuracy error can be removed, and accurate line width correction can be performed.

【0017】[0017]

【実施例】以下、本発明の一実施例を図面を用いて具体
的に説明する。図1は、図3のヒンティング処理部4に
よって実行される本発明のヒンティング処理のフローチ
ャートである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be specifically described below with reference to the drawings. FIG. 1 is a flowchart of the hinting process of the present invention executed by the hinting processing unit 4 of FIG.

【0018】本実施例の動作について説明すると、アウ
トラインデータの輪郭点の点数をnumpointに設
定し(ステップ101)、nを0として(ステップ10
2)、nがnumpointを越えない限り(ステップ
103)、以下の処理を行う。アウトラインデータの輪
郭点が縦ステムの左端であるときには(ステップ10
4)、後述するヒンティング処理を施す(ステップ10
5)。
The operation of this embodiment will be described. The number of contour points in the outline data is set to numpoint (step 101), and n is set to 0 (step 10).
2) Unless n exceeds npoint (step 103), the following processing is performed. When the outline point of the outline data is the left end of the vertical stem (step 10
4), a hinting process described below is performed (step 10)
5).

【0019】縦ステムの右端であるときには(ステップ
106)、x座標の丸めを行う(ステップ107)。何
れでもないとき、つまり斜線や曲線については他のヒン
ティング処理を行う(ステップ108)。nを次の点に
して(ステップ109)、以上の処理を繰返し、アウト
ラインデータの全ての輪郭点について処理する。
If it is the right end of the vertical stem (step 106), the x coordinate is rounded (step 107). If neither of them is satisfied, that is, for a diagonal line or a curve, another hinting process is performed (step 108). With n as the next point (step 109), the above processing is repeated, and the processing is performed on all the outline points of the outline data.

【0020】上記したフローチャートでは、縦ステムの
ヒンティングのみを示したが、横ステムのヒンティング
については、x軸をy軸に置き換えることによって実現
される。
In the above flow chart, only the hinting of the vertical stem is shown, but the hinting of the horizontal stem is realized by replacing the x-axis with the y-axis.

【0021】さて、本実施例では、図2に示すような線
幅テーブルを用意する。このテーブルにおいて、距離と
は、ある属性を持つ輪郭点から軸方向(x軸あるいはy
軸)に該当する距離だけ進んだところに対応する点があ
ることを示す。また、線幅とは、輪郭点と対応する輪郭
点との間に、黒ドットとして現われるべきドットの数を
表している。
In this embodiment, a line width table as shown in FIG. 2 is prepared. In this table, the distance is defined as an axis direction (x-axis or y-axis) from a contour point having a certain attribute.
Indicates that there is a point corresponding to the point advanced by the distance corresponding to (axis). The line width represents the number of dots that should appear as black dots between a contour point and a corresponding contour point.

【0022】このテーブル中の距離や線幅はヒンティン
グ時には変倍が施されているものとする。ヒンティング
時に得ることのできる座標データもまた変倍が施されて
いるものとする。
It is assumed that the distance and the line width in this table are scaled during hinting. It is assumed that the coordinate data that can be obtained at the time of hinting has also been scaled.

【0023】以下の説明においては、図4の輪郭点1と
輪郭点2を例にする。なお、点1には属性1が、点2に
は属性0が設定されているものとする。
In the following description, contour point 1 and contour point 2 in FIG. 4 are taken as an example. It is assumed that attribute 1 is set for point 1 and attribute 0 is set for point 2.

【0024】〈実施例1のヒンティング〉前述したよう
に、図1の処理において、縦ステムの右端についてはx
座標(変倍後の座標)の丸めを行う。すなわち、点2の
x座標を四捨五入する。左端(点1)については以下の
手順によってヒンティングを行う。すなわち、 (1)既に変倍されているx座標(x1’とする)を次
式1に従って、デザインサイズにおけるx座標(x1)
に変換する。ここで、既に変倍されているx座標は、前
述したようにその小数部がnビット(k>n)に収まる
ように丸められている。そして、例えば近年現われたフ
ォントファイルフォーマットであるTrue Type
においては、パラメータテーブルの値や輪郭点の座標デ
ータはヒンティング時には既に変倍されていて、フォン
トデータに収められた、変倍前の値を取り出すことは困
難となっている。
<Hinting of Embodiment 1> As described above, in the processing of FIG.
Coordinates (coordinates after scaling) are rounded. That is, the x coordinate of the point 2 is rounded off. Hinting is performed on the left end (point 1) according to the following procedure. That is: (1) The x-coordinate (x1) in the design size is obtained from the x-coordinate (x1 ′) already scaled according to the following equation
Convert to Here, the x-coordinate that has already been scaled is rounded so that its decimal part fits into n bits (k> n) as described above. Then, for example, True Type, a font file format that has recently appeared,
In, the value of the parameter table and the coordinate data of the contour point have already been scaled at the time of hinting, and it is difficult to extract the value before scaling stored in the font data.

【0025】そこで、本実施例では、変倍前の座標値を
得るために、式1に従って既に変倍されたデータを逆変
換してデザイン時のデータを得るようにしたものであ
る。 Z=Z’×D÷S 式1 ここで、Z’は、変倍後の座標データや線幅データであ
り、Dは、X×Yピクセルの空間でデザインされたデザ
インサイズD(2のk乗<D<2の(k+1)乗)であ
り、Sは、変倍後の現サイズであり、Zは、デザイン時
の座標値や線幅などの整数データである。
Therefore, in this embodiment, in order to obtain the coordinate values before scaling, the data already scaled according to the equation 1 is inversely transformed to obtain the data at the time of design. Z = Z ′ × D ÷ S Equation 1 Here, Z ′ is coordinate data or line width data after scaling, and D is a design size D (2k of 2) designed in a space of X × Y pixels. Power <D <2 (k + 1) power), S is the current size after scaling, and Z is integer data such as coordinate values and line width at the time of design.

【0026】(2)線幅テーブルから得られる変倍され
た、左端の点から対応する右端の点までの距離(h’と
する)を、上記した式1に従ってデザインサイズにおけ
る距離(h)に変換する。 (3)デザインサイズに変換されたx1とhを加える。
これはデザイン時の点2のx座標と同じである。 (4)得られたx座標を、次式2に従って、現在のサイ
ズSにおけるx座標(x1”とする)に変換する(これ
は、点2の現在の位置と同じである)。すなわち、 Z”=Z×S÷D 式2 ここで、変倍後のヒンティング時の演算精度が整数部に
対してmビット、小数部に対してnビットが割り当てら
れているものとする。フォントデータは、X×Yピクセ
ルの空間でデザインされ、フォントの変倍に用いられる
デザインサイズDは2のk乗<D<2の(k+1)乗を
満たすものとする。フォントの変倍に際してはすべての
座標データや線幅データZに対して、求めるサイズSの
とき上記式2を用いて変倍後の値Z”を得る。ただし、
ここではZ”は、その小数部がnビットに収まるように
丸められている(例えば、四捨五入)。
(2) The scaled distance (h ′) from the left end point to the corresponding right end point obtained from the line width table is converted to the distance (h) in the design size according to the above-described equation (1). Convert. (3) Add x1 and h converted to the design size.
This is the same as the x coordinate of point 2 at the time of design. (4) Convert the obtained x-coordinate into an x-coordinate in the current size S (let it be x1 ″) according to the following equation 2 (this is the same as the current position of point 2): Z Here, it is assumed that the arithmetic precision at the time of hinting after scaling is m bits for the integer part and n bits for the decimal part. The font data is designed in a space of X × Y pixels, and the design size D used for scaling the font satisfies 2 k <D <2 (k + 1). When scaling the font, a value Z "after scaling is obtained for all the coordinate data and the line width data Z using the above formula 2 when the size S is obtained.
Here, Z ″ is rounded (eg, rounded) so that the fractional part fits into n bits.

【0027】(5)x座標(x1”)の丸めを行う。こ
れはヒンティング後の点2の位置と同じである。
(5) Round the x coordinate (x1 ″), which is the same as the position of point 2 after hinting.

【0028】(6)丸められたx座標から、線幅テーブ
ルから得られる黒ドットとして現われるドット数(これ
は変倍後のものである)を丸めた分だけ減じる。
(6) From the rounded x coordinate, the number of dots appearing as black dots obtained from the line width table (this is after scaling) is reduced by the rounded amount.

【0029】(7)得られたx座標の位置に点1を移動
する。
(7) Point 1 is moved to the position of the obtained x coordinate.

【0030】〈実施例2のヒンティング〉本実施例で
は、図6において、縦ステムの右端について以下の手順
によってヒンティングを行う。 (1)変倍されているx座標を式1に従って、デザイン
サイズにおけるx座標に変換する。 (2)線幅テーブルから得られる変倍された、左端の点
から対応する右端の点までの距離(h’とする)を、式
1に従ってデザインサイズにおける距離(h)に変換す
る。 (3)デザインサイズに変換された距離の1/2をx座
標から減じる。この値は、デザイン時の点1と点2の中
点のx座標を示す。 (4)新しいx座標を式2に従って、現在のサイズにお
けるx座標に変換する。この値は、現在のサイズにおけ
る点1と点2の中点のx座標を示す。 (5)x座標の丸めを行う。ここで丸めとは、線幅テー
ブルから得られる黒ドットとして現われるドット数が奇
数であるときピクセル中心への丸めを行い、偶数である
ときピクセル境界への丸めを行うことを意味する。 (6)丸められたx座標に、線幅テーブルから得られる
黒ドットとして現われるべきドット数を丸めた数の1/
2を加える。 (7)得られたx座標の位置に点2を移動する。
<Hinting of Embodiment 2> In this embodiment, hinting is performed on the right end of the vertical stem in FIG. (1) The scaled x coordinate is converted into the x coordinate in the design size according to Equation 1. (2) The scaled distance (h ') from the left end point to the corresponding right end point obtained from the line width table is converted into the distance (h) in the design size according to Equation 1. (3) 1/2 of the distance converted into the design size is subtracted from the x coordinate. This value indicates the x coordinate of the midpoint between points 1 and 2 at the time of design. (4) Convert the new x coordinate to the x coordinate at the current size according to Equation 2. This value indicates the x coordinate of the midpoint between points 1 and 2 at the current size. (5) Round the x coordinate. Here, rounding means that when the number of dots appearing as black dots obtained from the line width table is odd, rounding to the pixel center is performed, and when it is even, rounding to pixel boundaries is performed. (6) On the rounded x coordinate, the number of dots to appear as black dots obtained from the line width table is 1 / (rounded number)
Add 2. (7) Point 2 is moved to the position of the obtained x coordinate.

【0031】縦ステムの左端(点1)については、以上
の手順の加減算を逆にすることによって行う。この実施
例によると、ステムの中心(点1と点2の中点)をピク
セル境界あるいはピクセル中心に合わせるように、ヒン
ティングされる。以上の説明において、式1、2におけ
るD,Sは実際にはそのまま使用する必要はなく、任意
の整数fに対してfD、fSを用いれば十分である。
For the left end (point 1) of the vertical stem, the addition and subtraction in the above procedure are reversed. According to this embodiment, hinting is performed so that the center of the stem (the midpoint between points 1 and 2) is aligned with the pixel boundary or pixel center. In the above description, D and S in Equations 1 and 2 do not actually need to be used as they are, but it is sufficient to use fD and fS for an arbitrary integer f.

【0032】〈実施例3〉整数部の表現に使用されるm
ビットが比較的小さいとき、式1のZ’×Dを実行した
瞬間にオーバーフローする可能性がある。本実施例は、
オーバーフローすることなくヒンティング処理を行うよ
うにしたものである。
<Embodiment 3> m used for expressing an integer part
When the bit is relatively small, an overflow may occur at the moment when Z ′ × D in Equation 1 is executed. In this embodiment,
The hinting process is performed without overflow.

【0033】すなわち、k>nであるとき、k−n<p
<m+n−kを満たすpを選ぶ。前記した実施例1、2
において、式1を適用する際に、まず、pを用いて Z(1)=Z’×2*p÷S 式3 を計算し、次いで、 Z(2)=Z(1)×(D÷2*p) 式4 を計算することによって、オーバーフローすることなく
ヒンティング処理が可能になる。なお、2*pは、2の
p乗を表す。
That is, when k> n, kn <p
Choose p that satisfies <m + nk. Embodiments 1 and 2 described above
In applying Equation 1, first, using p, Z (1) = Z ′ × 2 * p ÷ S Equation 3 is calculated, and then Z (2) = Z (1) × (D ÷ 2 * p) By calculating Equation 4, hinting processing can be performed without overflow. Note that 2 * p represents 2 to the power of p.

【0034】[0034]

【発明の効果】以上、説明したように、請求項1記載の
発明によれば、演算時のデータ表現のための精度が低い
系においても正確な線幅補正を行うことができる。
As described above, according to the first aspect of the present invention, accurate line width correction can be performed even in a system having a low precision for expressing data at the time of calculation.

【0035】請求項2記載の発明によれば、小数部だけ
でなく、整数部の精度が不足する系においても正確な線
幅補正を行うことができる。
According to the second aspect of the present invention, accurate line width correction can be performed not only in a decimal part but also in a system where the precision of an integer part is insufficient.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明のヒンティング処理のフローチャートで
ある。
FIG. 1 is a flowchart of a hinting process of the present invention.

【図2】線幅テーブルを示す図である。FIG. 2 is a diagram showing a line width table.

【図3】アウトラインフォントの処理構成図である。FIG. 3 is a processing configuration diagram of an outline font.

【図4】展開されたアウトラインデータである。FIG. 4 is expanded outline data.

【図5】変倍されたアウトラインデータである。FIG. 5 is scaled outline data.

【図6】ヒンティングされたアウトラインデータであ
る。
FIG. 6 shows hinted outline data.

【図7】左右のステムの幅が異なってヒンティングされ
たアウトラインデータである。
FIG. 7 shows outline data hinted with different widths of right and left stems.

【符号の説明】[Explanation of symbols]

1 フォントファイル 2 展開部 3 変倍処理部 4 ヒンティング処理部 5 ラスタライザ 6 ドットデータ Reference Signs List 1 font file 2 expansion section 3 scaling processing section 4 hinting processing section 5 rasterizer 6 dot data

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ヒンテイング時の演算精度が整数部に対
してmビット、小数部に対してnビットが割り当てら
れ、アウトラインフォントデータはX×Yピクセルの空
間でデザインされ、該アウトラインフォントデータの変
倍に用いられるデザインサイズDは2*k<D<2*
(k+1)を満たし(ただし、2*kは2のk乗を表
す)、該アウトラインフォントデータの変倍を行うと
き、すべての座標データおよび線幅データZに対して、
求めるサイズがSのとき、下記の式(1) Z’=Z×S÷D 式(1) を用いて、変倍後のデータZ’を得て(ただし、Z’
は、その小数部がnビット(k>n)に収まるように丸
められている)、該変倍後のデータZ’に対してヒンテ
ィングを施すようにしたアウトラインフォントのヒンテ
ィング方法において、デザイン時におけるアウトライン
を構成する第1の輪郭点から軸方向に、対応する第2の
輪郭点までの距離が予め設定され、該第1の輪郭点と第
2の輪郭点の間の黒ドット数を表す線幅が予め設定さ
れ、前記サイズSに変倍されている前記第1の輪郭点の
座標データを、下記の式(2)を用いて、 Z”=Z’×D÷S 式(2) (Z’は、変倍後のデータであり、Z”はデザインサイ
ズDのデータ) デザインサイズDにおける第2の座標データに変換し、
前記サイズSに変倍されている前記距離を、前記式(2)
を用いてデザインサイズにおける第2の距離に変換し、
前記第2の座標データと前記第2の距離を加算して第3
の座標データを生成し、該第3の座標データを、前記式
(1)を用いてサイズSにおける第4の座標データに変換
し、前記線幅を前記式(1)を用いてサイズSにおける線
幅に変換し、該第4の座標データを丸め処理して第5の
座標データを生成し、該第5の座標データから、前記サ
イズSに変倍された黒ドット数を丸めた分だけ減じた第
6の座標データを生成し、生成された該第6の座標デー
タの位置に、前記第1の輪郭点を移動し、前記サイズに
変倍されている前記第2の輪郭点の座標データを丸め処
理することによってヒンティングを行うことを特徴とす
るアウトラインフォントのヒンティング方法。
1. The arithmetic precision at the time of hinting is assigned m bits for an integer part and n bits for a decimal part. Outline font data is designed in a space of X × Y pixels, and conversion of the outline font data is performed. The design size D used for double is 2 * k <D <2 *
When (k + 1) is satisfied (where 2 * k represents 2 to the power of k) and the outline font data is scaled, for all coordinate data and line width data Z,
When the size to be obtained is S, the scaled data Z ′ is obtained using the following equation (1) Z ′ = Z × S ÷ D equation (1) (where Z ′
In the outline font hinting method in which hinting is performed on the scaled data Z ′, the decimal part is rounded so as to fit into n bits (k> n). The distance from the first contour point constituting the outline at the time to the corresponding second contour point in the axial direction is set in advance, and the number of black dots between the first contour point and the second contour point is determined. The coordinate data of the first contour point, the line width of which is set in advance and scaled to the size S, is calculated using the following equation (2) as follows: Z ″ = Z ′ × D ÷ S Equation (2) (Z ′ is data after zooming, and Z ″ is data of design size D.) Convert to the second coordinate data of design size D,
The distance scaled to the size S is calculated by the equation (2).
Is converted to a second distance in the design size using
Adding the second coordinate data and the second distance to form a third
Is generated, and the third coordinate data is expressed by the formula
(1) is converted into fourth coordinate data in size S, the line width is converted into line width in size S using equation (1), and the fourth coordinate data is rounded. Fifth coordinate data is generated, and from the fifth coordinate data, sixth coordinate data is generated by subtracting the number of black dots scaled to the size S by a rounded amount. Hinting is performed by moving the first contour point to the position of the coordinate data, and rounding the coordinate data of the second contour point that has been scaled to the size. Font hinting method.
【請求項2】 前記mの精度が低く、k>nであると
き、k−n<p<m+n−kを満たすpを選び、前記式
(2)を用いてデザインサイズのデータに変換するとき
に、該pを用いて、 Z(1)=Z’×2*p÷S 式(3) を計算し、次いで、 Z(2)=Z(1)×(D÷2*p) 式(4) を計算する(ただし、2*pは、2のp乗を表す)こと
を特徴とする請求項1記載のアウトラインフォントのヒ
ンティング方法。
2. When the precision of m is low and k> n, p that satisfies kn <p <m + nk is selected, and
When converting into design size data using (2), Z (1) = Z ′ × 2 * p ÷ S Equation (3) is calculated using the p, and then Z (2) = 2. The outline font hinting method according to claim 1, wherein Z (1) × (D ÷ 2 * p) Equation (4) is calculated (where 2 * p represents 2 p). .
JP24082692A 1992-09-09 1992-09-09 Hinting outline fonts Expired - Fee Related JP3215179B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24082692A JP3215179B2 (en) 1992-09-09 1992-09-09 Hinting outline fonts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24082692A JP3215179B2 (en) 1992-09-09 1992-09-09 Hinting outline fonts

Publications (2)

Publication Number Publication Date
JPH0695643A JPH0695643A (en) 1994-04-08
JP3215179B2 true JP3215179B2 (en) 2001-10-02

Family

ID=17065279

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24082692A Expired - Fee Related JP3215179B2 (en) 1992-09-09 1992-09-09 Hinting outline fonts

Country Status (1)

Country Link
JP (1) JP3215179B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010039375A (en) * 2008-08-07 2010-02-18 Sharp Corp Character drawing device, character drawing method, character drawing program, and computer-readable recording medium
US8102397B2 (en) * 2009-01-26 2012-01-24 Mitsubishi Electric Research Laboratories Inc. Method for improving uniform width character strokes using multiple alignment zones

Also Published As

Publication number Publication date
JPH0695643A (en) 1994-04-08

Similar Documents

Publication Publication Date Title
JP2909273B2 (en) Outline font line width adjusting method and apparatus
JPH0318193B2 (en)
JP3215179B2 (en) Hinting outline fonts
KR0142162B1 (en) Character generating method and apparatus
JP2828592B2 (en) Kerning treatment method
JP3243293B2 (en) Contour correction method
JP2674287B2 (en) Graphic microcomputer
JP6169048B2 (en) A method for transforming an input path, a method for labeling input path segments as internal or external, a method for rendering an input path, and a method for drawing an outline of an input path
JP3057959B2 (en) Data converter
KR940001106B1 (en) Image processing method and apparatus therefor
JP2906717B2 (en) Image scaling method
JPS59195759A (en) Enlarging and contracting method of picture
JP3032417B2 (en) Character generator
JP3338484B2 (en) Outline font transformation device
JP2736803B2 (en) How to convert image magnification
JP2521756B2 (en) Pattern data generator
JP3260733B2 (en) Vector font dictionary
JPH04162092A (en) Character generating system
JP3035141B2 (en) Character creation device and character creation method
JP3055306B2 (en) Data output device
JPH056164A (en) Character processing device
JP3085396B2 (en) Vector font development method and device
Zahir et al. A near exact image expansion scheme for bi-level images
JPH10164358A (en) Image processing method and image processing unit
JPH04223495A (en) Character signal generator

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070727

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20080727

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090727

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090727

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100727

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20110727

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20120727

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees