Debian Codegraph @

doc/sphinx/olddocs/old/ja/splinefont.html

raw symbols SCIP
1 <HTML>
2 <HEAD>
3 <!-- Created with AOLpress/2.0 -->
4 <!-- AP: Created on: 11-Feb-2001 -->
5 <!-- AP: Last modified: 16-Apr-2004 -->
6 <LINK REL="icon" href="../../_static/fftype16.png">
7 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
8 <!--<TITLE>The basic spline data structures of FontForge</TITLE>-->
9 <TITLE>FontForge の基本的なスプラインデータ構造</TITLE>
10 <LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css">
11 </HEAD>
12 <BODY>
13 <DIV id="in">
14 <H2>
15 <!--Data Types-->
16 データ型
17 </H2>
18 <P>
19 <!--
20 This describes two different types of fonts, a SplineFont (which is essentially
21 a postscript font) and a BDFFont (bitmap font, essentially a bdf file). There
22 are some similarities between the two data structures, each is basically
23 an array (possibly with holes in it) of characters. Each font also contains
24 information like the fontname, the character set (encoding). -->
25 ここでは、2 つの異なるタイプのフォントの説明を行います。1 つは SplineFont (これは本質的には PostScript フォントです) で、もう 1 つは BDFFont (ビットマップフォントで、本質的には BDF ファイルです) です。2 つのデータ構造には多少の類似性があります。それぞれは基本的に文字の配列 (中に空隙を含むことができます) です。各フォントは、フォント名、文字セット (符号化方式) などの情報も含んでいます。
26 <P>
27 <!--
28 The <A HREF="#SplineFont">SplineFont</A> consists of a bunch of
29 <A HREF="#SplineChar">SplineChars</A>, each containing four layers, -->
30 <A HREF="#SplineFont">SplineFont</A> は、多数の <A HREF="#SplineChar">SplineChars</A> からなり、個々の SplineChar は 4 つのレイヤを含みます。
31 <UL>
32 <LI>
33 <!--A foreground layer which contains all the interesting stuff that gets put
34 into the final font -->
35 前面レイヤ。最終結果のフォントに含まれる興味ある事柄をすべて含んでいます。
36 <UL>
37 <LI>
38 <!-- a series of paths (called <A HREF="#SplinePointList">SplineSet</A>s or
39 <A HREF="#SplinePointList">SplinePointList</A> sorry, I gave the data structure
40 two different names) -->
41 一連のパス (<A HREF="#SplinePointList">SplineSet</A> または <A HREF="#SplinePointList">SplinePointList</A> と呼ばれます——同じデータ構造に 2 つの異なる名前をつけてしまって申し訳ありません)
42 <LI>
43 <!-- a series of references to other characters (called
44 <A HREF="#RefChar">RefChar</A>s) -->
45 一連の、他の文字への参照 (<A HREF="#RefChar">RefChar</A> と呼ばれます)。
46 <LI>
47 <!-- a width -->
48 幅
49 <LI>
50 <!-- <A HREF="#Undoes">undoes</A> -->
51 <A HREF="#Undoes">アンドゥ情報</A>
52 </UL>
53 <LI>
54 <!--A background layer (which is used to allow people to trace images of characters)
55 and can contain -->
56 背面レイヤ (文字の画像をトレースすることができるような形で使われます) には、以下の情報を含むことができます:
57 <UL>
58 <LI>
59 <!-- a series of <A HREF="#SplinePointList">SplineSet</A>s -->
60 一連の <A HREF="#SplinePointList">SplineSet</A>
61 <LI>
62 <!-- A series of <A HREF="#ImageList">images</A> -->
63 一連の <A HREF="#ImageList">イメージ</A>
64 <LI>
65 <!-- <A HREF="#Undoes">undoes</A> -->
66 <A HREF="#Undoes">アンドゥ情報</A>
67 </UL>
68 <LI>
69 <!--A grid layer, which is shared by all the characters in a font and in which
70 you can put lines to indicate the Cap Height, X Height, etc. Actually you
71 can put anything there but those are the obviously useful things. It will
72 be seen in all characters. It contains -->
73 グリッドレイヤ。これはフォント内のすべての文字間で共有され、ここにはキャップハイト、x ハイト などを示す線を配置することができます。実際にはここに何を置いても構いませんが、明らかに有用な物が存在します。これはすべての文字から見ることができます。ここには以下の物が含まれます:
74 <UL>
75 <LI>
76 <!-- A series of <A HREF="#SplinePointList">SplineSet</A>s -->
77 一連の <A HREF="#SplinePointList">SplineSet</A>
78 <LI>
79 <!-- <A HREF="#Undoes">undoes</A> -->
80 <A HREF="#Undoes">アンドゥ情報</A>
81 </UL>
82 <LI>
83 <!--A hint layer, whose format is completely different from anything else and
84 consists of horizontal and vertical hints, which in turn are just a starting
85 location and a width (indicating the stem. The width can be negative.) -->
86 ヒントレイヤ。このフォーマットは他のどれとも全然違うもので、水平ヒントと垂直ヒントからなります。これらは単に開始位置と幅の組合せ (ステムを表します。幅は負の値をとることもできます) にすぎません。
87 <UL>
88 <LI>
89 <!-- A set of <A HREF="#Hints">hints</A>. Hints need the special tools from the
90 hint menu for editing them. -->
91 一連の<A HREF="#Hints">ヒント</A>。ヒントを編集するには、ヒントメニューにある特別なツールが必要です。
92 <LI>
93 <!-- <STRONG>!!!! I do not have a way of undoing hint operations !!!!</STRONG> -->
94 <STRONG>!!!! ヒント操作を取り消す方法はありません !!!!</STRONG>
95 </UL>
96 </UL>
97 <P>
98 <!--
99 Every SplineChar has a name associated with it, a unicode encoding and a
100 local encoding (So 'A' will probably have both a unicode encoding and a local
101 encoding of 0x0041). -->
102 各 SplineChar には名前ならびに、Unicode の符号位置とローカルエンコーディングがつけられています (例えば&lsquo;A&rsquo;は通常 Unicode 符号位置とローカルエンコーディングの両方で 0x0041 という値をもつでしょう)。
103 <P>
104 <!--
105 A SplineSet consists of a start point and an end point, and whatever splines
106 connect them. The start point and the end point may be the same, this either
107 indicates a closed path, or a degenerate path with only one point on it. -->
108 各 SplineSet は、開始点・終了点および、それに接続しているスプラインすべてからなります。開始点と終了点は同じ値を取ることができ、これは閉じたパスか、点が 1 個しか存在しない縮退したパスのどちらかであることを示します。
109 <P>
110 <!--
111 A SplinePoint contains an x,y location of the point, and the locations of
112 the two control points associated with that point. A control point may be
113 coincident with the main point. SplinePoints may have two splines, a previous
114 Spline and a next Spline. A Spline contains pointers to two SplinePoints
115 (a start and an end point) it also contains the parameters of the B&eacute;zier
116 curve that those two points describe (x = a*t^3+b*t^2+c*t+d, y=ditto). Splines
117 are straight lines of the two control points that are meaningful to that
118 spline are coincident with their respective SplinePoints. -->
119 各 SplinePoint は、その点の x, y 座標と、それに付随する 2 個の制御点の位置を含みます。制御点は母点と重なり合うこともできます。SplinePoints は、前側 (previous) の Spline と後ろ側 (next) の Splineの 2 本を含むことができます。各 Spline は 2 個の SplinePoint (始点と終点) へのポインタを含みます。それに加えて、その 2 個の点によって表される B&eacute;zier 曲線のパラメータ (x = a*t^3+b*t^2+c*t+d, y=同) もそこに含まれます。ある Spline が直線となるのは、そのスプラインに対して有効な 2 個の制御点が、両端の SplinePoints と重なるときです。
120 <P>
121 <!--
122 A <A HREF="#BDFFont">BDFFont</A> consists of a bunch of
123 <A HREF="#BDFChar">BDFChars</A>, each containing -->
124 1 個の <A HREF="#BDFFont">BDFFont</A> は多数の <A HREF="#BDFChar">BDFChar</A> からなります。各 BDFChar は以下の物を含みます:
125 <UL>
126 <LI>
127 <!--a bitmap-->
128 ビットマップ
129 <LI>
130 <!--possibly a floating selection-->
131 あるいは可動選択範囲
132 <LI>
133 <!--a name and encoding-->
134 名前と符号位置
135 <LI>
136 <!--<A HREF="#Undoes">undoes</A>-->
137 <A HREF="#Undoes">アンドゥ情報</A>
138 <LI>
139 <!--A pointer to the <A HREF="#SplineChar">SplineChar</A> with which it is associated -->
140 その文字に伴う <A HREF="#SplineChar">SplineChar</A> へのポインタ
141 </UL>
142 <BLOCKQUOTE>
143 <PRE>/* Copyright (C) 2000-2003 by George Williams */
144 /*
145 * Redistribution and use in source and binary forms, with or without
146 * modification, are permitted provided that the following conditions are met:
147
148 * Redistributions of source code must retain the above copyright notice, this
149 * list of conditions and the following disclaimer.
150
151 * Redistributions in binary form must reproduce the above copyright notice,
152 * this list of conditions and the following disclaimer in the documentation
153 * and/or other materials provided with the distribution.
154
155 * The name of the author may not be used to endorse or promote products
156 * derived from this software without specific prior written permission.
157
158 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
159 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
160 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
161 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
162 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
163 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
164 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
165 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
166 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
167 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
168 */
169 #ifndef _SPLINEFONT_H
170 #define _SPLINEFONT_H
171
172 #include "basics.h"
173 #include "charset.h"
174
175 enum <A NAME="linejoin">linejoin</A> {
176 lj_miter, <!--/* Extend lines until they meet */-->/* 交差するまで線を延長 */
177 lj_round, <!--/* circle centered at the join of expand radius */-->/* 交点を中心に線幅と同じ半径の円を描く */
178 lj_bevel <!--/* Straight line between the ends of next and prev */-->/* 前後のパスの端点間に直線を引く */
179 };
180 enum <A NAME="linecap">linecap</A> {
181 lc_butt, <!--/* equiv to lj_bevel, straight line extends from one side to other */-->/* lj_bevel に同じ。両端点間を直線でつなぐ */
182 lc_round, <!--/* semi-circle */-->/* 半円 */
183 lc_square <!--/* Extend lines by radius, then join them */-->/* 線を半径と同じ長さだけ延長してから端をつなぐ */
184 };
185
186 typedef struct strokeinfo {
187 double radius;
188 enum linejoin join;
189 enum linecap cap;
190 unsigned int calligraphic: 1;
191 double penangle;
192 double thickness; <!--/* doesn't work */-->/* 動作しない */
193 } <A NAME="StrokeInfo">StrokeInfo</A>;
194 </PRE>
195 </BLOCKQUOTE>
196 <P>
197 <!--
198 The above data structure is used by the ExpandStroke routines which will
199 turn a path into a filled shape. The information above provides the various
200 controls for those routines. They mean essentially what you expect them to
201 me in postscript. -->
202 上のデータ構造は、パスを塗りつぶされた図形に変換する ExpandStroke ルーチンで使用します。上記の情報はそれらのルーチンに各種の制御情報を与えます。それらは本質的に、PostScript で利用可能だと考えられているものです。
203 <BLOCKQUOTE>
204 <PRE>typedef struct ipoint {
205 int x;
206 int y;
207 } <A NAME="IPoint">IPoint</A>;
208 </PRE>
209 </BLOCKQUOTE>
210 <P>
211 <!--
212 An integer point. -->
213 整数値をもつ点です。
214 <BLOCKQUOTE>
215 <PRE>typedef struct basepoint {
216 double x;
217 double y;
218 } <A NAME="BasePoint">BasePoint</A>;
219 </PRE>
220 </BLOCKQUOTE>
221 <P>
222 <!--
223 A double point. This provides the location of
224 <A HREF="#SplinePoint">SplinePoints</A> and their control points. -->
225 倍精度浮動小数の座標値をもつ点です。<A HREF="#SplinePoint">SplinePoint</A> およびその制御点の位置情報を与えます。
226 <BLOCKQUOTE>
227 <PRE>typedef struct tpoint {
228 double x;
229 double y;
230 double t;
231 } <A NAME="TPoint">TPoint</A>;
232 </PRE>
233 </BLOCKQUOTE>
234 <P>
235 <!--
236 A double point with a "t" value. Indicates where that location occurs on
237 a spline. (the start point itself is a t=0, the end point at t=1, intermediate
238 points have intermediate values). Used when trying to approximate new splines. -->
239 浮動小数座標の点に“t”値を加えたものです。スプライン上の位置を表します。(開始点自身は t=0 で、終点は t=1 となり、中間点はその中間の値をとります)。新しいスプラインを近似しようとするときに使用します。
240 <BLOCKQUOTE>
241 <PRE>typedef struct dbounds {
242 double minx, maxx;
243 double miny, maxy;
244 } DBounds;
245 </PRE>
246 </BLOCKQUOTE>
247 <P>
248 <!--
249 The bounding box of a <A HREF="#Spline">Spline</A>,
250 <A HREF="#SplineChar">SplineChar</A>, <A HREF="#RefChar">RefChar</A>,
251 <A HREF="#ImageList">Image</A>, or whatever else needs a bounding box. -->
252 <A HREF="#Spline">Spline</A>, <A HREF="#SplineChar">SplineChar</A>, <A HREF="#RefChar">RefChar</A>, <A HREF="#ImageList">Image</A>, またはその他すべてのバウンディングボックスを必要とするデータ構造のバウンディングボックスです。
253 <BLOCKQUOTE>
254 <PRE>typedef struct bdffloat {
255 int16 xmin,xmax,ymin,ymax;
256 int16 bytes_per_line;
257 uint8 *bitmap;
258 } <A NAME="BDFFloat">BDFFloat</A>;
259 </PRE>
260 </BLOCKQUOTE>
261 <P>
262 <!--
263 The floating selection in a <A HREF="#BDFChar">BDFChar</A>. -->
264 <A HREF="#BDFChar">BDFChar</A> 内の可動選択範囲です。
265 <BLOCKQUOTE>
266 <PRE>typedef struct undoes {
267 struct undoes *next;
268 enum undotype { ut_none=0, ut_state, ut_tstate, ut_width,
269 ut_bitmap, ut_bitmapsel, ut_composite, ut_multiple } undotype;
270 union {
271 struct {
272 int16 width;
273 int16 lbearingchange;
274 <A HREF="#SplinePointList">struct splinepointlist</A> *splines;
275 <A HREF="#RefChar">struct refchar</A> *refs;
276 <A HREF="#ImageList">struct imagelist</A> *images;
277 } state;
278 int width;
279 struct {
280 /*int16 width;*/ <!--/* width should be controlled by postscript */-->/* 線幅はPostScriptが制御すべきもの */
281 int16 xmin,xmax,ymin,ymax;
282 int16 bytes_per_line;
283 uint8 *bitmap;
284 <A HREF="#BDFFloat">BDFFloat</A> *selection;
285 int pixelsize;
286 } bmpstate;
287 struct { <!--/* copy contains an outline state and a set of bitmap states */-->/* コピーはアウトライン状態と1組のビットマップ状態を含む */
288 struct undoes *state;
289 struct undoes *bitmaps;
290 } composite;
291 struct {
292 struct undoes *mult; <!--/* copy contains several sub copies (composites, or states or widths or...) */-->/* コピーはいくつかのサブコピー(組合せ、または状態や幅など…)を含む */
293 } multiple;
294 uint8 *bitmap;
295 } u;
296 } <A NAME="Undoes">Undoes</A>;
297 </PRE>
298 </BLOCKQUOTE>
299 <P>
300 <!--
301 The undo data structure. Used by both <A HREF="#SplineChar">SplineChar</A>
302 and <A HREF="#BDFChar">BDFChar</A>. Also used to contain the clipboard (sorry,
303 I don't use the real X CLIPBOARD). Every character layer has several Undoes
304 (up to about 10 or so, it's configurable) that allow it to go back several
305 operations, these are linked together on the next field (redos are handled
306 similarly, of course). -->
307 アンドゥ処理用のデータ構造です。<A HREF="#SplineChar">SplineChar</A> と <A HREF="#BDFChar">BDFChar</A> のどちらでも使用します。クリップボードを保持するためにも使用します (申し訳ありません。私は本物の X クリップボードを使用しているわけではないのです)。各文字レイヤにはいくつかのアンドゥ (およそ 10 個まで。設定変更可能です) を設定できるので、数段階の操作を戻すことができ、next フィールドによって連絡しています (もちろん、リドゥ操作も同様に扱われます)。
308 <P>
309 <!--
310 Undoes come in several types, ut_none is only used by the clipboard when
311 it is empty. -->
312 アンドゥはいくつかの型に分けられ、ut_none が使用されるのはクリップボードにおいて、そこがもともと空だったときにのみ使用されます。
313 <P>
314 <!--
315 ut_state is used by SplineChars and it contains a dump of the current state
316 of one layer of the character. Obviously things could be optimized a great
317 deal here, but this is easy. ut_tstate has the same data structure as ut_state,
318 it is used during transformations and is just a flag that tells the display
319 to draw the original as well as the currently transformed thing (so you can
320 see what you've done). -->
321 ut_state は SplineChars によって使用され、その文字の 1 レイヤの現在の状態のダンプを含みます。現在の方式には大幅な最適化の余地があることは明らかですが、簡単に扱えるのが利点です。ut_tstate は ut_state と同じデータ構造をもち、これは座標変換のときに使用されますが、それは、現在変換された物と同時にオリジナルを表示するかどうかを表す単なるフラグにすぎません。
322 <P>
323 <!--
324 ut_state is also used by the clipboard when copying a SplineChar or a piece
325 of a SplineChar. -->
326 ut_state は SplineChar またはその一部をコピーするときにクリップボードによって使用されます。
327 <P>
328 <!--
329 ut_width is used by SplineChars when the width (and nothing else) changes. -->
330 ut_width は、幅 (だけ) を変更するときに使用されます。
331 <P>
332 <!--
333 ut_bitmap is used by BDFChars and is a dump of the current state of the bitmap.
334 Again there is room for optimization here, but this is easy. -->
335 ut_bitmap は BDFChars によって使用されるデータ構造で、ビットマップの現在の状態のダンプです。これもまた、最適化の余地がありますが現在は簡単な構造です。
336 <P>
337 <!--
338 ut_bitmapsel is used when doing a copy of a BDFChar. If there is a selection
339 it (and it alone) gets copied into the selection field of the bmpstate structure.
340 If there is no selection the entire bitmap is converted into a
341 <A HREF="#BDFFloat">floating selection</A> and copied into the selection
342 field. -->
343 ut_bitmapsel は BDFChar のコピーを行うときに用いられます。範囲選択を行っているとき、それ (のみ) は <A HREF="#BDFFloat">可動選択範囲</A> に変換されて、bmpstate 構造体の selection フィールドにコピーされます。
344 範囲選択を行っていない場合、ビットマップ全体が<A HREF="#BDFFloat">可動選択範囲</A>に変換され、selection フィールドにコピーされます。
345 <P>
346 <!--
347 ut_composite is used when doing a copy from the
348 <A HREF="views.html#FontView">FontView</A> where you are copying both the
349 splines and the bitmaps of a character. -->
350 ut_composite は<A HREF="views.html#FontView">フォントビュー</A>からコピーを行うとき、1 文字にスプラインとビットマップとが両方含まれているときに用いられます。
351 <P>
352 <!--
353 ut_mult is used when doing a copy from the FontView where you are copying
354 more than one character. -->
355 ut_mult は、フォントビューにおいて複数文字のコピーを行うときに使用されます。
356 <BLOCKQUOTE>
357 <PRE>typedef struct bdfchar {
358 <A HREF="#SplineChar">struct splinechar</A> *sc;
359 int16 xmin,xmax,ymin,ymax;
360 int16 width;
361 int16 bytes_per_line;
362 uint8 *bitmap;
363 int enc;
364 <A HREF="views.html#BitmapView">struct bitmapview</A> *views;
365 <A HREF="#Undoes">Undoes</A> *undoes;
366 <A HREF="#Undoes">Undoes</A> *redoes;
367 unsigned int changed: 1;
368 unsigned int byte_data: 1; <!--/* for anti-aliased chars entries are grey-scale bytes not bw bits */-->/* アンチエイリアス文字の場合,各項目は黒白のビット値ではなくグレイスケールのバイト値 */
369 <A HREF="#BDFFloat">BDFFloat</A> *selection;
370 } <A NAME="BDFChar">BDFChar</A>;
371 </PRE>
372 </BLOCKQUOTE>
373 <P>
374 <!--
375 The basic bitmap character structure. There's a link to the SplineChar used
376 to create the bitmap. Then the bounding box of the bitmap, the character's
377 width (in pixels of course), the number of bytes per row of the bitmap array,
378 a pointer to an array containing the bitmap. The bitmap is stored with 8bits
379 packed into a byte, the high order bit is left most. Every row begins on
380 a new byte boundary. There are (xmax-xmin+1) bits in each row and (xmax-xmin+8)/8
381 bytes in each row. There are (ymax-ymin+1) rows. A bit-value of 1 means there
382 bit should be drawn, 0 means it is transparent. Then the encoding in the
383 current font. A linked list of BitmapView structures all of which look at
384 this bitmap (so any changes to this bitmap need to cause a redraw in all
385 views). A set of undoes and redoes. A flag indicating whether the thing has
386 been changed since it was last saved to disk. -->
387 基本的なビットマップ文字の構造体です。ビットマップの作成時に用いられる SplineChar へのリンクが存在します。次に来るのはビットマップのバウンディングボックス、文字の幅 (もちろんピクセル単位です)、ビットマップ配列の行ごとのバイト数、ビットマップを含む配列へのポインタです。ビットマップは 8 ビットごとに、左端のビットが最上位ビットになる 1 バイトにパックした形式で格納されます。すべての行は新しいバイト境界から始まります。各行には (xmax-xmin+1) ビットが含まれ、その大きさは (xmax-xmin+8) / 8 バイトになります。ビット値 1 はそのビットを塗りつぶすことを表し、0 はそのビットが透明であることを表します。その次に来るのが、現在のフォントにおける符号位置の値ですす。このビットマップを参照するすべての BitmapView 構造体のリンクトリストです (ですから、このビットマップへの任意の変更はすべてのビューで再描画を引き起こします)。一連のアンドゥとリドゥです。最後にディスクに保存を行ってから何か変更を行ったかを示すフラグです。
388 <P>
389 <!--
390 Up to this point I've been talking about bitmaps. It is also possible to
391 have a bytemap. The data structure is exactly the same, except that each
392 pixel is represented by a byte rather than a bit. Currently this is only
393 used for anti-alias displays in the
394 <A HREF="views.html#FontView">FontView</A>, but I may do more with it later.
395 There is a clut for this in the BDFFont (it's the same for every character),
396 but basically 0=&gt;transparent, (2^n-1) =&gt;fully drawn, other values are
397 shades of grey between. Currently my anti-alias fonts contain values 0-15
398 but the code can handle up to 0-255 if desired. (0-15 seems fine to my eye). -->
399 上記の説明は、ビットマップについてのものでました。ここにはバイトマップも格納可能です。データ構造はまったく同じですが、各ピクセルがビットではなくバイトで表される点が異なります。現在のところこれは <A HREF="views.html#FontView">FontView</A> におけるアンチエイリアス表示にのみ用いられていますが、将来はこれを用いてさらに他の事を行えるようにするつもりです (訳註:現在グレイマップ編集はサポートされています)。
400 そのために、BDFFont には clut フィールド (これはすべての文字において同じ値です) が存在しますが、基本的には 0=&gt;透明、(2^n-1) =&gt;完全に塗りつぶし を意味し、その他の値は中間の灰色の濃淡を表します。現在のところ私のアンチエイリアスフォントは 0〜15 の値を使用していますが、プログラム上は必要なら 0〜255 を扱う事ができます (私の目には 0〜15 で十分美しく見えます)。
401 <P>
402 <!--
403 The last thing in the BDFChar is a (/an optional) floating selection. Only
404 present if the user has made a selection or done a paste or something like
405 that. -->
406 BDFChar の最後にあるのは、(省略可能な) 可動選択範囲です。ユーザが範囲選択を行っている場合か、ペーストまたはそれに類似した行為を行った場合にのみ存在します。
407 <BLOCKQUOTE>
408 <PRE>typedef struct bdffont {
409 <A HREF="#SplineFont">struct splinefont</A> *sf;
410 int charcnt;
411 <A HREF="#BDFChar">BDFChar</A> **chars; <!--/* an array of charcnt entries */-->/* charcnt 個の要素からなる配列 */
412 <A HREF="#BDFChar">BDFChar</A> **temp; <!--/* Used by ReencodeFont routine */-->/* ReencodeFont ルーチンで使用する */
413 int pixelsize;
414 int ascent, descent;
415 enum charset encoding_name;
416 struct bdffont *next;
417 struct clut *clut; <!--/* Only for anti-aliased fonts */-->/* アンチエイリアスフォントのみ */
418 } <A NAME="BDFFont">BDFFont</A>;
419 </PRE>
420 </BLOCKQUOTE>
421 <P>
422 <!--
423 The basic bitmap font. Contains a reference to the
424 <A HREF="#SplineFont">SplineFont</A> to which it is attached. Then a size
425 and an array of BDFChars (note there may be NULL entries in the array if
426 no character is defined for that encoding). Then a temporary array which
427 is used in one set of routines while reencoding the font. The pixelsize of
428 the em-square. The ascent and descent (in pixels), these should sum to the
429 em-square. A character set which will match that in the SplineFont. A pointer
430 to the next bitmap font associated with this SplineFont. -->
431 基本的なビットマップフォントです。それと結びつけられている <A HREF="#SplineFont">SplineFont</A> への参照があります。その後にはサイズと、BDFChars の配列があります (そのエンコーディングでは文字を定義するデータが存在しない場合、配列内に値が NULL の項目が置かれているという可能性があることに注意してください)。その後にあるのは、フォントの符号化方式を変換する一連のルーチンが使用する一時的な配列があります。em 正方形のピクセルサイズです。(ピクセル単位の) 高さと深さです。この合計は em 正方形と等しくなくてはなりません。SplineFont 内の値と一致する文字セットです。この SplineFont と対応づけられた次のビットマップフォントへのポインタです。
432 <P>
433 <!--
434 If we are dealing with a byte font, then there will also be a clut. This
435 contains a count of the number of entries in the array, and then the array
436 itself. Currently the number of entries here is always 16, but that could
437 change. -->
438 バイトマップフォントを扱っている場合、その後に clut が来るでしょう。これには配列内の各要素のビット数と、配列そのものが含まれます。現在のところビット数は常に 16 ですが、これは変更されるでしょう。
439 <BLOCKQUOTE>
440 <PRE>enum pointtype { pt_curve, pt_corner, pt_tangent };
441 typedef struct splinepoint {
442 <A HREF="#BasePoint">BasePoint</A> me;
443 <A HREF="#BasePoint">BasePoint</A> nextcp; <!--/* control point */-->/* 制御点 */
444 <A HREF="#BasePoint">BasePoint</A> prevcp; <!--/* control point */-->/* 制御点 */
445 unsigned int nonextcp:1;
446 unsigned int noprevcp:1;
447 unsigned int nextcpdef:1;
448 unsigned int prevcpdef:1;
449 unsigned int selected:1; <!--/* for UI */-->/* UI 用 */
450 unsigned int pointtype:2;
451 unsigned int isintersection: 1;
452 uint16 flex; <!--/* This is a flex serif have to go through icky flex output */-->/* これは,べとべとしたflexの出力を通り抜けるために必要なflexセリフである */
453 <A HREF="#Spline">struct spline</A> *next;
454 <A HREF="#Spline">struct spline</A> *prev;
455 } <A NAME="SplinePoint">SplinePoint</A>;
456 </PRE>
457 </BLOCKQUOTE>
458 <P>
459 <!--
460 A SplinePoint is located at the position specified by "me". The control point
461 associated with the next <A HREF="#Spline">Spline</A> is positioned at nextcp,
462 while that associated with the previous Spline is at prevcp. Then there are
463 a couple of flags that simplify tests. If the nextcp is degenerate (ie. at
464 the same place as me) then nonextcp is set, similarly for prevcp. If the
465 user has not touched the control points then they will have their default
466 values, and when the user moves the point around fontforge will update the
467 control points appropriately, if they do not have default values then fontforge
468 will only offset them. -->
469 SplinePoint は、“me”で指定された位置に置かれています。次の <A HREF="#Spline">Spline</A> に付随する制御点は nextfp に置かれ、前の Spline に付随する制御点は prevcp に置かれています。それに続き、simplify 処理がテストする 2 個のフラグがあります。nextcp が縮退している (すなわち、me と同じ場所にある) 場合 nonextcp がセットされます。prevcp もそれと同様です。ユーザが制御点の位置を操作していない場合、それらはデフォルト値をもっており、ユーザが点を移動したときには FontForge は制御点の位置を適切に設定しますが、それがデフォルト値と異なるときには FontForge はそれらを単純にオフセットするだけです。
470 <P>
471 <!--
472 If the point is selected then that bit will be set. -->
473 点が選択されているとき、selected ビットがセットされます。
474 <P>
475 <!--
476 Every point is classified as a curve point, a corner point and a tangent
477 point. -->
478 各点は曲線上の点 (pt_curve)、角の点 (pt_corner) および曲線の開始点 (pt_tangent) のいずれかに分類されます。
479 <P>
480 <!--
481 The isintersection bit is used internally to the SplineOverlap routines.
482 The flex value is for flex hints. It is read in from a type1 font and then
483 ignored. Someday I may use it. -->
484 isintersection ビットは SplineOverlap ルーチンが内部的に使用します。flex 値は flex ヒントのために使用します。Type 1 フォントから読み込まれ、その後は無視されます。いずれはこの情報を使うようにするつもりです。
485 <P>
486 <!--
487 Finally we have pointers to the two Splines than connect to this point. -->
488 最後に、この点に接続する 2 本の Spline に対するポインタがあります。
489 <BLOCKQUOTE>
490 <PRE>typedef struct linelist {
491 IPoint here;
492 struct linelist *next;
493 } <A NAME="LineList">LineList</A>;
494
495 typedef struct linearapprox {
496 double scale;
497 unsigned int oneline: 1;
498 unsigned int onepoint: 1;
499 struct linelist *lines;
500 struct linearapprox *next;
501 } <A NAME="LinearApprox">LinearApprox</A>;
502 </PRE>
503 </BLOCKQUOTE>
504 <P>
505 <!--
506 These are the lines used to approximate a <A HREF="#Spline">Spline</A> when
507 drawing it. They are cached so they don't need to be regenerated each time.
508 There's a different set of lines for every scale (as there is a different
509 amount of visible detail). They get freed and regenerated if the Spline changes. -->
510 これらは <A HREF="#Spline">Spline</A> を描画するのに用いられる線です。これらはキャッシュされるので、毎回再生成する必要はありません。これらは異なる拡大率の線ごとに (細部の表示量が異なるため) 別々のセットが用意されます。
511 <BLOCKQUOTE>
512 <PRE>typedef struct spline1d {
513 double a, b, c, d;
514 } <A NAME="Spline1D">Spline1D</A>;
515
516 typedef struct spline {
517 unsigned int islinear: 1;
518 unsigned int isticked: 1;
519 unsigned int isneeded: 1;
520 unsigned int isunneeded: 1;
521 unsigned int ishorvert: 1;
522 <A HREF="#SplinePoint">SplinePoint</A> *from, *to;
523 <A HREF="#Spline1D">Spline1D</A> splines[2]; <!--/* splines[0] is the x spline, splines[1] is y */-->/* splines[0]は x 軸のスプライン関数, spline[1]は y 軸 */
524 <A HREF="#LinearApprox">struct linearapprox</A> *approx;
525 /* <!--Possible optimizations:-->可能な最適化:
526 <!--Precalculate bounding box-->バウンディングボックスを予め計算しておく
527 <!--Precalculate points of inflection-->変曲点を予め計算しておく
528 */
529 } <A NAME="Spline">Spline</A>;
530 </PRE>
531 </BLOCKQUOTE>
532 <P>
533 <!--
534 A spline runs from the from <A HREF="#SplinePoint">SplinePoint</A> to the
535 to SplinePoint. If both control points of a Spline are degenerate, then the
536 Spline is linear (actually there are some other case that will lead to linear
537 splines, sometimes these will be detected and turned into the canonical case,
538 other times they will not be). The remaining bits are used when processing
539 Splines in various functions. Most are used in the SplineOverlap routines,
540 but some are used in other places too. -->
541 Spline は、<A HREF="#SplinePoint">SplinePoint</A> と SplinePoint の間をつなぎます。Spline の両制御点が縮退している時は、その Spline は直線です (実際には、Spline が直線となるのは別のいくつかの場合があります。場合によってはそれらは検出されて正準形に変換されますが、場合によっては正規化されません)。残りのビットは、Spline を各種の関数で処理する時に用いられます。ほとんどは SplineOverlap ルーチンで用いられるものですが、いくつかは他の場所でも用いられます。
542 <P>
543 <!--
544 The Spline1D structures give the equations for the x and y coordinates
545 respectively (splines[0] is for x, splines[1] is for y). -->
546 Spline1D 構造体は、x および y 座標のそれぞれに対する等式を与えます (splines[0] は x 軸、spline[1] は y 軸にあたります)。
547 <BLOCKQUOTE>
548 <PRE>typedef struct splinepointlist {
549 <A HREF="#SplinePoint">SplinePoint</A> *first, *last;
550 struct splinepointlist *next;
551 } <A NAME="SplinePointList">SplinePointList</A>, <A NAME="SplineSet">SplineSet</A>;
552 </PRE>
553 </BLOCKQUOTE>
554 <P>
555 <!--
556 A SplinePointList (or a SplineSet) is a collection of
557 <A HREF="#Spline">Spline</A>s and <A HREF="#SplinePoint">SplinePoint</A>s.
558 Every SplinePoint can connect to two Splines (next and prev). Every Spline
559 connects to two SplinePoints (from and to). A SplinePointList is a connected
560 path. There are three cases: -->
561 SplinePointList (別名 SplineSet) は <A HREF="#Spline">Spline</A> および <A HREF="#SplinePoint">SplinePoint</A> の集まりです。各 SplinePoint は 2 本のスプライン (next と prev) に接続します。1 個の SplinePointList は、一つながりのパスを表します。以下の 3 つの場合が存在します。
562 <UL>
563 <LI>
564 <!--<CODE>first != last</CODE> which means that we have an open path. Here
565 first-&gt;prev==NULL and last-&gt;next==NULL. -->
566 <CODE>first != last</CODE> の場合、開いたパスを表します。この場合 first-&gt;prev==NULL かつ last-&gt;next==NULL となります。
567 <LI>
568 <!--<CODE>first == last</CODE> and <CODE>first-&gt;prev==NULL</CODE> which means
569 we have a degenerate path consisting of a single point, and
570 last-&gt;next==NULL as well -->
571 <CODE>first == last</CODE> かつ <CODE>first-&gt;prev==NULL</CODE> の場合、1 個の点からなる縮退したパスを表します。この場合も <CODE>last-&gt;next==NULL</CODE> となります。
572 <LI>
573 <!--<CODE>first == last</CODE> and <CODE>first-&gt;prev!=NULL</CODE> which means
574 we have a closed path. This should be the most common case. -->
575 <CODE>first == last</CODE> かつ <CODE>first-&gt;prev==NULL</CODE> の場合、閉じたパスを表します。これが最も一般的な場合と言えるでしょう。
576 </UL>
577 <P>
578 <!--
579 Generally a series of paths will make up a character, and they are linked
580 together on the next field. -->
581 一般に一連のパスは 1 個の文字を構成し、それらは next フィールドによって連絡しています。
582 <BLOCKQUOTE>
583 <PRE>typedef struct refchar {
584 int16 adobe_enc, local_enc;
585 int unicode_enc; <!--/* used by paste */-->/* ペーストのとき用いる */
586 double transform[6]; <!--/* transformation matrix (first 2 rows of a 3x3 matrix, missing row is 0,0,1) */-->/* 変換行列 (3×3 行列の上 2 行。省略した行は 0,0,1) */
587 <A HREF="#SplinePointList">SplinePointList</A> *splines;
588 struct refchar *next;
589 unsigned int checked: 1;
590 unsigned int selected: 1;
591 <A HREF="#DBounds">DBounds</A> bb;
592 <A HREF="#SplineChar">struct splinechar</A> *sc;
593 } <A NAME="RefChar">RefChar</A>;
594 </PRE>
595 </BLOCKQUOTE>
596 <P>
597 <!--
598 A <A HREF="#SplineChar">SplineChar</A> may contain a reference to another
599 character. For instance "Agrave" might contain a reference to an "A" and
600 a "grave". There are three different encoding values, of which local_enc
601 is not always up to date. Adobe_enc gives the location in the Adobe Standard
602 Encoding which is used by the seac command in type1 fonts. If this is -1
603 then the character isn't in the adobe encoding and it won't be possible to
604 put a reference to it into a Type1 font (truetype doesn't have this restriction,
605 it has other ones). The transformation matrix is a standard postscript
606 transformation matrix (3 rows of 2 columns. First 2 rows provide standard
607 rotation/scaling/flipping/skewing/... transformations, last row provides
608 for translations. (Both postscript and truetype have restrictions on what
609 kinds of transformations are acceptable). The splines field provides a quick
610 way of drawing the referred character, it is the result of applying the
611 transformation matrix on all splines in the refered character. There may
612 be several referred characters and they are linked together on the next field.
613 The checked field is used to insure that we don't have any loops (ie. on
614 characters which refer to themselves). The selected field indicates that
615 the reference is selected. The bb field provides a transformed bounding box.
616 And the sc field points to the SplineChar we are referring to. -->
617 <A HREF="#SplineChar">SplineChar</A> は他の文字への参照を含むことができます。例えば、“Agrave”は“A”と“grave”への参照を含みます。符号位置を表す値には 3 つの異なる種類があり、local_enc は常に最新の状態を保っています。adobe_enc は、Adobe 標準エンコーディングにおける符号位置を表し、Type 1 フォントの seac コマンドで使用されます。この値が -1 であるときにはこの文字が Adobe エンコーディングに含まれていないことを表し、その場合は、Type1 フォントの中でこの文字への参照を行うことはできなくなります (TrueType にはこの制限はありませんが、他の制限があります)。transform[] は、PostScript の標準変換行列です (3 行 2 列)。最初の 2 行が標準的な回転/拡大縮小/反転/傾き…変換を行い、最後の行は平行移動を指定します。(PostScript と TrueType のどちらにも、可能な座標変換の種類に対する制限があります)。splines フィールドは参照された文字を描画するための簡便な方法を提供します。これは、参照された文字のすべてのスプラインに変換行列を適用したものです。参照された文字は複数存在する可能性があり、それらは next フィールドによりリンクしています。checked フィールドは、ループが存在しないか (例えば、自分自身を参照している文字がないか) どうかを確めるために使用します。selected フィールドは、参照が選択されていることを示します。bb フィールドは座標変換を施したバウンディグボックスを提供します。そして、sc フィールドは、参照している SplineChar を指し示します。
618 <BLOCKQUOTE>
619 <PRE>typedef struct kernpair {
620 struct splinechar *sc;
621 int off;
622 struct kernpair *next;
623 } <A NAME="KernPair">KernPair</A>;
624 </PRE>
625 </BLOCKQUOTE>
626 <P>
627 <!--
628 If a character should be kerned with another, then this structure provides
629 that info. Every SplineChar has a linked list of KernPairs attached to it.
630 In that list the sc field indicates the other character in the pair, and
631 off defines the offset between them (or rather the difference from what their
632 respective left and right bearings would lead you to believe it should be).
633 Next points to the next kernpair. -->
634 文字同士がカーニングする場合は、この構造体がその情報を提供します。各 SplineChar は、その文字に接続する KernPairs のリンクトリストをもっています。そのリストでは、sc フィールドがペアに含まれるもう 1 つの文字を示し、off がそれらの間のオフセットを定義します (またはむしろ、それらの各文字の左右のサイドベアリングから得た差の値の方を信ずべきときは、そのようにするべきです)。next は、次の KernPair を指し示します。
635 <BLOCKQUOTE>
636 <PRE>typedef struct hints {
637 double base, width;
638 double b1, b2, e1, e2;
639 double ab, ae;
640 unsigned int adjustb: 1;
641 unsigned int adjuste: 1;
642 struct hints *next;
643 } <A NAME="Hints">Hints</A>;
644 </PRE>
645 </BLOCKQUOTE>
646 <P>
647 <!--
648 The only important fields here are base, width and next. The others are used
649 temporarily by the SplineFill routines. Base gives the location (in either
650 x or y space) of where the stem starts, and width is how long it is. Width
651 may be negative (in which case base is where the stem ends). Next points
652 to the next hint for the character. -->
653 重要なフィールドと呼べるのは base, width と next だけです。その他は SplineFill ルーチンで一時的に使用するだけです。Base はステム開始位置 (x 座標または y 座標のどちらか) を指定し、width はステムの幅を表します。width は負の値になることもあります (その場合、ステムの終了位置です)。next はその文字の次のヒントを指し示します。
654 <BLOCKQUOTE>
655 <PRE>typedef struct imagelist {
656 struct gimage *image;
657 double xoff, yoff; <!--/* position in character space of upper left corner of image */-->/* 画像の左上端の,文字空間における位置 */
658 double xscale, yscale; <!--/* scale to convert one pixel of image to one unit of character space */-->/* 画像の1ピクセルを文字空間の1単位に変換するための拡大率 */
659 <A HREF="#DBounds">DBounds</A> bb;
660 struct imagelist *next;
661 unsigned int selected: 1;
662 } <A NAME="ImageList">ImageList</A>;
663 </PRE>
664 </BLOCKQUOTE>
665 <P>
666 <!--
667 SplineChars may have images in their backgrounds. This structure contains
668 a pointer to the image to be displayed, an indication of where it should
669 be positioned, and how it should be scaled (I do not support any other
670 transformations on images). The bounding box is after the transformations
671 have been applied. The next field points to the next image, and selected
672 indicates whether this one is selected or not. -->
673 SplineChars は、背景に画像を配置することができます。この構造体は表示される画像へのポインタと、それをどこへ置くべきか・どのように拡大/縮小 (画像に対する変換はこれ以外にサポートしていません) を表す印を含みます。バウンディングボックスは、座標変換が適用された後の値です。next フィールドは次の画像を指し示し、selected は、この画像が選択されているか否かを表します。
674 <BLOCKQUOTE>
675 <PRE>typedef struct splinechar {
676 char *name;
677 int enc, unicodeenc;
678 int width;
679 int16 lsidebearing; <!--/* only used when reading in a type1 font */-->/* Type1フォントの読み込み時にのみ使用 */
680 int16 ttf_glyph; <!--/* only used when writing out a ttf font */-->/* TTFフォントの書き出し時にのみ使用 */
681 <A HREF="#SplinePointList">SplinePointList</A> *splines;
682 <A HREF="#Hints">Hints</A> *hstem; <!--/* hstem hints have a vertical offset but run horizontally */-->/* hstemヒントは垂直オフセットを含み,水平に延びる */
683 <A HREF="#Hints">Hints</A> *vstem; <!--/* vstem hints have a horizontal offset but run vertically */-->/* vstemヒントは水平オフセットを含み,垂直に延びる */
684 <A HREF="#RefChar">RefChar</A> *refs;
685 <A HREF="views.html#CharView">struct charview</A> *views; <!--/* All CharViews that look at us */-->/* この文字を参照するすべての CharView */
686 <A HREF="#SplineFont">struct splinefont</A> *parent;
687 unsigned int changed: 1;
688 unsigned int changedsincelasthhinted: 1;
689 unsigned int changedsincelastvhinted: 1;
690 unsigned int manualhints: 1;
691 unsigned int ticked: 1; <!--/* For reference character processing */-->/* 参照文字の処理用 */
692 unsigned int changed_since_autosave: 1;
693 unsigned int widthset: 1; <!--/* needed so an emspace char doesn't disappear */-->/* 文字"emspace"が消えないために必要 */
694 struct splinecharlist { struct splinechar *sc; struct splinecharlist *next;} *dependents;
695 <!--/* The dependents list is a list of all characters which reference*/-->/* dependentsリストは現在の文字を直接参照するすべての文字の */
696 <!--/* the current character directly */-->/* リストのリスト */
697 <A HREF="#SplinePointList">SplinePointList</A> *backgroundsplines;
698 <A HREF="#ImageList">ImageList</A> *backimages;
699 <A HREF="#Undoes">Undoes</A> *undoes[2];
700 <A HREF="#Undoes">Undoes</A> *redoes[2];
701 <A HREF="#KernPair">KernPair</A> *kerns;
702 uint8 *origtype1; <!--/* The original type1 (unencoded) character string */-->/* オリジナルの (符号位置をもたない) Type1 charstring */
703 int origlen; <!--/* it's length. These get freed once the user has changed */-->/* その長さ. これらはユーザが一度変更を加えると解放される */
704 <!--/* the character. Until then the preserve things like */-->/* 文字そのもの. その時まで他の方法で理解不能な */
705 <!--/* hint substitution which we wouldn't otherwise understand */-->/* ヒント置換を保存しておく */
706 } <A NAME="SplineChar">SplineChar</A>;
707 </PRE>
708 </BLOCKQUOTE>
709 <P>
710 <!--
711 Every character has a name (sometimes it is ".notdef" but it's there). A
712 location (encoding) in the current font, a unicode code point (which may
713 be -1 if not in unicode). Every character has a width. The next two fields
714 are only meaningful when loading or saving a font in the appropriate format.
715 lbearing is needed to handle seac commands, and the ttf_glyph is needed for
716 just about everything when writing a ttf font. The splines field gives all
717 the foreground paths (<A HREF="#SplinePointList">SplinePointLists</A>). Hints
718 for horizontal and vertical stems. A set of other characters referenced in
719 this one, again only in the foreground. Then a linked list of all
720 <A HREF="views.html#CharView">CharViews</A> displaying this SplineChar (if
721 this guy changes, all must be updated to reflect the change). A pointer to
722 the <A HREF="#SplineFont">SplineFont</A> that contains us. A set of bits:
723 changed means the character has changed since the last save to disk,
724 changedsincelasthhinted means that we need to run autohint on the horizontal
725 stems, changedsincelastvhinted for vertical stems. Manual hints means the
726 user has taken control of providing hints, and we should only run autohint
727 if explicitly asked to. Ticked is a temporary field usually to avoid infinite
728 loops of refered characters. changed_since_autosave indicates that the next
729 time we update our autosave database we should write this character to it.
730 Widthset means the user has changed the width. If we didn't have this bit
731 we might think that an em space had nothing in it (instead of having an em-space
732 in it). -->
733 すべての文字には名前があります (時には“.notdef”の場合もありますが、その値はここに格納されています)。現在のフォント内における位置 (エンコーディング)、Unicode のコードポイント (Unicode に存在しないことを表す値 -1 になることがあります) があります。各文字の幅は width に格納されます。その後ろの 2 個のフィールドはフォントを適切なフォーマットで読み込みまたは保存する時にのみ意味があります。lbearing は seac コマンドを扱うために必要で、ttf_glyph は TTF フォントを書き出す時にいろいろな用途で使用します。splines フィールドは、すべての前面パス (<A HREF="#SplinePointList">SplinePointLists</A>) を与えます。hints は水平ステムと垂直ステムです。この文字が参照している一連の文字、これも前面にあるもののみです。その次に来るのはこの SplineChar を表示しているすべての <A HREF="views.html#CharView">CharViews</A> のリンクトリストです (この文字が変更されたら、それらすべてが変更を反映して更新する必要があります)。この文字を含む <A HREF="#SplineFont">SplineFont</A>へのポインタがあります。以下の一連のビットがあります: changed は、最後にディスクへ保存を行って以降その文字が更新されたことを意味します。changedsincelasthhinted は、水平ヒントの自動ヒントづけを行わなければならないことを意味し、changedsincevhinted は垂直ヒントに対するものです。manualhints は、ユーザがヒントづけを自分で制御する選択をしたことを意味し、ユーザの明示的な指示がなければ自動ヒントを行ってはなりません。ticked は、参照された文字の無限ループを避けるための印づけです。changed_since_autosave は、次回自動セーブデータベースを更新する時、この文字をそこに含める必要があることを示します。widthset は、ユーザが幅を変更したことを意味します。このビットをセットしていない時、幅 em の空白には (文字 em スペースを示すのではなく) 何も含まれていないと考える必要があります。
734 <P>
735 <!--
736 If a SplineChar is refered to in another character, then when we change the
737 original we must also update anything that refers to it (if we change A,
738 we must also redisplay Agrave). -->
739 ある SplineChar が他の文字から参照されている場合、オリジナルを変更した時にはそれを参照しているすべての文字も更新しなければなりません (A を変更したら、Agrave も再表示する必要があります)。
740 <P>
741 <!--
742 Then backgroundsplines represent the SplinePointLists in the background layer,
743 and backimages represent the images in the background layers. -->
744 その次の backgroundsplines は、背面レイヤにある SplinePointLists を表し、backimages は背面レイヤにある画像を表します。
745 <P>
746 <!--
747 Undoes[0] contains undoes for the foreground and undoes[1] contains undoes
748 for the background. Same for redoes. -->
749 undoes[0] には前面のアンドゥを格納し、undoes[1] には背面のアンドゥを格納します。redoes も同様です。
750 <P>
751 <!--
752 Finally kerns provides a list of kerning data for any special characters
753 that follow this one. For instance the combination "VA" might need kerning,
754 then the SplineChar representing "V" would have a pointer to a
755 <A HREF="#KernPair">KernPair</A> with data on "A". -->
756 最後の kerns は、この文字に続くすべての特別扱いされる文字のカーニングデータのリストを提供します。例えば“VA”の組合せはカーニングを必要とするでしょう。その場合、“V”を表す SplineChar には、“A”に関するデータをもつ <A HREF="#KernPair">KernPair</A> へのポインタが含まれるはずです。
757 <BLOCKQUOTE>
758 <PRE>typedef struct splinefont {
759 char *fontname, *fullname, *familyname, *weight;
760 char *copyright;
761 char *filename;
762 char *version;
763 double italicangle, upos, uwidth;
764 int ascent, descent;
765 int charcnt;
766 <A HREF="#SplineChar">SplineChar</A> **chars;
767 unsigned int changed: 1;
768 unsigned int changed_since_autosave: 1;
769 unsigned int display_antialias: 1;
770 unsigned int dotlesswarn: 1; <!--/* User warned that font doesn't have a dotless i character */-->/* フォントに文字 dotless i が含まれていることをユーザに警告済 */
771 /*unsigned int wasbinary: 1;*/
772 <A HREF="views.html#FontView">struct fontview</A> *fv;
773 enum charset encoding_name;
774 <A HREF="#SplinePointList">SplinePointList</A> *gridsplines;
775 <A HREF="#Undoes">Undoes</A> *gundoes, *gredoes;
776 <A HREF="#BDFFont">BDFFont</A> *bitmaps;
777 char *origname; <!--/* filename of font file (ie. if not an sfd) */-->/* フォントファイルのファイル名 (つまり,SFDでない場合) */
778 char *autosavename;
779 int display_size;
780 } <A NAME="SplineFont">SplineFont</A>;
781 </PRE>
782 </BLOCKQUOTE>
783 <P>
784 <!--
785 The first four names are taken straight out of PostScript, as are copyright,
786 version, italicangle, underlinepos, underlineweight. Ascent and descent together
787 sum to make the em-square. Normally this will be 1000, but you can change
788 that if you want. -->
789 最初の 4 個の名前は PostScript のものをそのまま使用しており、copyright, version, italicangle, underlinepos, underlineweight も同様です。ascent と descent は、合計が em 正方形の大きさとなります。通常これは 1000 になりますが、必要なら変更可能です。
790 <P>
791 <!--
792 Charcnt says how big the chars array will be. There may be holes (ie. NULL
793 values) in the array. -->
794 charcnt は、chars 配列の大きさを表します。配列の途中に穴 (つまり、NULL 値) があっても構いません。
795 <P>
796 <!--
797 Changed indicates that some character, bitmap, metric, something has changed
798 since we last saved the file. changed_since_autosave means that something
799 has changed since autosave last happened (so we should actually process this
800 font the next time autosave rolls around). -->
801 changed は、ファイルを最後に保存して以降どれかの文字・ビットマップ・メトリック・何らかのデータが変更されたことを示します。changed_since_autosaves は、自動セーブが最後に行われてから何らかの変更があった (そのため、次回自動セーブが行われるとき、このフォントの処理を実際に行う必要がある) ことを意味します
802 <P>
803 <!--
804 Display_antialias means we are displaying an antialias bytemap font in the
805 <A HREF="views.html#FontView">FontView</A>, rather than a bitmap font. These
806 look better but are slower. -->
807 display_antialias は、<A HREF="views.html#FontView">FontView</A> でビットマップフォントではなく、アンチエイリアス表示のバイトマップフォントを表示していることを意味します。より美しい表示が可能ですが速度は低下します。
808 <P>
809 <!--
810 Dotlesswarn means that we've warned the user when s/he attempted to create
811 an accented character based on i or j and a dotless version of those characters
812 was not present in the font (there's no point in warning him again. The operation
813 proceeded with a dotted version). -->
814 dotlesswarn は、ユーザが i または j に基づくアクセントつき文字を作成し、それらの文字の点の無いバージョンがフォント内に含まれていないときに警告を行ったことを意味します (警告を再度行うことはありません。操作は点ありのバージョンに基づいて進められます)。
815 <P>
816 <!--
817 There is only one <A HREF="views.html#FontView">FontView</A> associated with
818 a font (other data structures allowed for multiple views, but the font does
819 not). -->
820 1 個のフォントに付随する <A HREF="views.html#FontView">FontView</A> は 1 個しか存在しません (他のデータ構造は複数のビューをもつことができますが、フォントは違います)。
821 <P>
822 <!--
823 The font has a characterset and an encoding. -->
824 フォントには文字集合とエンコーディングベクタが存在します。
825 <P>
826 <!--
827 Gridsplines contains the <A HREF="#SplinePointList">SplinePointLists</A>
828 for all the splines displayed as background grids for characters. And gundoes
829 and gredoes are the un/redoes associated with them. -->
830 gridsplines は、文字の背景グリッドとして表示されるすべてのスプラインの <A HREF="#SplinePointList">SplinePointLists</A> を表示します。また、gundoes および gredoes はそれらに関連づけられたアンドゥ/リドゥです。
831 <P>
832 <!--
833 Bitmaps contains all the bitmaps that have been generated for this SplineFont. -->
834 bitmaps は、この SplineFont のために生成されたすべてのビットマップを含みます。
835 <P>
836 <!--
837 Origname contains the name of the file we read in to get this one. Filename
838 above contains the name of an .sfd file associated with this font, but origname
839 can also contain random postscript or truetype fonts. -->
840 origname は、このフォントを得るために読み込んだファイルの名前を含んでいます。上の filename はこのフォントに関連づけられた .sfd ファイルの名前を含みますが、origname は任意の PostScript または TrueType のフォント名を含むことが可能です。
841 <P>
842 <!--
843 Autosavename indicates the name currently being used to save crash recovery
844 stuff to disk. -->
845 autosavename は、ディスクにクラッシュ回復情報を保存するのに用いる名前を表します。
846 <P>
847 <!--
848 Display_size indicates how big we'd like the FontView to display our font.-->
849 display_size は、フォントを FontView でどのくらいの大きさで表示するかを示します。
850 <H2>
851 <!--Function declarations-->
852 関数宣言
853 </H2>
854 <P>
855 <BLOCKQUOTE>
856 <PRE>struct fontdict; <!--/* the next four data structures are in psfont.h */-->/* 次の4個のデータ構造はpsfont.hにある */
857 struct chars;
858 struct findsel;
859 struct charprocs;
860 enum charset; <!--/* in charset.h */-->/* charset.hにある */
861
862 extern SplineFont *SplineFontFromPSFont(struct fontdict *fd);
863 extern bool SFIsFixedWidth(SplineFont *sf);
864 extern struct chars *SplineFont2Chrs(SplineFont *sf, int round);
865 enum fontformat { ff_pfa, ff_pfb, ff_ptype3, ff_ptype0, ff_ttf, ff_none };
866 extern int WritePSFont(char *fontname,SplineFont *sf,enum fontformat format);
867 extern int WriteTTFFont(char *fontname,SplineFont *sf);
868 int SFReencodeFont(SplineFont *sf,enum charset new_map);
869
870 extern int DoubleNear(double a,double b);
871 extern int DoubleNearish(double a,double b);
872
873 extern void LineListFree(LineList *ll);
874 extern void LinearApproxFree(LinearApprox *la);
875 extern void SplineFree(Spline *spline);
876 extern void SplinePointFree(SplinePoint *sp);
877 extern void SplinePointListFree(SplinePointList *spl);
878 extern void SplinePointListsFree(SplinePointList *head);
879 extern void RefCharFree(RefChar *ref);
880 extern void RefCharsFree(RefChar *ref);
881 extern void UndoesFree(Undoes *undo);
882 extern void HintsFree(Hints *h);
883 extern Hints *HintsCopy(Hints *h);
884 extern SplineChar *SplineCharCopy(SplineChar *sc);
885 extern BDFChar *BDFCharCopy(BDFChar *bc);
886 extern void ImageListsFree(ImageList *imgs);
887 extern void SplineCharFree(SplineChar *sc);
888 extern void SplineFontFree(SplineFont *sf);
889 extern void SplineRefigure(Spline *spline);
890 extern Spline *SplineMake(SplinePoint *from, SplinePoint *to);
891 extern LinearApprox *SplineApproximate(Spline *spline, double scale);
892 extern int SplinePointListIsClockwise(SplineSet *spl);
893 extern void SplineSetFindBounds(SplinePointList *spl, DBounds *bounds);
894 extern void SplineCharFindBounds(SplineChar *sc,DBounds *bounds);
895 extern void SplineFontFindBounds(SplineFont *sf,DBounds *bounds);
896 extern void SplinePointCategorize(SplinePoint *sp);
897 extern void SCCategorizePoints(SplineChar *sc);
898 extern SplinePointList *SplinePointListCopy(SplinePointList *base);
899 extern SplinePointList *SplinePointListCopySelected(SplinePointList *base);
900 extern SplinePointList *SplinePointListTransform(SplinePointList *base, double transform[6], int allpoints );
901 extern SplinePointList *SplinePointListShift(SplinePointList *base, double xoff, int allpoints );
902 extern SplinePointList *SplinePointListRemoveSelected(SplinePointList *base);
903 extern void SplinePointListSet(SplinePointList *tobase, SplinePointList *frombase);
904 extern void SplinePointListSelect(SplinePointList *spl,int sel);
905 extern void SCRefToSplines(SplineChar *sc,RefChar *rf);
906 extern void SCReinstanciateRefChar(SplineChar *sc,RefChar *rf);
907 extern void SCReinstanciateRef(SplineChar *sc,SplineChar *rsc);
908 extern void SCRemoveDependent(SplineChar *dependent,RefChar *rf);
909 extern void SCRemoveDependents(SplineChar *dependent);
910 extern RefChar *SCCanonicalRefs(SplineChar *sc, int isps);
911 extern void BCCompressBitmap(BDFChar *bdfc);
912 extern void BCRegularizeBitmap(BDFChar *bdfc);
913 extern void BCPasteInto(BDFChar *bc,BDFChar *rbc,int ixoff,int iyoff, int invert);
914 extern BDFChar *SplineCharRasterize(SplineChar *sc, int pixelsize);
915 extern BDFFont *SplineFontRasterize(SplineFont *sf, int pixelsize);
916 extern BDFChar *SplineCharAntiAlias(SplineChar *sc, int pixelsize,int linear_scale);
917 extern BDFFont *SplineFontAntiAlias(SplineFont *sf, int pixelsize,int linear_scale);
918 extern void BDFCharFree(BDFChar *bdfc);
919 extern void BDFFontFree(BDFFont *bdf);
920 extern void BDFFontDump(char *filename,BDFFont *font, char *encodingname);
921 extern double SplineSolve(Spline1D *sp, double tmin, double tmax, double sought_y, double err);
922 extern void SplineFindInflections(Spline1D *sp, double *_t1, double *_t2 );
923 extern int NearSpline(struct findsel *fs, Spline *spline);
924 extern double SplineNearPoint(Spline *spline, BasePoint *bp, double fudge);
925 extern void SCMakeDependent(SplineChar *dependent,SplineChar *base);
926 extern SplinePoint *SplineBisect(Spline *spline, double t);
927 extern Spline *ApproximateSplineFromPoints(SplinePoint *from, SplinePoint *to,
928 TPoint *mid, int cnt);
929 extern int SplineIsLinear(Spline *spline);
930 extern int SplineInSplineSet(Spline *spline, SplineSet *spl);
931 extern void SplineCharMerge(SplineSet **head);
932 extern void SplineCharSimplify(SplineSet *head);
933 extern void SplineCharRemoveTiny(SplineSet *head);
934 extern SplineFont *SplineFontNew(void);
935 extern SplineFont *SplineFontBlank(int enc,int charcnt);
936 extern SplineSet *SplineSetReverse(SplineSet *spl);
937 extern SplineSet *SplineSetsExtractOpen(SplineSet **tbase);
938 extern SplineSet *SplineSetsCorrect(SplineSet *base);
939 extern void SPAverageCps(SplinePoint *sp);
940 extern void SplineCharDefaultPrevCP(SplinePoint *base, SplinePoint *prev);
941 extern void SplineCharDefaultNextCP(SplinePoint *base, SplinePoint *next);
942 extern void SplineCharTangentNextCP(SplinePoint *sp);
943 extern void SplineCharTangentPrevCP(SplinePoint *sp);
944 extern int PointListIsSelected(SplinePointList *spl);
945 extern void SplineSetsUntick(SplineSet *spl);
946 extern void SFOrderBitmapList(SplineFont *sf);
947
948 extern SplineSet *SplineSetStroke(SplineSet *spl,StrokeInfo *si);
949 extern SplineSet *SplineSetRemoveOverlap(SplineSet *base);
950
951 extern void FindBlues( SplineFont *sf, double blues[14], double otherblues[10]);
952 extern void FindHStems( SplineFont *sf, double snaps[12], double cnt[12]);
953 extern void FindVStems( SplineFont *sf, double snaps[12], double cnt[12]);
954 extern void SplineCharAutoHint( SplineChar *sc);
955 extern void SplineFontAutoHint( SplineFont *sf);
956 extern int AfmSplineFont(FILE *afm, SplineFont *sf,int type0);
957 extern char *EncodingName(int map);
958
959 extern int SFDWrite(char *filename,SplineFont *sf);
960 extern int SFDWriteBak(SplineFont *sf);
961 extern SplineFont *SFDRead(char *filename);
962 extern SplineFont *SFReadTTF(char *filename);
963 extern SplineFont *LoadSplineFont(char *filename);
964 extern SplineFont *ReadSplineFont(char *filename); <!--/* Don't use this, use LoadSF instead */-->/* 使用不可. 代わりにLoadSFを使うこと */
965
966 extern SplineChar *SCBuildDummy(SplineChar *dummy,SplineFont *sf,int i);
967 extern SplineChar *SFMakeChar(SplineFont *sf,int i);
968 extern BDFChar *BDFMakeChar(BDFFont *bdf,int i);
969
970 extern void SCUndoSetLBearingChange(SplineChar *sc,int lb);
971 extern Undoes *SCPreserveState(SplineChar *sc);
972 extern Undoes *SCPreserveWidth(SplineChar *sc);
973 extern Undoes *BCPreserveState(BDFChar *bc);
974 extern void BCDoRedo(BDFChar *bc,struct fontview *fv);
975 extern void BCDoUndo(BDFChar *bc,struct fontview *fv);
976
977 extern int SFIsCompositBuildable(SplineFont *sf,int unicodeenc);
978 extern void SCBuildComposit(SplineFont *sf, SplineChar *sc, int copybmp,
979 struct fontview *fv);
980
981 extern void BDFFontDump(char *filename,BDFFont *font, char *encodingname);
982 extern int getAdobeEnc(char *name);
983
984 extern SplinePointList *SplinePointListInterpretPS(FILE *ps);
985 extern void PSFontInterpretPS(FILE *ps,struct charprocs *cp);
986
987 extern int SFFindChar(SplineFont *sf, int unienc, char *name );
988
989 extern char *getFontForgeDir(char *buffer);
990 extern void DoAutoSaves(void);
991 extern int DoAutoRecovery(void);
992 extern SplineFont *SFRecoverFile(char *autosavename);
993 extern void SFAutoSave(SplineFont *sf);
994 extern void SFClearAutoSave(SplineFont *sf);
995 #endif
996 </PRE>
997 </BLOCKQUOTE>
998 </DIV>
999 </BODY></HTML>