The fonts
property of the Document
interface returns the FontFaceSet
interface of the document.
let fontFaceSet = document.fonts;
The retuned value is the FontFaceSet
interface of the document. The FontFaceSet
interface is useful for loading new fonts, checking the status of previously loaded fonts etc.
document.fonts.ready.then(function() { // Any operation that needs to be done only after all the fonts // have finished loading can go here. });
Specification | Status | Comment |
---|---|---|
CSS Font Loading Module Level 3 The definition of 'FontFaceSet' in that specification. | Working Draft | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 60 | No | 41
|
No | 47 | 10 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 60 | 60 | No | Yes | 47 | 10.2 | 5.0 |
FontFaceSet
interfaceFontFace
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/document/fonts