The fonts property of the Document interface returns the FontFaceSet interface of the document.


let fontFaceSet = document.fonts;


The returned 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.


Doing operation after all fonts are loaded

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

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
fontsChrome Full support 60Edge Full support 79Firefox Full support 41
Full support 41
No support 35 — 41
Disabled From version 35 until version 41 (exclusive): this feature is behind the layout.css.font-loading-api.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support 47Safari Full support 10WebView Android Full support 60Chrome Android Full support 60Firefox Android Full support YesOpera Android Full support 44Safari iOS Full support 10Samsung Internet Android Full support 5.0


Full support  
Full support
No support  
No support
User must explicitly enable this feature.
User must explicitly enable this feature.

See also