FontFaceSet: ready-Eigenschaft

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Hinweis: Diese Funktion ist in Web Workers verfügbar.

Die schreibgeschützte Eigenschaft ready der FontFaceSet-Schnittstelle gibt ein Promise zurück, das auf das gegebene FontFaceSet auflöst.

Das Promise wird erst aufgelöst, wenn das Dokument das Laden von Schriftarten abgeschlossen hat, Layout-Operationen abgeschlossen sind und keine weiteren Schriftarten geladen werden müssen.

Wert

Ein Promise, das auf das gegebene FontFaceSet auflöst.

Beispiele

Im folgenden Beispiel wird der Wert von ready in die Konsole ausgegeben, sobald das Promise aufgelöst wurde.

js
async function isReady() {
  let ready = await document.fonts.ready;
  console.log(ready);
}

isReady();

Spezifikationen

Specification
CSS Font Loading Module Level 3
# dom-fontfaceset-ready

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ready

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support