Closed Bug 1768759 Opened 2 years ago Closed 2 years ago

Disable any SVG-in-OpenType glyphs when text rendering is happening on a worker thread

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Supporting SVG glyphs in an OpenType font being used by an offscreen-canvas worker is likely to be tricky, as the SVG document/rendering code we rely on to paint them expects to run on the main thread.

Such fonts are extremely niche, unlikely to be deployed by major sites due to lack of universal support, and likely to be superseded by the upcoming COLRv1 technology. So I think -- at least for the time being -- we should simply block the SVG glyphs from being used off-main-thread.

Any attempt to use such a font in offscreen canvas will render the fallback outline glyphs, just as in a browser that doesn't support SVG-in-OT at all.

(Note that COLR fonts, which are the more widely used color-font technology, do work in offscreen canvas.)

We might want to look into this further and see if it can be supported, but for now at least
the safest option is to disable any attempt by Gecko to render such glyphs.

(Actually, in some cases they may work anyhow, if they're natively supported by the system font
rasterizer we're using; I'm seeing this on current macOS thanks to Core Text. Maybe at some point
we can switch off our SVG-glyph code altogether and just rely on the platform.)

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fef1fa913816
Disable use of SVG-in-OpenType glyphs when text rendering is not happening on the main thread. r=lsalzman
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: