interface

FontFaceSet — CSS reference

A document font set tracks available FontFace objects and font loading. load requests matching faces; ready resolves when pending font loading and related layout settle. check tests whether rendering would require an unloaded face, not whether an arbitrary family exists or contains all glyphs.

Formal Syntax & Structure

css syntaxcss
document.fonts; fonts.load(font, text?); fonts.check(font, text?); fonts.ready

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS font lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}@font-face{font-family:LabFace;src:local("DejaVu Sans");font-display:swap} #a{font-family:LabFace,sans-serif}</style><body><p id="a">Office 012345 — typography</p><p id="b" lang="fa" dir="rtl">سلام دنیا</p></body></html>
CSS Reference