Closed Bug 1796648 Opened 3 years ago Closed 3 years ago

Drop any SVG table from downloaded fonts if OpenType-SVG rendering is disabled

Categories

(Core :: Graphics: Text, defect)

defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(1 file)

The presence of this table can make Core Text font operations really expensive, so if rendering OT-SVG is preffed off, we should drop it entirely.

This makes e.g. https://nabla.typearture.com/ perform VASTLY better on macOS if OT-SVG is preffed off;
without it, we get bogged down in Core Text internally parsing all the SVG when all we want are the
TrueType outlines.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d1dd198481d0 Drop any SVG table from downloaded fonts if OpenType-SVG rendering is disabled. r=gfx-reviewers,lsalzman

backed out for causing reftest failures on svg-glyph-basic.svg

[task 2022-10-27T16:44:08.461Z] 16:44:08     INFO - REFTEST TEST-START | layout/reftests/text-svgglyphs/svg-glyph-basic.svg == layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg
[task 2022-10-27T16:44:08.467Z] 16:44:08     INFO - REFTEST INFO | RESTORE PREFERENCE pref(gfx.font_rendering.opentype_svg.enabled,true)
[task 2022-10-27T16:44:08.469Z] 16:44:08     INFO - REFTEST TEST-LOAD | file:///builds/worker/workspace/build/tests/reftest/tests/layout/reftests/text-svgglyphs/svg-glyph-basic.svg | 1 / 29 (3%)
[task 2022-10-27T16:44:08.972Z] 16:44:08     INFO - REFTEST TEST-LOAD | file:///builds/worker/workspace/build/tests/reftest/tests/layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg | 1 / 29 (3%)
[task 2022-10-27T16:44:09.105Z] 16:44:09     INFO - REFTEST INFO | REFTEST fuzzy test (0, 0) <= (255, 29726) <= (1, 200)
[task 2022-10-27T16:44:09.367Z] 16:44:09     INFO - REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/text-svgglyphs/svg-glyph-basic.svg == layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg | image comparison, max difference: 255, number of differing pixels: 29726
Flags: needinfo?(jfkthame)

Ugh, I think what's happening here is that we first run a test with the pref disabled, and this causes the webfont resource to be cached without its SVG table; then the following tests use that cached resource, and fail.

Maybe we should flush the webfont cache when the pref changes. But in practice it's probably not really important. For reftest purposes, I think we can just defeat the caching by adding a query parameter to the font URL. I'll run that through try to check.

Flags: needinfo?(jfkthame)
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8dfc0c57e6cb Drop any SVG table from downloaded fonts if OpenType-SVG rendering is disabled. r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: