Open ellan11 opened 5 years ago
FYI: I needed that event in another project. We need browser support for that, which is not polyfillable. Here with typescript annotations:
// register event for loading new font files
const fontFaceSet: EventTarget = (document as any).fonts;
if (fontFaceSet && fontFaceSet.addEventListener) {
fontFaceSet.addEventListener('loadingdone', () => {
// layout / glyphs could have been changed
});
} else {
// no fallback is possible without this API as a font files download can be triggered
// at any time when a new glyph is rendered on screen
}
Cool, thanks. I'll use that approach to trigger refresh when fontFaceSet is supported, and will try to upstream.
It appears that in current implementation refresh won’t be triggered when a font is loaded, and elements’ resize caused by the font load won’t be detected. Is this assumption correct, and if so do you plan to add a support for it?