@@ -1687,8 +1687,8 @@ or remove tables in a [=font subset=].
1687
1687
</tr>
1688
1688
<tr>
1689
1689
<td> Tag</td>
1690
- <td> <dfn for="Table keyed patch"> format</dfn> </td>
1691
- <td> Identifies the encoding as table keyed, set to 'iftk' </td>
1690
+ <td> format</td>
1691
+ <td> Identifies the encoding as table keyed, must be set to 'iftk' </td>
1692
1692
</tr>
1693
1693
<tr>
1694
1694
<td> uint32</td>
@@ -1732,8 +1732,8 @@ of that [=TablePatch=].
1732
1732
</tr>
1733
1733
<tr>
1734
1734
<td> uint32</td>
1735
- <td> length </td>
1736
- <td> The uncompressed length of [=TablePatch/brotliStream=] .</td>
1735
+ <td> <dfn for="TablePatch">maxUncompressedLength</dfn> </td>
1736
+ <td> The maximum uncompressed length of [=TablePatch/brotliStream=] .</td>
1737
1737
</tr>
1738
1738
<tr>
1739
1739
<td> uint8</td>
@@ -1765,9 +1765,8 @@ The algorithm:
1765
1765
1766
1766
1. Initialize <var> extended font subset</var> to be an empty font with no tables.
1767
1767
1768
- 2. Check that the [=Table keyed patch/format=] field in <var> patch</var> is equal to 'iftk' , if it is
1769
- not equal then <var> patch</var> is not correctly formatted. Patch application has failed, return
1770
- an error.
1768
+ 2. Check that the <var> patch</var> is valid according to the requirements in [[#table-keyed]] (requirements are marked with a
1769
+ "must") and all [=TablePatch=] 's are contained within <var> patch</var> . Otherwise, return an error
1771
1770
1772
1771
3. Check that the [=Table keyed patch/compatibilityId=] field in <var> patch</var> is equal to <var> compatibility id</var> .
1773
1772
If there is no match, or <var> base font subset</var> does not have either an 'IFT ' or 'IFTX' table, then patch application
@@ -1790,23 +1789,26 @@ The algorithm:
1790
1789
are listed in the [=Table keyed patch/patches=] array.
1791
1790
1792
1791
1793
- * If bit 0 (least significant bit) of [=TablePatch/flags=] is set, then decode [=TablePatch/brotliStream=] following
1794
- [[RFC7932#section-10]] . No shared dictionary is used. Add a [[open-type/otff#table-directory|table]] to
1795
- <var> extended font subset</var> identified by [=TablePatch/tag=] with it's contents set to the decoded [=TablePatch/brotliStream=] .
1796
-
1797
1792
* If bit 1 of [=TablePatch/flags=] is set, then do not copy or add a [[open-type/otff#table-directory|table]] to
1798
- <var> extended font subset</var> identified by [=TablePatch/tag=] .
1793
+ <var> extended font subset</var> identified by [=TablePatch/tag=] . Continue to the next entry.
1794
+
1795
+ * If bit 0 (least significant bit) of [=TablePatch/flags=] is set, then decode [=TablePatch/brotliStream=] following
1796
+ [[RFC7932#section-10]] . No shared dictionary is used. If the decoded data is larger than [=TablePatch/maxUncompressedLength=]
1797
+ return an error. If there is any data in [=TablePatch/brotliStream=] which was not used by the decoding process return an error.
1798
+ Add a [[open-type/otff#table-directory|table]] to <var> extended font subset</var> identified by
1799
+ [=TablePatch/tag=] with it's contents set to the decoded [=TablePatch/brotliStream=] . Continue to the next entry.
1799
1800
1800
1801
* Otherwise, decode [=TablePatch/brotliStream=] following [[RFC7932#section-10]] and using the
1801
1802
[[open-type/otff#table-directory|table]] identified by [=TablePatch/tag=] in <var> base font subset</var>
1802
- as a [[Shared-Brotli#section-3.2|shared LZ77 dictionary]] . Add a [[open-type/otff#table-directory|table]] to
1803
- <var> extended font subset</var> identified by [=TablePatch/tag=] with it's contents set to the decoded [=TablePatch/brotliStream=] .
1803
+ as a [[Shared-Brotli#section-3.2|shared LZ77 dictionary]] . If no such table exists return an error. If the decoded data is
1804
+ larger than [=TablePatch/maxUncompressedLength=] return an error. If there is any data in [=TablePatch/brotliStream=] which was
1805
+ not used by the decoding process return an error. Add a [[open-type/otff#table-directory|table]] to
1806
+ <var> extended font subset</var> identified by [=TablePatch/tag=] with it's contents set to the decoded
1807
+ [=TablePatch/brotliStream=] .
1804
1808
1805
1809
6. For each [[open-type/otff#table-directory|table]] in <var> base font subset</var> which has a tag that was not found in any of
1806
1810
the entries processed in step 5, add a copy of that table to <var> extended font subset</var> .
1807
1811
1808
-
1809
-
1810
1812
Glyph Keyed {#glyph-keyed}
1811
1813
--------------------------
1812
1814
0 commit comments