このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

FontFaceSet: loading イベント

Baseline 2025
Newly available

Since December 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

loading イベントは、文書がフォントの読み込みを始めるときに発行されます。

構文

このイベント名を addEventListener() などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。

js
addEventListener("loading", (event) => {});

onloading = (event) => {};

次の例では、フォント Ephesis が読み込まれ始めると、"Font is loading..." とコンソールに表示されます。

js
document.fonts.onloading = () => {
  console.log("Font is loading");
};

(async () => {
  await document.fonts.load("16px Ephesis");
})();

仕様書

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

ブラウザーの互換性