web api interface
FontFaceSet
Available in workers
The FontFaceSet interface of the CSS Font Loading API manages the loading of font-faces and querying of their download status.
A FontFaceSet instance is a Set-like object that can hold an ordered set of FontFace objects.
This property is available as fonts, or self.fonts in web workers.
Instance properties
statusRead only- : Indicates the font-face’s loading status. It will be one of
'loading'or'loaded'.
- : Indicates the font-face’s loading status. It will be one of
readyRead only- :
Promisewhich resolves once font loading and layout operations have completed.
- :
sizeRead only- : Returns the number of values in the
FontFaceSet.
- : Returns the number of values in the
Events
loading- : Fires when a font-face set has started loading.
loadingdone- : Fires when a font face set has finished loading.
loadingerror- : Fires when an error occurred while loading a font-face set.
Instance methods
FontFaceSet.add()- : Adds a font to the font set.
FontFaceSet.check()- : A boolean value that indicates whether a font is loaded, but doesn’t initiate a load when it isn’t.
FontFaceSet.clear()- : Removes all manually-added fonts from the font set. CSS-connected fonts are unaffected.
FontFaceSet.delete()- : Removes a manually-added font from the font set. CSS-connected fonts are unaffected.
FontFaceSet.entries()- : Returns a new iterator with the values for each element in the
FontFaceSetin insertion order.
- : Returns a new iterator with the values for each element in the
FontFaceSet.forEach()- : Executes a provided function for each value in the
FontFaceSetobject.
- : Executes a provided function for each value in the
FontFaceSet.has()- : Returns a
Booleanasserting whether an element is present with the given value.
- : Returns a
FontFaceSet.keys()- : An alias for
values().
- : An alias for
FontFaceSet.load()- : Returns a
Promisewhich resolves to a list of font-faces for a requested font.
- : Returns a
FontFaceSet.values()- : Returns a new iterator object that yields the values for each element in the
FontFaceSetobject in insertion order.
- : Returns a new iterator object that yields the values for each element in the
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.