Document: fonts property

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

This feature is part of the CSS Font Loading API.


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 fonts are loaded

document.fonts.ready.then((fontFaceSet) => {
  // Any operation that needs to be done only after all used fonts
  // have finished loading can go here.
  const fontFaces = [...fontFaceSet];
  // some fonts may still be unloaded if they aren't used on the site
  console.log( => f.status));

The promise fulfils when loading and layout operations of all used fonts are done. The set of used fonts can be different from the set of declared fonts, e.g. if optional fonts (i.e. fonts declared via font-display: optional) were not able to load in time.


CSS Font Loading Module Level 3
# FontFaceSet-interface

Browser compatibility

BCD tables only load in the browser

See also