true
false
/* second is false unless that family is loaded */
How It Works
Pass a font string. Same shape as CSS font shorthand bits (size + family).
check returns a boolean. MDN: does not initiate a load.
System fonts often return true. Missing custom families return false.
Use load() when you want to fetch matching faces.
Compatibility
Browser Support
Document.fonts is marked Baseline Widely available on MDN (since January 2020). It is part of the CSS Font Loading API. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
Document.fonts
Returns the document FontFaceSet for loading and inspecting fonts.
The FontFaceSet interface for the document. MDN: useful for loading new fonts and checking the status of previously loaded fonts. Part of the CSS Font Loading API.
No. MDN marks Document.fonts as Baseline Widely available (since January 2020). It is a standard Document property.
A Promise that fulfills when loading and layout of all used fonts are done (MDN). Put measurement or paint-sensitive work inside its then/await callback.
Not necessarily. MDN notes used fonts can differ from declared fonts — for example optional fonts (font-display: optional) that did not load in time.
Create a FontFace, call face.load(), then document.fonts.add(face), or use document.fonts.load("12px MyFont") to request matching faces.
Yes. FontFaceSet is also available as self.fonts in web workers (MDN). Document.fonts is the document entry point in window contexts.