JS: The underrated Font Load API
developer.mozilla.org·17h·
Discuss: DEV

Concepts and usage

CSS stylesheets allow authors to use custom fonts; specifying fonts to download using the @font-face rule, and applying them to elements with the font-family property. The point at which a font is downloaded is controlled by the user agent. Most agents only fetch and load fonts when they are first needed, which can result in a perceptible delay.

The CSS Font Loading API overcomes this problem by letting authors control and track when a font face is fetched and loaded, and when it is added to the font face set owned by the document or worker. Adding a font face to the document or worker font face set allows the user…

Similar Posts

Loading similar posts...