Potential conformance statements in WOFF2, sections 4 to 7

Hello WebFonts,

4. Table directory format

All of the conformance statements from WOFF 1.0 5. Table Directory
seem to apply.
http://www.w3.org/TR/2012/REC-WOFF-20121213/#TableDirectory

(in firefox, View > Style > conformance. I don't know how Chrome
 handles alternate stylesheets. I think MSIE doesn't handle them at
 all.

I suggest that all of WOFF 1.0 section 5 be added to the existing
content of WOFF2 section 4.

5. Compressed data format
"then compressed using the Brotli compression algorithm [Brotli]."

suggest [FF]

". This table data MUST be compressed using the Brotli compression
algorithm [Brotli]."

(WOFF 1.0 has an equivalent but more complex clause for requiring gzip
if compression is used).

WOFF 1.0 also had a relevant [UA]
"If the decompression function fails for any table, the WOFF file is
invalid and MUST NOT be loaded."
which I suggest adding.

Do we have the same constraints on table data immediately following
table directory, and table ordering, as WOFF 1.0? If so we should copy
the two WOFF 1.0 statements that cover this
http://www.w3.org/TR/2012/REC-WOFF-20121213/#conform-afterdirectory
and
http://www.w3.org/TR/2012/REC-WOFF-20121213/#conform-sameorder


"but the results must be consistent with the sequential process as
specified here."

I think that probably should stay as a lowercase non-conformance must.
At least, I'm not sure how to check it.

"These differences will invalidate 'DSIG' table, if one is present
and, therefore, the compliant WOFF2 encoder SHOULD remove the DSIG
table from an input font data, prior to applying transformations and
entropy coding steps."

I know, we discussed this already and there was a concern about
leaving a (possibly empty) DSIG because this is used as a hueristic
for OpenType by some software. I wonder if we can turn the wooly
SHOULD into a crisper, testable MUST like this [AT][FF]:

"These differences will invalidate 'DSIG' table, if one is present
and, therefore, the compliant WOFF2 encoder MUST either remove the
DSIG table from an input font data, or substitute an empty DSIG table,
prior to applying transformations and entropy coding steps."

"The WOFF 2.0 encoders SHOULD also set bit 11 of the 'flags' field of
the head table (see [OFF] specification) to indicate that a recreated
font file was subject to lossless modifying transform."

If we want to rely on this, it needs to be an [AT] MUST.

5.1. Transformed glyf table format
"It is up to the encoder to produce transformed data that is valid and
decodes to the desired font data. "

valid is used but not defined except as the sum of the whole section.
Can this be re-expressed as an [AT] requirement?

"The encoder MUST produce transformed data that is valid."
then continue with
"It is up to the encoder to produce transformed data which decodes to
the desired font data. "

"If the bounding box is to be inferred, the explicit xMin, yMin, xMax
and yMax values must be calculated at the time of decoding the outline
point coordinates"

suggest [UA]

"If the bounding box is to be inferred, the explicit xMin, yMin, xMax
and yMax values MUST be calculated at the time of decoding the outline
point coordinates"

"a decoder should store for each glyph the corresponding offset in the
reconstructed glyph table, and this data will collectively become the
contents of the reconstructed locatable  (see section 5.3"

I'm assuming this is an informative forward reference and the actual
conformance will be in that later section.

"Editor's note: Do we need to add the conformance requirement for UA,
if bounding box is not present?"

yes, I think we do. Maybe something like [UA]

"If a composite glyph has no explicit bounding box, the font is
invalid and MUST not be used" ??

[FF] "The origLength field MUST specify an adequate amount of space to
represent the reconstructed glyf table"

huh.

" Depending on the context, this nominal size may be greater than,
less than, or equal to the actual size of the glyf table in the source
font being compressed." (and following editors note)

Yes, this concept of "adequate" space which can still be smaller than
actually needed is wooly and untestable.

6. Extended Metadata Block

I suggest that WOFF2 include explicit conformance statements that
relate to the metadata block at the decompression and reconstruction
level, especially where these differ from WOFF 1.0 (e.g must be
compressed with Brotli)

Question: In WOFF2 is the metadata in the same stream as everything
else, or in a separate stream?

There are some statements in WOFF 1.0 about padding and alignment
that may be relevant.

Crucially, we need to copy over these three [UA]
"The presence (or absence) and content of the metadata block MUST NOT
affect font loading or rendering behavior of user agents; it is
intended to be purely informative."
"User agents MAY provide a means for
users to view information about fonts (such as a "Font Information"
panel)."
"If such information is provided, then they MUST treat the
metadata block as the primary source, and MAY fall back to presenting
information from the font's name table entries when relevant extended
metadata elements are not present."

This means that WOFF2 fully describes decompressing a metadata block,
if present, and that it must not affect rendering, which is testable
without understanding the contents.

We then add a normative reference to WOFF 1.0 for the *contents* of the
metadata block, saying it is exactly the same. This avoids having to
copy all that fairly lengthy information across.

7. Private Data Block

Same question, is this compressed with Brotli or not and if so is it
in the same stream as the font tables?

In particular "it may be compressed or encrypted" seems to imply that
it is not in the same stream. This should be explicitly stated.

Internet Media Type Registration
(no conformance statements).



-- 
Best regards,
 Chris                          mailto:chris@w3.org

Received on Tuesday, 19 August 2014 18:39:52 UTC