255UInt16 spec

Hi all,

I suppose this is the latest draft:

  http://dev.w3.org/webfonts/WOFF2/spec/#DataTypes

Reading the section on 255UInt16 encoding, I found a few issues:

The table is really confusing:

Data TypeSyntaxDescription and CommentsUInt8   Codeif (Code < 253) Value =
Code; /* [0..252] */if ((Code == 254) || (Code == 255))UInt8   Value1if
(Code == 255) Value = 253 + Value1; /* [253..508] */
if (Code == 254) Value = 506 + Value1; /* [506..761] */else if (Code == 253)
UInt16   ValueValue; /* [0..65535] */

IMO this is a very clumsy description of the encoding.  What do "Data Type"
and "Syntax" columns mean in this context?!  I understand the encoding from
putting everything together, but think the table should be rewritten.

In the example following it is all bogus:

  For example, the value 506 can be encoded as [255, 203], [254, 0], and
[253, 1, 250]

I know it can't be changed now, but why was it designed in a way that 253
and 506-508 can be represented redundantly using one / two byte sequences?

Thanks,
behdad

Received on Saturday, 28 March 2015 18:56:29 UTC