khaledhosny / ots

Sanitizer for OpenType
BSD 3-Clause "New" or "Revised" License
263 stars 63 forks source link

[VDMX] Correct VDMX.numRecs field if necessary #250

Closed jfkthame closed 2 years ago

jfkthame commented 2 years ago

To ensure all the referenced records are retained.

Without this, sanitizing the ARIALBD.ttf file referenced at https://bugzilla.mozilla.org/show_bug.cgi?id=1761233#c25 (apparently from the old MS Core Fonts, but may have been modified?) generates a bad result, because numRecs in the font is 1, but in fact there are 4 records, and offsets pointing to them, so we need them all to be preserved.

(Also consistently prefer Drop() to Error() when parsing VDMX, as the font should still be functional without it.)