Re: New spec version available for review (was RE: WOFF2 CTS - Note to myself)

On 11/2/15 20:13, Levantovsky, Vladimir wrote:

> I managed to get the first draft of the TTC related sections ready for
> your review
> (http://dev.w3.org/webfonts/WOFF2/spec/#collection_dir_format).


One thing I wondered as I looked over this was about the 'flavor' field 
in the CollectionFontEntry record; this seems redundant. (Note that 
there's no corresponding per-font 'flavor' field in the TTC spec.)

The TTC spec looks as though it was written on the assumption that the 
faces in the collection are TrueType-flavored. But even if we assume 
that collections may also contain CFF-flavored fonts, and could even 
contain a mixture of TrueType and CFF faces, the 'flavor' field is still 
redundant.

Any tool that wants to "extract" a single face from the collection into 
a standalone 'sfnt' format can deduce a suitable 'flavor' for the sfnt 
header by looking at the table tags present: if there's a 'CFF ' table, 
the flavor should be 'OTTO'; otherwise 0x00010000.

And a tool that wants to reconstruct a complete TTC from the 
WOFF2-compressed data will not need to put a 'flavor' into the fonts at 
all, as the TTC format does not have this field.

So I propose we can drop 'flavor' from the CollectionFontEntry.

(We could also drop it from the WOFF2 header, if we used a different 
mechanism -- such as a flag in the current 'reserved' field -- to 
indicate that the file is a collection, and let decoders infer it from 
the tables present. But this would involve a change to the existing wire 
format, and may not be worthwhile at this point for the sake of saving 4 
bytes per file.)

JK

Received on Wednesday, 11 February 2015 22:25:34 UTC