| 1 | <HTML> |
| 2 | <HEAD> |
| 3 | <!-- Created with AOLpress/2.0 --> |
| 4 | <!-- AP: Created on: 3-Feb-2002 --> |
| 5 | <!-- AP: Last modified: 16-Apr-2004 --> |
| 6 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> |
| 7 | <LINK REL="icon" href="../../_static/fftype16.png"> |
| 8 | <!--<TITLE>Format for X11 pcf bitmap font files</TITLE>--> |
| 9 | <TITLE>X11 の PCF ビットマップフォントファイルのフォーマット</TITLE> |
| 10 | <LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css"> |
| 11 | </HEAD> |
| 12 | <BODY> |
| 13 | <DIV id="in"> |
| 14 | <H1 ALIGN=Center> |
| 15 | <!--Format for X11 pcf bitmap font files --> |
| 16 | X11 の PCF ビットマップフォントファイルのフォーマット |
| 17 | </H1> |
| 18 | <P> |
| 19 | <!-- |
| 20 | This file is based on the |
| 21 | <A HREF="http://ftp.x.org/pub/R6.4/xc/lib/font/bitmap/">X11 sources</A>. |
| 22 | If something here disagrees with what is found in the sources, my statement |
| 23 | is incorrect. The sources are definitive. --> |
| 24 | このファイルは<A HREF="http://ftp.x.org/pub/R6.4/xc/lib/font/bitmap/"> X11 のソース</A>に基づいています。ソースに書かれている内容と何らかの食い違いがあれば、私の記述が間違っています。ソースが定義です。 |
| 25 | <P> |
| 26 | <!-- |
| 27 | The pcf (portable compiled format) file format is a binary representation |
| 28 | of a bitmap font used by the XServer. It consists of a file header followed |
| 29 | by a series of tables, with the header containing pointers to all the tables. --> |
| 30 | PCF (portable compile format) ファイルフォーマットは X サーバが使用するビットマップフォントの倍なり表現です。ファイルヘッダに続き一連のテーブルと、すべてのテーブルにへのポインタを含むヘッダが続きます。 |
| 31 | <H2> |
| 32 | <!--File Header--> |
| 33 | ファイルヘッダ |
| 34 | </H2> |
| 35 | <P> |
| 36 | <!-- |
| 37 | The file header contains 32 bit integers stored with the least significant |
| 38 | byte first. --> |
| 39 | ファイルヘッダは最下位バイトを先頭置いた 32 ビットの整数値の並びからなります。 |
| 40 | <!-- |
| 41 | <BLOCKQUOTE> |
| 42 | <PRE>char header[4]; /* always "\1fcp" */ |
| 43 | lsbint32 table_count; |
| 44 | struct toc_entry { |
| 45 | lsbint32 type; /* See below, indicates which table */ |
| 46 | lsbint32 format; /* See below, indicates how the data are formatted in the table */ |
| 47 | lsbint32 size; /* In bytes */ |
| 48 | lsbint32 offset; /* from start of file */ |
| 49 | } tables[table_count]; |
| 50 | </PRE> |
| 51 | </BLOCKQUOTE> --> |
| 52 | <BLOCKQUOTE> |
| 53 | <PRE>char header[4]; /* 常に "\1fcp" */ |
| 54 | lsbint32 table_count; |
| 55 | struct toc_entry { |
| 56 | lsbint32 type; /* 下記参照, どのテーブルかを指定 */ |
| 57 | lsbint32 format; /* 下記参照, データがテーブル内にどんなフォーマットで格納されるかを指定 */ |
| 58 | lsbint32 size; /* バイト数 */ |
| 59 | lsbint32 offset; /* ファイルの先頭から */ |
| 60 | } tables[table_count]; |
| 61 | </PRE> |
| 62 | </BLOCKQUOTE> |
| 63 | <P> |
| 64 | <!-- |
| 65 | The type field may be one of: --> |
| 66 | type フィールドは以下のどれか 1 つです: |
| 67 | <BLOCKQUOTE> |
| 68 | <PRE>#define PCF_PROPERTIES (1<<0) |
| 69 | #define PCF_ACCELERATORS (1<<1) |
| 70 | #define PCF_METRICS (1<<2) |
| 71 | #define PCF_BITMAPS (1<<3) |
| 72 | #define PCF_INK_METRICS (1<<4) |
| 73 | #define PCF_BDF_ENCODINGS (1<<5) |
| 74 | #define PCF_SWIDTHS (1<<6) |
| 75 | #define PCF_GLYPH_NAMES (1<<7) |
| 76 | #define PCF_BDF_ACCELERATORS (1<<8) |
| 77 | </PRE> |
| 78 | </BLOCKQUOTE> |
| 79 | <P> |
| 80 | <!-- |
| 81 | The format field may be one of: --> |
| 82 | format フィールドは以下のどれか 1 つです: |
| 83 | <BLOCKQUOTE> |
| 84 | <PRE>#define PCF_DEFAULT_FORMAT 0x00000000 |
| 85 | #define PCF_INKBOUNDS 0x00000200 |
| 86 | #define PCF_ACCEL_W_INKBOUNDS 0x00000100 |
| 87 | #define PCF_COMPRESSED_METRICS 0x00000100 |
| 88 | </PRE> |
| 89 | </BLOCKQUOTE> |
| 90 | <P> |
| 91 | <!-- |
| 92 | The format field may be modified by: --> |
| 93 | format フィールドは以下のフラグで修飾可能です: |
| 94 | <!-- |
| 95 | <BLOCKQUOTE> |
| 96 | <PRE>#define PCF_GLYPH_PAD_MASK (3<<0) /* See the bitmap table for explanation */ |
| 97 | #define PCF_BYTE_MASK (1<<2) /* If set then Most Sig Byte First */ |
| 98 | #define PCF_BIT_MASK (1<<3) /* If set then Most Sig Bit First */ |
| 99 | #define PCF_SCAN_UNIT_MASK (3<<4) /* See the bitmap table for explanation */ |
| 100 | </PRE> |
| 101 | </BLOCKQUOTE> --> |
| 102 | <BLOCKQUOTE> |
| 103 | <PRE>#define PCF_GLYPH_PAD_MASK (3<<0) /* 説明はビットマップテーブルの項を参照 */ |
| 104 | #define PCF_BYTE_MASK (1<<2) /* 上位バイトが先か */ |
| 105 | #define PCF_BIT_MASK (1<<3) /* 上位ビットが先か */ |
| 106 | #define PCF_SCAN_UNIT_MASK (3<<4) /* 説明はビットマップテーブルの項を参照 */ |
| 107 | </PRE> |
| 108 | </BLOCKQUOTE> |
| 109 | <P> |
| 110 | <!-- |
| 111 | The format will be repeated as the first word in each table. Most tables |
| 112 | only have one format (default), but some have alternates. The high order |
| 113 | three bytes of the format describe the gross format. The way integers and |
| 114 | bits are stored can be altered by adding one of the mask bits above. --> |
| 115 | format フィールドは、各テーブルの最初のワードとして繰り返されます。ほとんどのテーブルは 1 種類のフォーマット (デフォルト) しか含んでいませんが、フォントによっては異なるフォーマットを使用しています。format の上位の 3 バイトが、全体のフォーマットを記述します。整数とビットが格納される方式は、上のマスクビットの 1 つを加えることによって変更することができます。 |
| 116 | <P> |
| 117 | <!-- |
| 118 | All tables begin on a 32bit boundary (and will be padded with zeroes). --> |
| 119 | すべてのテーブルは 32 ビット境界から始まります (端数は 0 でパディングされます)。 |
| 120 | <H2> |
| 121 | <!--Properties Table--> |
| 122 | 属性テーブル |
| 123 | </H2> |
| 124 | <!-- |
| 125 | <BLOCKQUOTE> |
| 126 | <PRE>lsbint32 format; /* Always stored with least significant byte first! */ |
| 127 | int32 nprops; /* Stored in whatever byte order is specified in the format */ |
| 128 | struct props { |
| 129 | int32 name_offset; /* Offset into the following string table */ |
| 130 | int8 isStringProp; |
| 131 | int32 value; /* The value for integer props, the offset for string props */ |
| 132 | } props[nprops]; |
| 133 | char padding[(nprops&3)==0?0:(4-(nprops&3))]; /* pad to next int32 boundary */ |
| 134 | int string_size; /* total size of all strings (including their terminating NULs) */ |
| 135 | char strings[string_size]; |
| 136 | char padding2[]; |
| 137 | </PRE> |
| 138 | </BLOCKQUOTE> --> |
| 139 | <BLOCKQUOTE> |
| 140 | <PRE>lsbint32 format; /* 常に最下位ビットが最初に格納される! */ |
| 141 | int32 nprops; /* format で指定されたバイトオーダで格納される */ |
| 142 | struct props { |
| 143 | int32 name_offset; /* 以下の文字列テーブルへのオフセット */ |
| 144 | int8 isStringProp; |
| 145 | int32 value; /* 整数属性の即値, 文字列属性のオフセット */ |
| 146 | } props[nprops]; |
| 147 | char padding[(nprops&3)==0?0:(4-(nprops&3))]; /* 次の int32 境界まで埋める */ |
| 148 | int string_size; /* 文字列の総サイズ (末尾の NUL を含む) */ |
| 149 | char strings[string_size]; |
| 150 | char padding2[]; |
| 151 | </PRE> |
| 152 | </BLOCKQUOTE> |
| 153 | <P> |
| 154 | <!-- |
| 155 | These properties are the Font Atoms that X provides to users. Many are described |
| 156 | in |
| 157 | <A HREF="http://ftp.x.org/pub/R6.4/xc/doc/specs/XLFD/xlfd.tbl.ms">xc/doc/specs/XLFD/xlfd.tbl.ms</A> |
| 158 | or |
| 159 | <A HREF="http://rpmfind.net/linux/RPM/redhat/6.2/i386/XFree86-doc-3.3.6-20.i386.html">here</A> |
| 160 | (the X protocol does not limit these atoms so others could be defined for |
| 161 | some fonts). --> |
| 162 | これらの属性は、X がユーザに提供するフォントアトムです。これらの多くは <A HREF="http://ftp.x.org/pub/R6.4/xc/doc/specs/XLFD/xlfd.tbl.ms">xc/doc/specs/XLFD/xlfd.tbl.ms</A> または<A HREF="http://rpmfind.net/linux/RPM/redhat/6.2/i386/XFree86-doc-3.3.6-20.i386.html">この文書</A>で解説されています。 (X プロトコルはこれらのアトムに制限を加えていないので、第三者が何らかのフォントの定義を行うことができます) |
| 163 | <P> |
| 164 | <!-- |
| 165 | To find the name of a property: <CODE>strings + props[i].name_offset</CODE> --> |
| 166 | 属性の名前は、<CODE>strings + props[i].name_offset</CODE> に書かれています。 |
| 167 | <H2> |
| 168 | <!--<A NAME="MetricsData">Metrics Data</A>--> |
| 169 | <A NAME="MetricsData">メトリックのデータ</A> |
| 170 | </H2> |
| 171 | <P> |
| 172 | <!-- |
| 173 | Several of the tables (PCF_METRICS, PCF_INK_METRICS, and within the accelerator |
| 174 | tables) contain metrics data which may be in either compressed |
| 175 | (PCF_COMPRESSED_METRICS) or uncompressed (DEFAULT) formats. The compressed |
| 176 | format uses bytes to contain values, while the uncompressed uses shorts. |
| 177 | The (compressed) bytes are unsigned bytes which are offset by 0x80 (so the |
| 178 | actual value will be <CODE>(getc(pcf_file)-0x80)</CODE>. The data are stored |
| 179 | as:<BR> --> |
| 180 | いくつかのテーブル (PCF_METRICS, PCF_INK_METRICS およびアクセラレータテーブルの内部) には、圧縮フォーマット (PCF_COMPRESSED_METRICS) または非圧縮フォーマット (DEFAULT) のどちらかでメトリックデータが格納されています。圧縮フォーマットは、値を格納するのに byte 型を使用するのに対し、非圧縮フォーマットは short 型を使用します。(圧縮された) バイト値は符号なし byte 値で、0x80 のオフセットが加えられています (よって、実際の値は <CODE>(getc(pcf_file)-0x80)</CODE> になります)。データは以下のように格納されています:<BR> |
| 181 | <!--Compressed--> |
| 182 | 圧縮フォーマット |
| 183 | <!-- |
| 184 | <BLOCKQUOTE> |
| 185 | <PRE>uint8 left_sided_bearing; |
| 186 | uint8 right_side_bearing; |
| 187 | uint8 character_width; |
| 188 | uint8 character_ascent; |
| 189 | uint8 character_descent; |
| 190 | /* Implied character attributes field = 0 */ |
| 191 | </PRE> |
| 192 | </BLOCKQUOTE> --> |
| 193 | <BLOCKQUOTE> |
| 194 | <PRE>uint8 left_sided_bearing; |
| 195 | uint8 right_side_bearing; |
| 196 | uint8 character_width; |
| 197 | uint8 character_ascent; |
| 198 | uint8 character_descent; |
| 199 | /* 暗黙の文字属性フィールド = 0 */ |
| 200 | </PRE> |
| 201 | </BLOCKQUOTE> |
| 202 | <P> |
| 203 | <!-- Uncompressed --> |
| 204 | 非圧縮フォーマット: |
| 205 | <BLOCKQUOTE> |
| 206 | <PRE>int16 left_sided_bearing; |
| 207 | int16 right_side_bearing; |
| 208 | int16 character_width; |
| 209 | int16 character_ascent; |
| 210 | int16 character_descent; |
| 211 | uint16 character_attributes; |
| 212 | </PRE> |
| 213 | </BLOCKQUOTE> |
| 214 | <P> |
| 215 | <!-- |
| 216 | This provides the data needed for an XCharStruct. --> |
| 217 | これは、XCharStruct で必要とされるデータを提供します。 |
| 218 | <H2> |
| 219 | <!--Accelerator Tables--> |
| 220 | アクセラレータテーブル |
| 221 | </H2> |
| 222 | <P> |
| 223 | <!-- |
| 224 | These data provide various bits of information about the font as a whole. |
| 225 | This data structure is used by two tables PCF_ACCELERATORS and |
| 226 | PCF_BDF_ACCELERATORS. The tables may either be in DEFAULT format or in |
| 227 | PCF_ACCEL_W_INKBOUNDS (in which case they will have some extra metrics data |
| 228 | at the end. --> |
| 229 | これらのデータは、フォントの全体に関わる多数の細々とした情報を提供します。個のデータ構造は PCF_ACCELERATORS と PCF_BDF_ACCELERATORS の 2 個のテーブルで使用されます。テーブルは DEFAULT か PCF_ACCEL_W_INKBOUNDS のいずれかのフォーマットを使用することができます (後者の場合、最後にいくつかの拡張メトリックデータが追加されます)。 |
| 230 | <P> |
| 231 | <!-- |
| 232 | The accelerator tables look like: --> |
| 233 | アクセラレータテーブルは以下のような形をしています: |
| 234 | <!-- |
| 235 | <BLOCKQUOTE> |
| 236 | <PRE>lsbint32 format; /* Always stored with least significant byte first! */ |
| 237 | uint8 noOverlap; /* if for all i, max(metrics[i].rightSideBearing - metrics[i].characterWidth) */ |
| 238 | /* <= minbounds.leftSideBearing */ |
| 239 | uint8 constantMetrics; /* Means the perchar field of the XFontStruct can be NULL */ |
| 240 | uint8 terminalFont; /* constantMetrics true and forall characters: */ |
| 241 | /* the left side bearing==0 */ |
| 242 | /* the right side bearing== the character's width */ |
| 243 | /* the character's ascent==the font's ascent */ |
| 244 | /* the character's descent==the font's descent */ |
| 245 | uint8 constantWidth; /* monospace font like courier */ |
| 246 | uint8 inkInside; /* Means that all inked bits are within the rectangle with x between [0,charwidth] */ |
| 247 | /* and y between [-descent,ascent]. So no ink overlaps another char when drawing */ |
| 248 | uint8 inkMetrics; /* true if the ink metrics differ from the metrics somewhere */ |
| 249 | uint8 drawDirection; /* 0=>left to right, 1=>right to left */ |
| 250 | uint8 padding; |
| 251 | int32 fontAscent; /* byte order as specified in format */ |
| 252 | int32 fontDescent; |
| 253 | int32 maxOverlap; /* ??? */ |
| 254 | Uncompressed_Metrics minbounds; |
| 255 | Uncompressed_Metrics maxbounds; |
| 256 | /* If format is PCF_ACCEL_W_INKBOUNDS then include the following fields */ |
| 257 | Uncompressed_Metrics ink_minbounds; |
| 258 | Uncompressed_Metrics ink_maxbounds; |
| 259 | /* Otherwise those fields are not in the file and should be filled by duplicating min/maxbounds above */ |
| 260 | </PRE> |
| 261 | </BLOCKQUOTE> |
| 262 | <BLOCKQUOTE> |
| 263 | <PRE>lsbint32 format; /* 常に下位ビットが先頭に格納される! */ |
| 264 | uint8 noOverlap; /* 全てのiに対し, max(metrics[i].rightSideBearing - metrics[i].characterWidth) が成り立つか */ |
| 265 | /* <= minbounds.leftSideBearing */ |
| 266 | uint8 constantMetrics; /* XFontStruct の perchar フィールドが NULL になることを許すか */ |
| 267 | uint8 terminalFont; /* constantMetrics が真で, 全ての文字で以下が成り立つ: */ |
| 268 | /* 左サイドベアリング==0 */ |
| 269 | /* 右サイドベアリング== 文字の幅 */ |
| 270 | /* 文字の高さ==フォントの高さ */ |
| 271 | /* 文字の深さ==フォントの深さ */ |
| 272 | uint8 constantWidth; /* courier のような単一幅フォント */ |
| 273 | uint8 inkInside; /* 塗り潰される全ビットが [0,charwidth] 内の x 座標と */ |
| 274 | /* [-descent,ascent] 内の y 座標からなる矩形に含まれることを意味する。そのため、描画時に塗り潰す領域が重なり合うことはない */ |
| 275 | uint8 inkMetrics; /* どこか他の所のメトリックと、塗り潰し領域のメトリックに違いがあれば真 */ |
| 276 | uint8 drawDirection; /* 0=>左から右, 1=>右から左 */ |
| 277 | uint8 padding; |
| 278 | int32 fontAscent; /* format で指定されたバイトオーダで */ |
| 279 | int32 fontDescent; |
| 280 | int32 maxOverlap; /* ??? */ |
| 281 | Uncompressed_Metrics minbounds; |
| 282 | Uncompressed_Metrics maxbounds; |
| 283 | /* フォーマットが PCF_ACCEL_W_INKBOUNDS なら、以下のフィールドを含む: */ |
| 284 | Uncompressed_Metrics ink_minbounds; |
| 285 | Uncompressed_Metrics ink_maxbounds; |
| 286 | /* それ以外の場合、これらのフィールドはファイルに存在せず、上記の min/maxbound を繰り返して場所を埋めるべきである */ |
| 287 | </PRE> |
| 288 | </BLOCKQUOTE> |
| 289 | <P> |
| 290 | <!-- |
| 291 | BDF Accelerators should be preferred to plain Accelerators if both tables |
| 292 | are present. BDF Accelerators contain data that refers only to the encoded |
| 293 | characters in the font (while the simple Accelerator table includes all glyphs), |
| 294 | therefore the BDF Accelerators are more accurate. --> |
| 295 | 両方のテーブルが存在する場合、BDF アクセラレータのほうが標準アクセラレータよりも優先されます。BDF アクセラレータはフォント内の符号化された文字を参照するデータのみを含みます (それに対し、単純アクセラレータテーブルは全てのグリフを含むので、BDF アクセラレータの方がより正確なのです)。 |
| 296 | <H2> |
| 297 | <!--Metrics Tables--> |
| 298 | メトリックテーブル |
| 299 | </H2> |
| 300 | <P> |
| 301 | <!-- |
| 302 | There are two different metrics tables, PCF_METRICS and PCF_INK_METRICS, |
| 303 | the former contains the size of the stored bitmaps, while the latter contains |
| 304 | the minimum bounding box. The two may contain the same data, but many CJK |
| 305 | fonts pad the bitmaps so all bitmaps are the same size. The table format |
| 306 | may be either DEFAULT or PCF_COMPRESSED_METRICS (see the section on |
| 307 | <A HREF="#MetricsData">Metrics Data</A> for an explanation). --> |
| 308 | メトリックテーブルには PCF_METRICS と PCF_INK_METRICS の異なる 2 種類のテーブルが存在します。前者には、格納されたビットマップのサイズを含んでいるのに対し、後者は最小バウンディングボックスを含みます。両者は同じデータを含むことができますが、多くの CJK フォントはビットマップにパディングをしているため、すべてのビットマップは同じサイズです。テーブルフォーマットは DEFAULT または PCF_CONPRESSED_METRICS のどちらかが使用可能です (これの説明は、<A HREF="#MetricsData">メトリックデータ</A> に関するセクションを参照してください)。 |
| 309 | <!-- |
| 310 | <BLOCKQUOTE> |
| 311 | <PRE>lsbint32 format; /* Always stored with least significant byte first! */ |
| 312 | /* if the format is compressed */ |
| 313 | int16 metrics_count; |
| 314 | Compressed_Metrics metrics[metrics_count]; |
| 315 | /* else if format is default (uncompressed) */ |
| 316 | int32 metrics_count; |
| 317 | Uncompressed_Metrics metrics[metrics_count]; |
| 318 | /* endif */ |
| 319 | </PRE> |
| 320 | </BLOCKQUOTE> --> |
| 321 | <BLOCKQUOTE> |
| 322 | <PRE>lsbint32 format; /* 常に最下位ビットが最初に格納される! */ |
| 323 | /* フォーマットが compressed の場合 */ |
| 324 | int16 metrics_count; |
| 325 | Compressed_Metrics metrics[metrics_count]; |
| 326 | /* それ以外で、フォーマットがデフォルト (uncompressed) の場合 */ |
| 327 | int32 metrics_count; |
| 328 | Uncompressed_Metrics metrics[metrics_count]; |
| 329 | /* endif */ |
| 330 | </PRE> |
| 331 | </BLOCKQUOTE> |
| 332 | <H2> |
| 333 | <!--The Bitmap Table--> |
| 334 | ビットマップテーブル |
| 335 | </H2> |
| 336 | <P> |
| 337 | <!-- |
| 338 | The bitmap table has type PCF_BITMAPS. Its format must be PCF_DEFAULT. --> |
| 339 | ビットマップテーブルのタイプは PCF_BITMAPS です。フォーマットは PCF_DEFAULT でなければなりません。 |
| 340 | <!-- |
| 341 | <BLOCKQUOTE> |
| 342 | <PRE>lsbint32 format; /* Always stored with least significant byte first! */ |
| 343 | int32 glyph_count; /* byte ordering depends on format, should be the same as the metrics count */ |
| 344 | int32 offsets[glyph_count]; /* byte offsets to bitmap data */ |
| 345 | int32 bitmapSizes[4]; /* the size the bitmap data will take up depending on various padding options */ |
| 346 | /* which one is actually used in the file is given by (format&3) */ |
| 347 | char bitmap_data[bitmapsizes[format&3]]; /* the bitmap data. format contains flags that indicate: */ |
| 348 | /* the byte order (format&4 => LSByte first)*/ |
| 349 | /* the bit order (format&8 => LSBit first) */ |
| 350 | /* how each row in each glyph's bitmap is padded (format&3) */ |
| 351 | /* 0=>bytes, 1=>shorts, 2=>ints */ |
| 352 | /* what the bits are stored in (bytes, shorts, ints) (format>>4)&3 */ |
| 353 | /* 0=>bytes, 1=>shorts, 2=>ints */ |
| 354 | |
| 355 | </PRE> |
| 356 | </BLOCKQUOTE> --> |
| 357 | <BLOCKQUOTE> |
| 358 | <PRE>lsbint32 format; /* 常に最下位ビットが最初に格納される! */ |
| 359 | int32 glyph_count; /* バイトオーダは format に依存する。メトリックの個数と同じになるべき */ |
| 360 | int32 offsets[glyph_count]; /* ビットマップデータへのバイトオフセット */ |
| 361 | int32 bitmapSizes[4]; /* 各種パディングオプションに依存するビットマップデータのサイズ */ |
| 362 | /* どのオプションが使われているかは (format&3) で指定している */ |
| 363 | char bitmap_data[bitmapsizes[format&3]]; /* ビットマップデータ。format は以下のフラグを含む: */ |
| 364 | /* バイトオーダ (format&4 => 最上位バイトが先頭)*/ |
| 365 | /* ビットオーダ (format&8 => 最上位ビットが先頭) */ |
| 366 | /* 各グリフのビットマップの各列をどうパディングするか (format&3) */ |
| 367 | /* 0=>byte毎, 1=>short毎, 2=>int毎 */ |
| 368 | /* ビットが (byte, short, int の)どの単位で格納されるか (format>>4)&3 */ |
| 369 | /* 0=>byte単位, 1=>short単位, 2=>int単位 */ |
| 370 | </PRE> |
| 371 | </BLOCKQUOTE> |
| 372 | <H2> |
| 373 | <!--The Encoding Table--> |
| 374 | エンコーディングテーブル |
| 375 | </H2> |
| 376 | <P> |
| 377 | <!-- |
| 378 | The encoding table has type PCF_BDF_ENCODINGS. Its format must be PCF_DEFAULT. --> |
| 379 | エンコーディングテーブルは PCF_BDF_ENCODINGS 型です。フォーマットは PCF_DEFAULT でなければなりません。 |
| 380 | <!-- |
| 381 | <BLOCKQUOTE> |
| 382 | <PRE>lsbint32 format; /* Always stored with least significant byte first! */ |
| 383 | int16 min_char_or_byte2; /* As in XFontStruct */ |
| 384 | int16 max_char_or_byte2; /* As in XFontStruct */ |
| 385 | int16 min_byte1; /* As in XFontStruct */ |
| 386 | int16 max_byte1; /* As in XFontStruct */ |
| 387 | int16 default_char; /* As in XFontStruct */ |
| 388 | int16 glyphindeces[(max_char_or_byte2-min_char_or_byte2+1)*(max_byte1-min_byte1+1)]; |
| 389 | /* Gives the glyph index that corresponds to each encoding value */ |
| 390 | /* a value of 0xffff means no glyph for that encoding */ |
| 391 | </PRE> |
| 392 | </BLOCKQUOTE>--> |
| 393 | <BLOCKQUOTE> |
| 394 | <PRE>lsbint32 format; /* 常に最下位ビットが最初に格納される! */ |
| 395 | int16 min_char_or_byte2; /* XFontStruct のとおり */ |
| 396 | int16 max_char_or_byte2; /* XFontStruct のとおり */ |
| 397 | int16 min_byte1; /* XFontStruct のとおり */ |
| 398 | int16 max_byte1; /* XFontStruct のとおり */ |
| 399 | int16 default_char; /* XFontStruct のとおり */ |
| 400 | int16 glyphindeces[(max_char_or_byte2-min_char_or_byte2+1)*(max_byte1-min_byte1+1)]; |
| 401 | /* 各符号位置に対応するグリフインデックス */ |
| 402 | /* 値 0xffff は、その符号位置にグリフが存在しないことを表す */ |
| 403 | </PRE> |
| 404 | </BLOCKQUOTE> |
| 405 | <P> |
| 406 | <!-- |
| 407 | For single byte encodings min_byte1==max_byte1==0, and encoded values are |
| 408 | between [min_char_or_byte2,max_char_or_byte2]. The glyph index corresponding |
| 409 | to an encoding is glyphindex[encoding-min_char_or_byte2]. --> |
| 410 | 1 バイトエンコーディングでは min_byte1==max_byte1==0 であり、符号位置の値は [min_char_or_byte2,max_char_or_byte2] の範囲に収まります。ある符号位置が値 encoding であるとき、対応するグリフインデックスは glyphindex[encoding-min_char_or_byte2] になります。 |
| 411 | <P> |
| 412 | <!-- |
| 413 | Otherwise [min_byte1,max_byte1] specifies the range allowed for the first |
| 414 | (high order) byte of a two byte encoding, while |
| 415 | [min_char_or_byte2,max_char_or_byte2] is the range of the second byte. The |
| 416 | glyph index corresponding to a double byte encoding (enc1,enc2) is |
| 417 | glyph_index[(enc1-min_byte1)*(max_char_or_byte2-min_char_or_byte2+1)+ |
| 418 | enc2-min_char_or_byte2]. --> |
| 419 | それ以外の場合、[min_byte1,max_byte1] は、2 バイトエンコーディングの 1 バイト目 (上位バイト) の取ることのできる値の範囲を指定し、一方 [min_char_or_byte2,max_char_or_byte2] が 2 バイト目の範囲を指定します。2 バイトエンコーディング (enc1, enc2) に対応するグリフインデックスは、glyph_index[(enc1-min_byte1)*(max_char_or_byte2-min_char_or_byte2+1)+enc2-min_char_or_byte2] になります。 |
| 420 | <P> |
| 421 | <!-- |
| 422 | Not all glyphs need to be encoded. Not all encodings need to be associated |
| 423 | with glyphs. --> |
| 424 | すべてのグリフに文字符号を割り当てる必要はありません。すべての符号位置にグリフを割り当てる必要はありません。 |
| 425 | <H2> |
| 426 | <!--The Scalable Widths Table--> |
| 427 | スケーラブルな幅のテーブル |
| 428 | </H2> |
| 429 | <P> |
| 430 | <!-- |
| 431 | The encoding table has type PCF_SWIDTHS. Its format must be PCF_DEFAULT. --> |
| 432 | スケーラブルな幅のテーブルは PCF_SWIDTH です。フォーマットは PCF_DEFAULT でなければなりません。 |
| 433 | <!-- |
| 434 | <BLOCKQUOTE> |
| 435 | <PRE>lsbint32 format; /* Always stored with least significant byte first! */ |
| 436 | int32 glyph_count; /* byte ordering depends on format, should be the same as the metrics count */ |
| 437 | int32 swidths[glyph_count]; /* byte offsets to bitmap data */ |
| 438 | </PRE> |
| 439 | </BLOCKQUOTE> --> |
| 440 | <BLOCKQUOTE> |
| 441 | <PRE>lsbint32 format; /* 常に最下位ビットが最初に格納される! */ |
| 442 | int32 glyph_count; /* バイトオーダは format に依存する。メトリックの個数と同じになるべき */ |
| 443 | int32 swidths[glyph_count]; /* ビットマップデータへのバイトオフセット */ |
| 444 | </PRE> |
| 445 | </BLOCKQUOTE> |
| 446 | <P> |
| 447 | <!-- |
| 448 | The scalable width of a character is the width of the corresponding postscript |
| 449 | character in em-units (1/1000ths of an em). --> |
| 450 | スケーラブルな文字幅は、em ユニットで表した対応する PostScript 文字の幅 (em の 1/1000) です。 |
| 451 | <H2> |
| 452 | <!--The Glyph Names Table--> |
| 453 | グリフ名テーブル |
| 454 | </H2> |
| 455 | <P> |
| 456 | <!-- |
| 457 | The encoding table has type PCF_GLYPH_NAMES. Its format must be PCF_DEFAULT. --> |
| 458 | グリフ名テーブルは PCF_GLYPH_NAMES 型です。フォーマットは PCF_DEFAULT でなければなりません。 |
| 459 | <BLOCKQUOTE> |
| 460 | <PRE>lsbint32 format; /* 常に最下位ビットが最初に格納される! */ |
| 461 | int32 glyph_count; /* バイトオーダは format に依存する。メトリックの個数と同じになるべき */ |
| 462 | int32 offsets[glyph_count]; /* 文字列データへのバイトオフセット */ |
| 463 | int32 string_size; |
| 464 | char string[string_size]; |
| 465 | </PRE> |
| 466 | </BLOCKQUOTE> |
| 467 | <P> |
| 468 | <!-- |
| 469 | The postscript name associated with each character. --> |
| 470 | 各文字につけられた PostScript 名です。 |
| 471 | <P> |
| 472 | <HR> |
| 473 | <!-- |
| 474 | Other sources of info: --> |
| 475 | その他の情報源: |
| 476 | <UL> |
| 477 | <LI> |
| 478 | <A HREF="http://www.tsg.ne.jp/GANA/S/pcf2bdf/pcf.pdf">http://www.tsg.ne.jp/GANA/S/pcf2bdf/pcf.pdf</A> |
| 479 | <LI> |
| 480 | <A HREF="">http://myhome.hananet.net/~bumchul/xfont/pcf.txt</A> |
| 481 | </UL> |
| 482 | <P> |
| 483 | </DIV> |
| 484 | </BODY></HTML> |