Index: Overview.html =================================================================== RCS file: /sources/public/webfonts/WOFF2/spec/Overview.html,v retrieving revision 1.29 retrieving revision 1.30 diff -r1.29 -r1.30 43c43 <

W3C Editors Draft 14 September 2014

--- >

W3C Editors Draft 08 October 2014

190,192c190,193 < Similar to WOFF 1.0 format, the extended metadata and private data blocks are each < compressed in a separate data stream, and are concatenated together into the WOFF 2.0 file. < The compression algorithm is Brotli [Brotli].

--- > Similar to WOFF 1.0 format, the optional extended metadata and private data blocks are each > presented as separate blocks of data, and are concatenated together into the WOFF 2.0 file. > The compression algorithm used for both the compressed font data stream and extended > metadata block is Brotli [Brotli].

194,195c195,196 <

A complete WOFF2 file consists of several blocks: a 48-byte header, immediately followed < (in this order) by a variable-size table directory, a compressed font data block, --- >

A complete WOFF2 file consists of several blocks of data: a 48-byte header, immediately > followed (in this order) by a variable-size table directory, a compressed font data block, 477a479,488 >

The decompressed and reconstructed > table data MUST be stored in the format specified by the [OFF] > specification. Each > reconstructed table directory entry MUST contain a valid 'checkSum' value, > the decoder MUST recalculate the checkSum value for each decoded table. > Also, due to modifying transofrms applied to glyf and loca > tables, the decoder > MUST recalculate the checkSumAdjustmentglyf value of the entire > font and MUST store the updated value in the head table.

> 537,540c548,551 <

For greater compression effectiveness, the glyf table is split into seven < substreams, to group like data together. The transformed table consists of < a header with the size of each of the substreams, followed by the substreams < in sequence. During the decoding process the reverse transformation takes place, --- >

For greater compression effectiveness, the glyf table is split > into seven substreams, to group like data together. The transformed table consists of > a number of fields speciffying the size of each of the substreams, followed by the > substreams in sequence. During the decoding process the reverse transformation takes place, 545c556 < Transformed glyf Header --- > Transformed glyf Table 561c572 < UInt32bboxStreamSizeSize of bbox stream (a stream of Int16 values) --- > UInt32bboxStreamSizeSize of bbox data representing a combined length of bboxBitmap and bboxStream (a stream of Int16 values) 563c574,581 < UInt8bboxBitmap[n]Bitmap indicating explicit bounding boxes --- > UInt16nContourStreamStream of UInt16 values representing number of contours for each glyph record > 255UInt16nPointsStreamStream of 255UInt16 values representing number of outline points for each contour in glyph records > UInt8flagStreamStream of UInt8 values representing flag values for each outline point. > 255UInt16glyphStreamStream of 255UInt16 values representing number of bytes used to store the instructions for each glyph > UInt16compositeStreamStream of UInt16 values representing component flag values and associated composite glyph data > UInt8bboxBitmap[n]Bitmap (a numGlyphs-long bit array) indicating explicit bounding boxes > Int16bboxStreamStream of Int16 values representing glyph bounding box data > UInt8instructionStreamStream of UInt8 values representing a set of instructions for each corresponding glyph 574c592 <

Included in the Transformed glyf Header is a --- >

Included in the Transformed glyf Table is a 576,581c594,615 < whether it contains an explicit bounding box, or whether the bounding < box is to be inferred from the coordinate values. 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. The total number of bytes < in this bitmap is equal to 4 * ((numGlyphs + 31) / 32). The bits are packed --- > whether it contains an explicitly encoded bounding box, or whether the bounding > box is to be inferred from the coordinate values. The relevant computations to determine > the bounding box status must be performed by both an encoder and a decoder. For each > simple glyph, > an encoder MUST calculate the the xMin, yMin, xMax and yMax coordinate values using > all outline points (both on- and off-curve points) and compare the calculate values > with the encoded bounding box info for the glyph. If the glyph bounding box info matches > the calculated values, an encoder MUST omit the bounding box info. Otherwise, > if the > calculated bounding box values do not equal the glyph values encoded in a font, > an encoder MUST set the corresponding bboxBitmap flag and record > the original bounding box values in the bboxStream. > For a composite glyph, > an encoder MUST always set the corresponding bboxBitmap flag and > record the original bounding box values in the bboxStream.

> >

A decoder MUST perform similar > calculations if the bounding box is to be inferred. For a given glyph, when a corresponding > bit in bboxBitmap is not set, the xMin, yMin, > xMax and yMax values MUST be calculated at the time of decoding using all outline > point coordinates. The total number of bytes in bboxBitmap > is equal to 4 * ((numGlyphs + 31) / 32). The bits are packed 585c619 < byte, and so on. A 1 value indicates an explicitly set bounding box.

--- > byte, and so on. A bit=1 value indicates an explicitly set bounding box.

587c621 <

After reading the TransformedGlyphHeader, the --- >

Upon reading the Transformed glyf Table , the 590,593c624,628 < TransformedGlyphHeader. Also, at the point of reconstructing a glyph, 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 --- > Transformed glyf Table . Also, at the point of reconstructing > a glyph, a decoder > MUST store for each glyph the corresponding offset in the > reconstructed glyph table, and this data will collectively become the > contents of the reconstructed loca table (see section 671c706 < composite glyph instructions and the specified scales of iindividual components, --- > composite glyph instructions and the specified scales of individual components, 884c919 < field of the transformed glyf header.

--- > field of the Transformed glyf Table.

1012,1013c1047,1048 < if present, MUST be the last block in the WOFF file, following all the font < tables and any extended metadata block. --- > if present, MUST be the last block in the WOFF file, following the compressed font > data stream and the extended metadata block, if one is present.