| 1 |
Non standard extensions used FontForge in True/Open Type |
| 2 |
======================================================== |
| 3 |
|
| 4 |
|
| 5 |
Non standard feature tags |
| 6 |
------------------------- |
| 7 |
|
| 8 |
Internal |
| 9 |
|
| 10 |
* ``' REQ'`` -- tag used for required features |
| 11 |
|
| 12 |
For TeX |
| 13 |
|
| 14 |
I no longer use these. MS has come up with a MATH table which can contain all |
| 15 |
the TeX information. |
| 16 |
|
| 17 |
* ``ITLC`` -- :ref:`Italic correction <PfaEdit-TeX.Italic>` |
| 18 |
|
| 19 |
I have proposed this as an extension to OpenType. There was some discussion of |
| 20 |
it, but I believe the idea died. |
| 21 |
* ``TCHL`` -- :ref:`TeX Charlist <PfaEdit-TeX.charlist>` |
| 22 |
* ``TEXL`` -- :ref:`TeX Extension List <PfaEdit-TeX.extension>` |
| 23 |
|
| 24 |
|
| 25 |
Non standard tables. |
| 26 |
-------------------- |
| 27 |
|
| 28 |
* :ref:`'PfEd' the FontForge extensions table <non-standard.PfEd>` |
| 29 |
* :ref:`'TeX ' the TeX metrics table <non-standard.TeX>` |
| 30 |
* :ref:`'BDF ' the BDF properties table <non-standard.BDF>` |
| 31 |
* :ref:`'FFTM' the FontForge time stamp table <non-standard.FFTM>` |
| 32 |
|
| 33 |
-------------------------------------------------------------------------------- |
| 34 |
|
| 35 |
* (:doc:`standard tables <TrueOpenTables>`) |
| 36 |
|
| 37 |
Non standard file formats |
| 38 |
|
| 39 |
* :ref:`Bitmap only sfnt for MS Windows <bitmaponlysfnt.MS>` |
| 40 |
|
| 41 |
|
| 42 |
.. _non-standard.PfEd: |
| 43 |
|
| 44 |
'PfEd' -- the FontForge extensions table |
| 45 |
---------------------------------------- |
| 46 |
|
| 47 |
(the name is 'PfEd' for historical reasons) |
| 48 |
|
| 49 |
The table begins with a table header containing a version number and a count |
| 50 |
of sub-tables |
| 51 |
|
| 52 |
.. list-table:: |
| 53 |
:widths: 15 15 70 |
| 54 |
|
| 55 |
* - uint32 |
| 56 |
- version |
| 57 |
- currently 0x00010000 |
| 58 |
* - uint32 |
| 59 |
- count |
| 60 |
- |
| 61 |
|
| 62 |
This is followed by a table of contents, there will be count replications of |
| 63 |
the following structure (ie. a tag and offset for each sub-table |
| 64 |
|
| 65 |
.. list-table:: |
| 66 |
:widths: 15 15 70 |
| 67 |
|
| 68 |
* - uint32 |
| 69 |
- tag |
| 70 |
- |
| 71 |
* - uint32 |
| 72 |
- offset |
| 73 |
- from start of 'PfEd' table |
| 74 |
|
| 75 |
The format of the subtable depends on the sub-table's tag. There are |
| 76 |
currently 3 tags supported, these are |
| 77 |
|
| 78 |
* ':ref:`colr <non-standard.colr>`' -- per glyph color sub-table (stores the |
| 79 |
color that appears in the font view) |
| 80 |
* ':ref:`cmnt <non-standard.cmnt>`' -- per glyph comment sub-table (stores the |
| 81 |
comment that appears in the Char Info dialog for the character) |
| 82 |
* ':ref:`fcmt <non-standard.fcmt>`' -- the font comment sub-table (stores the |
| 83 |
comment that appears in the Font Info dialog) |
| 84 |
* ':ref:`flog <non-standard.fcmt>`' -- the font log sub-table (looks just like |
| 85 |
the 'fcmt' subtable) |
| 86 |
* ':ref:`cvtc <non-standard.cvtc>`' -- the cvt comments subtable |
| 87 |
* ':ref:`GPOS <non-standard.GPOS>`' -- Save lookup, lookup subtable and anchor |
| 88 |
class names of GPOS lookups |
| 89 |
* ':ref:`GSUB <non-standard.GPOS>`' -- Save lookup and lookup subtable names of |
| 90 |
GSUB lookups |
| 91 |
* ':ref:`guid <non-standard.guid>`' -- Save guideline locations |
| 92 |
* ':ref:`layr <non-standard.layr>`' -- Save background and spiro layers |
| 93 |
|
| 94 |
|
| 95 |
.. _non-standard.colr: |
| 96 |
|
| 97 |
'colr' -- the per-glyph color sub-table |
| 98 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 99 |
|
| 100 |
The sub-table header begins with a version number, and a count of ranges |
| 101 |
|
| 102 |
.. list-table:: |
| 103 |
|
| 104 |
* - uint16 |
| 105 |
- version |
| 106 |
- 0 |
| 107 |
* - uint16 |
| 108 |
- count |
| 109 |
- of ranges |
| 110 |
|
| 111 |
After this will be <count> instances of the following structure |
| 112 |
|
| 113 |
.. list-table:: |
| 114 |
|
| 115 |
* - uint16 |
| 116 |
- starting glyph index |
| 117 |
- |
| 118 |
* - uint16 |
| 119 |
- ending glyph index |
| 120 |
- |
| 121 |
* - uint32 |
| 122 |
- color |
| 123 |
- expressed as a 24bit rgb value |
| 124 |
|
| 125 |
|
| 126 |
.. _non-standard.cmnt: |
| 127 |
|
| 128 |
'cmnt' -- the per-glyph comment sub-table |
| 129 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 130 |
|
| 131 |
The sub-table header begins with a version number, and a count of ranges |
| 132 |
|
| 133 |
.. list-table:: |
| 134 |
|
| 135 |
* - uint16 |
| 136 |
- version |
| 137 |
- 0/1 |
| 138 |
* - uint16 |
| 139 |
- count |
| 140 |
- of ranges |
| 141 |
|
| 142 |
After this will be <count> instances of the following structure |
| 143 |
|
| 144 |
.. list-table:: |
| 145 |
|
| 146 |
* - uint16 |
| 147 |
- starting glyph index |
| 148 |
- |
| 149 |
* - uint16 |
| 150 |
- ending glyph index |
| 151 |
- |
| 152 |
* - uint32 |
| 153 |
- offset |
| 154 |
- from the start of this sub-table |
| 155 |
|
| 156 |
The offset points to an array of offsets (<end>-<start>+1+1) elements in the |
| 157 |
array, so one element for each glyph index mentioned in the range structure |
| 158 |
above, with one left over which allows readers to compute the length of the |
| 159 |
last string. |
| 160 |
|
| 161 |
.. list-table:: |
| 162 |
|
| 163 |
* - uint32 |
| 164 |
- offset |
| 165 |
- from start of table |
| 166 |
* - |
| 167 |
- ... |
| 168 |
- |
| 169 |
|
| 170 |
And each of these offsets points to a unicode (UCS2 for version 0, UTF-8 for |
| 171 |
version 1) string. The strings are assumed to be consecutive, so the length |
| 172 |
of each may be calculated by subtracting its offset from the offset to the |
| 173 |
next string. |
| 174 |
|
| 175 |
|
| 176 |
.. _non-standard.fcmt: |
| 177 |
|
| 178 |
'fcmt' -- the font comment (and FONTLOG) sub-table |
| 179 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 180 |
|
| 181 |
The sub-table header begins with a version number, and a count of ranges |
| 182 |
|
| 183 |
.. list-table:: |
| 184 |
:widths: 15 15 70 |
| 185 |
|
| 186 |
* - uint16 |
| 187 |
- version |
| 188 |
- 0/1 |
| 189 |
* - uint16 |
| 190 |
- length |
| 191 |
- number of characters in the string |
| 192 |
|
| 193 |
In version 0 this is followed by <length> Unicode (UCS2) characters. In |
| 194 |
version 1 it is followed by <length> bytes in utf8 encoding. |
| 195 |
|
| 196 |
|
| 197 |
.. _non-standard.cvtc: |
| 198 |
|
| 199 |
'cvtc' -- the cvt comments sub-table |
| 200 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 201 |
|
| 202 |
The sub-table header begins with a version number, and a count of cvt entries |
| 203 |
which might have comments |
| 204 |
|
| 205 |
.. list-table:: |
| 206 |
:widths: 15 15 70 |
| 207 |
|
| 208 |
* - uint16 |
| 209 |
- version |
| 210 |
- 0 |
| 211 |
* - uint16 |
| 212 |
- count |
| 213 |
- number of entries in the cvt comments array |
| 214 |
|
| 215 |
which might be smaller than the number of entries in the cvt array itself |
| 216 |
if we want to save space |
| 217 |
* - uint16 |
| 218 |
- offset[count] |
| 219 |
- offsets to the start of utf8-encoded, NUL terminated strings. Or 0 if this |
| 220 |
cvt entry has no comment |
| 221 |
|
| 222 |
|
| 223 |
.. _non-standard.GPOS: |
| 224 |
|
| 225 |
'GPOS/GSUB' -- lookup names |
| 226 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 227 |
|
| 228 |
The sub-table header begins with a version number, and a count of ranges |
| 229 |
|
| 230 |
.. list-table:: |
| 231 |
:widths: 20 20 60 |
| 232 |
|
| 233 |
* - uint16 |
| 234 |
- version |
| 235 |
- 0 |
| 236 |
* - uint16 |
| 237 |
- count |
| 238 |
- of lookups in this table |
| 239 |
|
| 240 |
Then there will be an array of count elements (one for each lookup, ordered |
| 241 |
as the lookups are in the GPOS or GSUB table) |
| 242 |
|
| 243 |
.. list-table:: |
| 244 |
:widths: 20 20 60 |
| 245 |
|
| 246 |
* - uint16 |
| 247 |
- offset |
| 248 |
- to lookup name |
| 249 |
* - uint16 |
| 250 |
- offset |
| 251 |
- to lookup subtable structure |
| 252 |
|
| 253 |
These offsets are based on the start of the subtable. The name offset points |
| 254 |
to a NUL terminated UTF-8 encoded string. The subtable offset points to the |
| 255 |
following structure: |
| 256 |
|
| 257 |
.. list-table:: |
| 258 |
:widths: 20 20 60 |
| 259 |
|
| 260 |
* - uint16 |
| 261 |
- count |
| 262 |
- of lookup subtables in this lookup |
| 263 |
|
| 264 |
Then there will be an array of count elements (one for each subtable, ordered |
| 265 |
as the subtables are in the lookup of the GPOS or GSUB table) |
| 266 |
|
| 267 |
.. list-table:: |
| 268 |
:widths: 20 20 60 |
| 269 |
|
| 270 |
* - uint16 |
| 271 |
- offset |
| 272 |
- to lookup subtable name |
| 273 |
* - uint16 |
| 274 |
- offset |
| 275 |
- to anchor class structure |
| 276 |
|
| 277 |
These offsets are also based on the start of the subtable. The name offset |
| 278 |
points to a NUL terminated UTF-8 encoded string. The anchor offset may be 0 |
| 279 |
if this subtable doesn't have any anchor classes, otherwise it points to the |
| 280 |
following structure: |
| 281 |
|
| 282 |
.. list-table:: |
| 283 |
:widths: 20 20 60 |
| 284 |
|
| 285 |
* - uint16 |
| 286 |
- count |
| 287 |
- of anchor classes in this lookupsubtable |
| 288 |
|
| 289 |
Then there will be an array of count elements (one for each anchor class) |
| 290 |
|
| 291 |
.. list-table:: |
| 292 |
:widths: 20 20 60 |
| 293 |
|
| 294 |
* - uint16 |
| 295 |
- offset |
| 296 |
- to anchor class name |
| 297 |
|
| 298 |
|
| 299 |
.. _non-standard.guid: |
| 300 |
|
| 301 |
'guid' -- guidelines |
| 302 |
^^^^^^^^^^^^^^^^^^^^ |
| 303 |
|
| 304 |
The sub-table header begins with a version number, and a count of ranges |
| 305 |
|
| 306 |
.. list-table:: |
| 307 |
:widths: 15 15 70 |
| 308 |
|
| 309 |
* - uint16 |
| 310 |
- version |
| 311 |
- 1 |
| 312 |
* - uint16 |
| 313 |
- vcount |
| 314 |
- number of vertical guidelines |
| 315 |
* - uint16 |
| 316 |
- hcount |
| 317 |
- number of horizontal guidelines |
| 318 |
* - uint16 |
| 319 |
- mbz |
| 320 |
- At some point this may contain info on diagonal guidelines. For now it is |
| 321 |
undefined |
| 322 |
* - uint16 |
| 323 |
- offset |
| 324 |
- To a full description of the guideline layer |
| 325 |
|
| 326 |
I provide the guidelines in two formats. Either may be omitted. The first |
| 327 |
format simply describes the horizontal and vertical lines used as guidelines. |
| 328 |
The second format provides a full description of all contours (curved, |
| 329 |
straight, horizontal or diagonal) which fontforge uses. I provide both since |
| 330 |
most apps seem to have a simpler guideline layer than ff does. |
| 331 |
|
| 332 |
This table is followed by two arrays, one for vertical guidelines, one for |
| 333 |
horizontal guides. Both arrays have the same element type (except that the |
| 334 |
position is for a different coordinate in the horizontal/vertical cases) |
| 335 |
|
| 336 |
.. list-table:: |
| 337 |
:widths: 15 15 70 |
| 338 |
|
| 339 |
* - int16 |
| 340 |
- position |
| 341 |
- x location of vertical guides, y location of horizontal ones |
| 342 |
* - uint16 |
| 343 |
- offset |
| 344 |
- to name, a NUL terminated utf8 string. (offset may be 0 if guideline is |
| 345 |
unnamed). |
| 346 |
|
| 347 |
The offset to the guideline layer points to a variable length structure which |
| 348 |
is also used in the :ref:`'layr' subtable <non-standard.layr>` |
| 349 |
|
| 350 |
|
| 351 |
.. _non-standard.glyph-layer: |
| 352 |
|
| 353 |
'glyph-layer' -- Data structure representing all the contours of a layer of a |
| 354 |
glyph |
| 355 |
""""" |
| 356 |
|
| 357 |
The sub-table header begins with a version number, and a count of ranges |
| 358 |
|
| 359 |
.. list-table:: |
| 360 |
:widths: 15 15 70 |
| 361 |
|
| 362 |
* - uint16 |
| 363 |
- count |
| 364 |
- of contours |
| 365 |
* - uint16 |
| 366 |
- count |
| 367 |
- of references (not present in version 0 layers) |
| 368 |
* - uint16 |
| 369 |
- mbz |
| 370 |
- reserved for a count of images |
| 371 |
|
| 372 |
This is followed by an array of structures describing each contour |
| 373 |
|
| 374 |
.. list-table:: |
| 375 |
:widths: 15 15 70 |
| 376 |
|
| 377 |
* - uint16 |
| 378 |
- offset |
| 379 |
- to start of contour data |
| 380 |
* - uint16 |
| 381 |
- offset |
| 382 |
- to a name for the contour, a utf8, NUL terminated string (or 0 if the |
| 383 |
contour is unnamed) |
| 384 |
|
| 385 |
All offsets from the start of the glyph-layer structure. |
| 386 |
|
| 387 |
This is followed by an array of structures describing each reference |
| 388 |
|
| 389 |
.. list-table:: |
| 390 |
:widths: 15 15 70 |
| 391 |
|
| 392 |
* - fixed16.16 |
| 393 |
- transform[6] |
| 394 |
- A PostScript transformation matrix where each member is a signed 4 byte |
| 395 |
integers which should be divided by 32768.0 to allow for non-integral |
| 396 |
values |
| 397 |
* - uint16 |
| 398 |
- gid |
| 399 |
- The Glyph ID of the glyph being referred to |
| 400 |
|
| 401 |
Contour data live in a variable length block. It's basic idea is that it is a |
| 402 |
list of <command>, <data> pairs. Each command is a byte which consists of two |
| 403 |
parts, a verb which specifies what happens (and how many items of data are |
| 404 |
needed) and a modifier which specifies how each data item is represented. The |
| 405 |
verbs are postscript-like drawing operations: moveto, lineto, curveto, (and |
| 406 |
quadratic curveto), close path, etc. There are also separate verbs for |
| 407 |
specifying spiro control points -- these are just the standard spiro type |
| 408 |
bytes ('v', 'o', 'c', '[' and ']'), no modifier is applied to the spiro |
| 409 |
commands, their data are always 2 coordinates in fixed notation. |
| 410 |
|
| 411 |
The low order two bits of the command (except for the spiro and close |
| 412 |
commands) specify the data format: |
| 413 |
|
| 414 |
.. list-table:: |
| 415 |
:widths: 15 85 |
| 416 |
|
| 417 |
* - 0 |
| 418 |
- signed byte data for values -128 to 127 |
| 419 |
* - 1 |
| 420 |
- signed short data for values -32768 to 32767 |
| 421 |
* - 2 |
| 422 |
- A signed 4 byte integer which should be divided by 256.0 for non-integral |
| 423 |
coordinates (or for big ones) |
| 424 |
* - 3 |
| 425 |
- Undefined and erroneous for now |
| 426 |
|
| 427 |
Each command will start at the current point and draw to the point specified |
| 428 |
by its data. The data are relative to the last point specified (except for |
| 429 |
moveto, which is absolute, there being on previous point). |
| 430 |
|
| 431 |
The verb may be one of the following: |
| 432 |
|
| 433 |
.. list-table:: |
| 434 |
:widths: 15 85 |
| 435 |
|
| 436 |
* - 0 |
| 437 |
- MoveTo, takes 2 coordinates (x,y). This must begin each contour and may |
| 438 |
not appear elsewhere within it |
| 439 |
* - 4 |
| 440 |
- LineTo, also takes 2 coordinates |
| 441 |
* - 8 |
| 442 |
- HLineTo, draws a horizontal line, so only the new x coordinate need be |
| 443 |
specified. |
| 444 |
* - 12 |
| 445 |
- VLineTo, draws a vertical line, so only the new y coordinate need be |
| 446 |
specified. |
| 447 |
* - 16 |
| 448 |
- QCurveTo, takes one off-curve control point and one on-curve point, 4 |
| 449 |
coordinates total, to draw a quadratic bezier spline |
| 450 |
* - 20 |
| 451 |
- QImplicit, only specifies the control point. The on-curve point will be |
| 452 |
the average of the control point specified here, and the one specified in |
| 453 |
the next QCurveTo or Q*Implicit command. |
| 454 |
* - 24 |
| 455 |
- QHImplicit, Same as above, except only the x coordinate of the new control |
| 456 |
point is specified |
| 457 |
* - 28 |
| 458 |
- QVImplicit, Same as above except only the y coordinate of the new control |
| 459 |
point is specified. |
| 460 |
* - 32 |
| 461 |
- CurveTo, takes two off-curve control point and one on-curve point, 6 |
| 462 |
coordinates total, to draw a cubic bezier spline |
| 463 |
* - 36 |
| 464 |
- VHCurveTo, The first control point is vertical from the current point, so |
| 465 |
only its y coordinate is specified. The final point is horizontal from the |
| 466 |
last control point so only its x coordinate is specified. 4 coordinates |
| 467 |
total y1, x2,y2, x3. |
| 468 |
* - 40 |
| 469 |
- HVCurveTo, Reverse of the above x1, x2,y2, y3 |
| 470 |
* - 44 |
| 471 |
- Close, No data. Closes (and ends) the current contour. Will draw a line |
| 472 |
from the start point to the end point if needed. |
| 473 |
* - 45 |
| 474 |
- End, No data. Ends the current contour, but leaves it open. |
| 475 |
|
| 476 |
These are basically the drawing operators in the type1 charstrings. If my |
| 477 |
terse descriptions make no sense look there for a more complete description. |
| 478 |
|
| 479 |
.. rubric:: examples |
| 480 |
|
| 481 |
suppose we want to draw a box (0,0)->(0,200)->(200,200)->(200,0)->(0,0). Then |
| 482 |
the glyph-layer would look like: |
| 483 |
|
| 484 |
.. list-table:: |
| 485 |
:widths: 10 15 10 65 |
| 486 |
|
| 487 |
* - Header |
| 488 |
- one contour |
| 489 |
- (ushort) 1 |
| 490 |
- |
| 491 |
* - Header |
| 492 |
- no images |
| 493 |
- (ushort) 0 |
| 494 |
- |
| 495 |
* - First Contour |
| 496 |
- offset to data |
| 497 |
- (ushort) 8 |
| 498 |
- The number of bytes from the start of the glyph-layer to the Contour Data |
| 499 |
* - First Contour |
| 500 |
- no name |
| 501 |
- (ushort) 0 |
| 502 |
- |
| 503 |
* - Contour Data |
| 504 |
- Move To 0,0 |
| 505 |
- (byte)0, (byte)0, (byte)0 |
| 506 |
- Both coordinates are <127 and can fit in a byte, so the modifier is 0. The |
| 507 |
command is also 0, and the coordinates are each 0 |
| 508 |
* - Contour Data |
| 509 |
- VLine To [0,]200 |
| 510 |
- (byte)(12+1) (short)200 |
| 511 |
- Vertical motion => VLineTo. Only the new y value need be specified. Is |
| 512 |
relative to the last position, but that was 0 |
| 513 |
* - Contour Data |
| 514 |
- HLine To 200[,200] |
| 515 |
- (byte)(8+1) (short)200 |
| 516 |
- Horizontal motion => HLineTo. Only the new x value need be specified. Is |
| 517 |
relative to the last position, but that was 0 |
| 518 |
* - Contour Data |
| 519 |
- VLine To [200,]0 |
| 520 |
- (byte)(12+1) (short)-200 |
| 521 |
- Vertical motion => HLineTo. Only the new y value need be specified. We |
| 522 |
move from 200 to 0, so the relative change is -200 |
| 523 |
* - Contour Data |
| 524 |
- Close |
| 525 |
- (byte)44 |
| 526 |
- We can draw the final line by closing the path |
| 527 |
|
| 528 |
|
| 529 |
.. _non-standard.layr: |
| 530 |
|
| 531 |
'layr' -- Background layer data |
| 532 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 533 |
|
| 534 |
.. list-table:: |
| 535 |
:widths: 15 15 70 |
| 536 |
|
| 537 |
* - uint16 |
| 538 |
- version |
| 539 |
- 1 |
| 540 |
* - uint16 |
| 541 |
- count |
| 542 |
- number of layers in this sub-table |
| 543 |
|
| 544 |
This is followed by an array of structures describing each layer |
| 545 |
|
| 546 |
.. list-table:: |
| 547 |
:widths: 15 15 70 |
| 548 |
|
| 549 |
* - uint16 |
| 550 |
- typeflag |
| 551 |
- Low order byte is the type |
| 552 |
|
| 553 |
2=>quadratic splines, 3=>cubic splines, 1=>spiros, other values not |
| 554 |
defined |
| 555 |
|
| 556 |
High order byte are the flags |
| 557 |
|
| 558 |
0x100 => foreground layer |
| 559 |
* - uint16 |
| 560 |
- offset |
| 561 |
- to the name of this layer, a utf8, NUL terminated string |
| 562 |
* - uint32 |
| 563 |
- offset |
| 564 |
- to the data for this layer |
| 565 |
|
| 566 |
The layer data is a block of ranges specifying which glyphs (by GID) have |
| 567 |
data for this layer. (the type field is present so that applications can |
| 568 |
ignore layers which they do not support). |
| 569 |
|
| 570 |
.. list-table:: |
| 571 |
:widths: 15 15 70 |
| 572 |
|
| 573 |
* - uint16 |
| 574 |
- count |
| 575 |
- of ranges |
| 576 |
|
| 577 |
This is followed by an array of structures one for each range: |
| 578 |
|
| 579 |
.. list-table:: |
| 580 |
:widths: 15 15 70 |
| 581 |
|
| 582 |
* - uint16 |
| 583 |
- start |
| 584 |
- first GID in the range |
| 585 |
* - uint16 |
| 586 |
- last |
| 587 |
- last GID in the range |
| 588 |
* - uint32 |
| 589 |
- offset |
| 590 |
- to an array of offsets, one for each GID in the range. The offsets in this |
| 591 |
array may be 0. These offsets in turn point to a |
| 592 |
:ref:`glyph-layer structure <non-standard.glyph-layer>` |
| 593 |
|
| 594 |
All offsets are relative to the start of the 'layr' subtable. |
| 595 |
|
| 596 |
|
| 597 |
.. _non-standard.TeX: |
| 598 |
|
| 599 |
'TeX ' -- the TeX metrics table |
| 600 |
------------------------------- |
| 601 |
|
| 602 |
The table begins with a table header containing a version number and a count |
| 603 |
of sub-tables |
| 604 |
|
| 605 |
.. list-table:: |
| 606 |
:widths: 15 15 70 |
| 607 |
|
| 608 |
* - uint32 |
| 609 |
- version |
| 610 |
- currently 0x00010000 |
| 611 |
* - uint32 |
| 612 |
- count |
| 613 |
- |
| 614 |
|
| 615 |
This is followed by a table of contents, there will be count replications of |
| 616 |
the following structure (ie. a tag and offset for each sub-table |
| 617 |
|
| 618 |
.. list-table:: |
| 619 |
:widths: 15 15 70 |
| 620 |
|
| 621 |
* - uint32 |
| 622 |
- tag |
| 623 |
- |
| 624 |
* - uint32 |
| 625 |
- offset |
| 626 |
- from start of 'PfEd' table |
| 627 |
|
| 628 |
The format of the subtable depends on the sub-table's tag. There are |
| 629 |
currently 3 tags supported, these are |
| 630 |
|
| 631 |
* ':ref:`ftpm <non-standard.ftpm>`' -- the font parameter table |
| 632 |
* ':ref:`htdp <non-standard.htdp>`' -- per glyph height/depth sub-table (stores |
| 633 |
TeX's idea of the height and depth of glyphs (should correct for optical |
| 634 |
overshoot)) |
| 635 |
* ':ref:`sbsp <non-standard.sbsp>`' -- per glyph sub/super-script sub-table |
| 636 |
|
| 637 |
|
| 638 |
.. _non-standard.htdp: |
| 639 |
|
| 640 |
'htdp' -- the per-glyph height/depth sub-table |
| 641 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 642 |
|
| 643 |
The sub-table header begins with a version number, and a count of glyphs |
| 644 |
|
| 645 |
.. list-table:: |
| 646 |
|
| 647 |
* - uint16 |
| 648 |
- version |
| 649 |
- 0 |
| 650 |
* - uint16 |
| 651 |
- count |
| 652 |
- of glyphs |
| 653 |
|
| 654 |
After this will be <count> instances of the following structure |
| 655 |
|
| 656 |
.. list-table:: |
| 657 |
|
| 658 |
* - uint16 |
| 659 |
- height |
| 660 |
- in em-units |
| 661 |
* - uint16 |
| 662 |
- depth |
| 663 |
- |
| 664 |
|
| 665 |
I store these values in em-units rather than in the fix_word of a tfm file |
| 666 |
because em-units make more sense in a sfnt and take up less space. |
| 667 |
|
| 668 |
|
| 669 |
.. _non-standard.sbsp: |
| 670 |
|
| 671 |
'sbsp' -- the per-glyph sub/super-script sub-table |
| 672 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 673 |
|
| 674 |
This sub-table has essentially the same format as the previous one. The |
| 675 |
sub-table header begins with a version number, and a count of glyphs |
| 676 |
|
| 677 |
.. list-table:: |
| 678 |
|
| 679 |
* - uint16 |
| 680 |
- version |
| 681 |
- 0 |
| 682 |
* - uint16 |
| 683 |
- count |
| 684 |
- of glyphs |
| 685 |
|
| 686 |
After this will be <count> instances of the following structure |
| 687 |
|
| 688 |
.. list-table:: |
| 689 |
|
| 690 |
* - uint16 |
| 691 |
- subscript offset |
| 692 |
- in em-units |
| 693 |
* - uint16 |
| 694 |
- superscript offset |
| 695 |
- |
| 696 |
|
| 697 |
I store these values in em-units rather than in the fix_word of a tfm file |
| 698 |
because em-units make more sense in a sfnt and take up less space. |
| 699 |
|
| 700 |
|
| 701 |
.. _non-standard.ftpm: |
| 702 |
|
| 703 |
'ftpm' -- the font parameter (font dimensions) sub-table |
| 704 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 705 |
|
| 706 |
The sub-table header begins with a version number, and a count of parameters |
| 707 |
|
| 708 |
.. list-table:: |
| 709 |
:widths: 15 15 70 |
| 710 |
|
| 711 |
* - uint16 |
| 712 |
- version |
| 713 |
- 0 |
| 714 |
* - uint16 |
| 715 |
- count |
| 716 |
- number of parameters in the font |
| 717 |
|
| 718 |
And this is followed by <count> instances of the following structure: |
| 719 |
|
| 720 |
.. list-table:: |
| 721 |
|
| 722 |
* - uint32 |
| 723 |
- tag |
| 724 |
- parameter name |
| 725 |
* - int32 |
| 726 |
- value |
| 727 |
- |
| 728 |
|
| 729 |
I store these values as fix_words and *not* as em-units because their meaning |
| 730 |
is not constrained by the spec and the ``Slant`` parameter (at the least) can |
| 731 |
not be converted to em-units. |
| 732 |
|
| 733 |
I have defined the following 4-letter parameter tags |
| 734 |
|
| 735 |
.. list-table:: |
| 736 |
:header-rows: 1 |
| 737 |
|
| 738 |
* - Tag |
| 739 |
- Meaning |
| 740 |
- traditional font parameter number in tfm file (font dimension number) |
| 741 |
* - Slnt |
| 742 |
- Slant |
| 743 |
- 1 |
| 744 |
* - Spac |
| 745 |
- Space |
| 746 |
- 2 |
| 747 |
* - Stre |
| 748 |
- Stretch |
| 749 |
- 3 |
| 750 |
* - Shnk |
| 751 |
- Shrink |
| 752 |
- 4 |
| 753 |
* - XHgt |
| 754 |
- XHeight |
| 755 |
- 5 |
| 756 |
* - Quad |
| 757 |
- Quad |
| 758 |
- 6 |
| 759 |
* - ExSp |
| 760 |
- Extra Space |
| 761 |
- 7 (in text fonts) |
| 762 |
* - MtSp |
| 763 |
- Math Space |
| 764 |
- 7 (in math and math extension fonts) |
| 765 |
* - Num1 |
| 766 |
- Num1 |
| 767 |
- 8 (in math fonts) |
| 768 |
* - Num2 |
| 769 |
- Num2 |
| 770 |
- 9 |
| 771 |
* - Num3 |
| 772 |
- Num2 |
| 773 |
- 10 |
| 774 |
* - Dnm1 |
| 775 |
- Denom1 |
| 776 |
- 11 |
| 777 |
* - Dnm2 |
| 778 |
- Denom2 |
| 779 |
- 12 |
| 780 |
* - Sup1 |
| 781 |
- Sup1 |
| 782 |
- 13 |
| 783 |
* - Sup2 |
| 784 |
- Sup2 |
| 785 |
- 14 |
| 786 |
* - Sup3 |
| 787 |
- Sup3 |
| 788 |
- 15 |
| 789 |
* - Sub1 |
| 790 |
- Sub1 |
| 791 |
- 16 |
| 792 |
* - Sub2 |
| 793 |
- Sub2 |
| 794 |
- 17 |
| 795 |
* - SpDp |
| 796 |
- Sup Drop |
| 797 |
- 18 |
| 798 |
* - SbDp |
| 799 |
- Sub Drop |
| 800 |
- 19 |
| 801 |
* - Dlm1 |
| 802 |
- Delim 1 |
| 803 |
- 20 |
| 804 |
* - Dlm2 |
| 805 |
- Delim 2 |
| 806 |
- 21 |
| 807 |
* - AxHt |
| 808 |
- Axis height |
| 809 |
- 22 |
| 810 |
* - RlTk |
| 811 |
- Default Rule Thickness |
| 812 |
- 8 (in math extension fonts) |
| 813 |
* - BOS1 |
| 814 |
- Big Op Spacing1 |
| 815 |
- 9 |
| 816 |
* - BOS2 |
| 817 |
- Big Op Spacing2 |
| 818 |
- 10 |
| 819 |
* - BOS3 |
| 820 |
- Big Op Spacing3 |
| 821 |
- 11 |
| 822 |
* - BOS4 |
| 823 |
- Big Op Spacing4 |
| 824 |
- 12 |
| 825 |
* - BOS5 |
| 826 |
- Big Op Spacing5 |
| 827 |
- 13 |
| 828 |
|
| 829 |
|
| 830 |
.. _non-standard.BDF: |
| 831 |
|
| 832 |
'BDF ' -- the BDF properties table |
| 833 |
---------------------------------- |
| 834 |
|
| 835 |
The table begins with a table header containing a version number and a count |
| 836 |
of strikes |
| 837 |
|
| 838 |
.. list-table:: |
| 839 |
:widths: 15 15 70 |
| 840 |
|
| 841 |
* - uint16 |
| 842 |
- version |
| 843 |
- currently 0x0001 |
| 844 |
* - uint16 |
| 845 |
- strike-count |
| 846 |
- |
| 847 |
* - uint32 |
| 848 |
- offset to string table |
| 849 |
- (from start of BDF table) |
| 850 |
|
| 851 |
This is followed by an entry for each strike identifying how many properties |
| 852 |
that strike has. |
| 853 |
|
| 854 |
.. list-table:: |
| 855 |
|
| 856 |
* - uint16 |
| 857 |
- ppem |
| 858 |
- |
| 859 |
* - uint16 |
| 860 |
- property-count |
| 861 |
- |
| 862 |
|
| 863 |
Then there will be the properties, first there with be property-count[1] |
| 864 |
properties from the first strike, then property-count[2] properties for the |
| 865 |
second, etc. Each property looks like: |
| 866 |
|
| 867 |
.. list-table:: |
| 868 |
:widths: 15 15 70 |
| 869 |
|
| 870 |
* - uint32 |
| 871 |
- name |
| 872 |
- offset into the string table of the property's name |
| 873 |
* - uint16 |
| 874 |
- type |
| 875 |
- 0=>string |
| 876 |
|
| 877 |
1=>atom |
| 878 |
|
| 879 |
2=>int |
| 880 |
|
| 881 |
3=>uint |
| 882 |
|
| 883 |
0x10 may be ored into one of the above types to indicate a real property |
| 884 |
* - uint32 |
| 885 |
- value |
| 886 |
- For strings and atoms, this is an offset into the string table |
| 887 |
|
| 888 |
for integers it is the value itself |
| 889 |
|
| 890 |
The string table is a series of ASCII bytes. Each string is NUL terminated. |
| 891 |
|
| 892 |
|
| 893 |
.. _non-standard.FFTM: |
| 894 |
|
| 895 |
'FFTM' the FontForge time stamp table |
| 896 |
------------------------------------- |
| 897 |
|
| 898 |
The table begins with a table header containing a version number and is |
| 899 |
followed by a series of timestamps (same format as the timestamps in the head |
| 900 |
table -- 64 bit times, seconds since 00:00:00, 1-Jan-1904). |
| 901 |
|
| 902 |
I don't think this is a duplication of the information in the 'head' table. |
| 903 |
Neither the Apple nor OpenType spec is clear: Does head.creationtime refer to |
| 904 |
the creation time of the truetype/opentype file, or of the font itself. After |
| 905 |
examining various fonts of Apple's, it appears that the 'head' entries |
| 906 |
contain the dates for the font file and not the font. The times in this table |
| 907 |
are specifically the creation time of the font (the sfd file), while the |
| 908 |
times in the 'head' table contain the creation time of the truetype or |
| 909 |
opentype font file. |
| 910 |
|
| 911 |
.. list-table:: |
| 912 |
:widths: 15 15 70 |
| 913 |
|
| 914 |
* - uint32 |
| 915 |
- version |
| 916 |
- currently 0x00000001 |
| 917 |
* - int64 |
| 918 |
- FontForge's own timestamp |
| 919 |
- (the date of the sources for fontforge) |
| 920 |
* - int64 |
| 921 |
- creation date of this font |
| 922 |
- Not the creation date of the tt/ot file, |
| 923 |
|
| 924 |
but the date the sfd file was created. |
| 925 |
|
| 926 |
(not always accurate). |
| 927 |
* - int64 |
| 928 |
- last modification date of this font |
| 929 |
- Not the modification date of the file, |
| 930 |
|
| 931 |
but the time a glyph, etc. was last |
| 932 |
|
| 933 |
changed in the font database. |
| 934 |
|
| 935 |
(not always accurate) |