[MPEG-OTSPEC] "font directory" / "offset table" / "table directory"

Peter Constable pgcon6 at msn.com
Sun Aug 30 00:43:50 CEST 2020


I was trying to clean up some terminology and format descriptions in the OT spec and discovered there was a greater terminology problem than I realized. (This applies equally to OFF.) I'd like to get input on how people are used to using these terms / names of structures and the best remedy for clear and consistent usage in the spec.

This is about those structures that are found at the start of a (non-collection) font file: an offset (sub)table / array of table records. Q: What terms are people used to using for these?


Here's the skivvy wrt Apple's TrueType Reference Manual, and OT/OFF:

Apple's TrueType Reference Manual<https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html> has terminology that's similar to but slightly different to that currently in OT/OFF, and it has its own inconsistency.


  *   The TT font begins with a "font directory", which is a two-part entity comprised of the "offset subtable" that is followed directly by the "table directory".


  *   "Offset subtable" refers to the five fields from sfntVersion to rangeShift.



  *   "Table directory" is used inconsistently:



     *   There's a good usage, meaning an array of records (each record comprised of tag, checksum, offset, length fields).
     *   The bad usage: the same term is also used as the name for that record.

The OT spec<https://docs.microsoft.com/en-us/typography/opentype/spec/otff#organization-of-an-opentype-font> / OFF refer to that four-member record as "Table Record", though it inconsistently uses "Table Record entries" or "Table Record" to mean the array.

The record part is easy to fix in OT/OFF and in Apple's spec: That record should be called "TableRecord", and that term should only be used for that structure (not the array).

But OT / OFF also have another inconsistency in that "Table Directory" is used with different meanings:


  *   The table record array only (consistent with Apple's good use of "table directory")


  *   The Offset Table, or the combination of offset table + table records array (= Apple's "font directory")


This inconsistency dates back at least to Microsoft's TrueType 1.66 spec.

A simple fix would be to use "Offset Table" to mean the same thing that Apple calls the "font directory", incorporating a tableRecords[] member into that structure, then revise current instances of "Table Directory" changing to "Offset Table" or "tableRecords array" as appropriate.

But as these are such a basic part of every font file, it occurs to me that many implementers may have terminology engrained in their minds-or their code-that differs, and that this could be confusing / hard to adjust to.

An alternative would be a clean-up of Apple's terminology:


  *   "Font Directory" is comprised of the "Offset Table" followed directly by the "Table Directory".
  *   "Offset Table" is comprised of five members, sfntVersion to rangeShift.
  *   "Table Directory" is comprised of an array of "TableRecord". (This could be described as a struct consisting of tableRecords[].)
  *   "TableRecord" is a structure comprised of tag, checksum, offset and length fields.

Yet another alternative would be to use "Font Directory" as a formal struct name that includes tableRecords[] as a member, so "offset table" would not be used in the formal description.

Personally, I don't care for either of these alternatives owing to the use of "font directory": IMO, that would be better used in describing a collection-level structure, not a font-resource-level structure. (I.e., a collection file begins with a font directory that provides offsets to "offset tables" (or whatever) for one or more font resources.)



Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20200829/de660064/attachment.html>


More information about the mpeg-otspec mailing list