Re: Conflicting statements on WOFF font table order

On 10 Dec 2010, at 18:53, Julio Gonzalez wrote:

> Hi,
> 
> On Section 5 (Font Data Tables) of the WOFF spec, there are two paragraphs that appear contradictory:
> 
> "Font tables in WOFF files MUST be stored in the same order as the well-formed input font. The table order is implied by offset values in the table directory; sorting table directory entries into ascending offset value order produces a list of entries in an order equivalent to that of the font tables."
> 
> Then later on the NOTE section, one sees:
> 
> "In some cases, sites deploying WOFF files as Web fonts may wish to subset the character repertoire, optimize table ordering for efficient text layout or rasterization, or remove (or add) optional font tables depending on the particular features needed for a site. User agents might make similar modifications to the font during decoding, such as omitting tables that are not needed by their particular text display system."
> 
> 
> "Optimizing table order for efficiency" violates the previous statement: "sorting table directory entries into ascending offset value order produces a list of entries in an order equivalent to that of the font tables."
> 
> So, do we want to relax the following statement: "Font tables in WOFF files MUST be stored in the same order as the well-formed input font" to "Font tables in WOFF files MUST be stored in the same order as the input font"? The only thing that truly needs to be preserved is the tag order in the sfnt table directory. The offset values should be fair game for re-arrangement.

No, I don't think we should relax this, as this would break the ability to reconstruct a binary-identical copy of the input sfnt.

Operations such as subsetting, table order optimization, etc., mentioned in the note there would all be regarded as "pre-WOFFing" modifications to the font. For the purposes of the WOFF spec, the "input font" is the sfnt *after* any such modifications have been done to it. This is the font that can be restored in a 100% round-trip fashion (if desired) by the decoding operation. Any pre-WOFF optimizations (such as table order optimization) are *not* expected to be reversible. See also the final sentence of that NOTE.

JK

Received on Friday, 10 December 2010 19:33:02 UTC