You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sun-ExtA.ttf has a malformed vhea table, so browsers reject it #881
Sun-ExtA.ttf has a malformed vhea table, so browsers refuse to load it as a web font. It came up in the Font Manager preview in GravityPDF/gravity-pdf#2015, using the copy published at GravityPDF/mpdf-core-fonts v1.1.1.
The fault
vhea.numberOfVMetrics is 57,514, but maxp.numGlyphs is 50,016. Firefox and Chromium both run fonts through the OpenType Sanitizer, which treats this as fatal:
downloadable font: vhea: Bad number of metrics 57514
downloadable font: vhea: Failed to parse table
downloadable font: rejected by sanitizer
OTS parsing error: vhea: Bad number of metrics 57514
Of the 39 regular-style core font files checked, this is the only one where vhea or hhea claims more metrics than there are glyphs.
Proposed fix
Remove the vertical layout tables (vhea, vmtx, VORG) and publish the repaired file. TTFontFile.php doesn't reference any of them.
Tested on a scratch copy with fontTools, using recalcBBoxes=False and recalcTimestamp=False:
Firefox and Chromium load the repaired file, and still reject the original.
The character map and glyph count are unchanged.
The file goes from 22,993,540 to 22,748,504 bytes.
Not tested yet: rendering a PDF with the repaired file, including CJK text and backupSubsFont substitution. That should happen before it's released.
Follow-up in Gravity PDF
Once a repaired file is published:
Update its URL, size and hash in fonts/core-fonts.php and fonts/core-fonts.json.
Remove 'preview' => false from sun-exta in Model_Font_Languages.
Check what compares a file already on disk against the new hash. A download is skipped when the file exists, so existing sites keep the old copy, which still can't be previewed.
Activity
Merge pull request #882 from GravityPDF/fix/881-sun-ext-vertical-tables
Repair Sun-ExtA and Sun-ExtB so browsers can load them as web fonts (G…
Replace a 6.18 site's outdated Garuda and Sun-Ext fonts on the upgrad…
Replace a 6.18 site's outdated Garuda and Sun-Ext fonts on the upgrad…
Replace a 6.18 site's outdated Garuda and Sun-Ext fonts on the upgrad…
Replace a 6.18 site's outdated Garuda and Sun-Ext fonts on the upgrad…