[csswg-drafts] [css-font-loading] Expose the actual font / fallback status used for rendered text (#14379)

xfq has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-font-loading] Expose the actual font / fallback status used for rendered text ==
We often have typography-sensitive documents using locally installed fonts for which redistribution/webfont licensing or webfont files aren't available, but the web platform currently does not seem to expose an API for asking "which font painted these glyphs".

`getComputedStyle(element).fontFamily` does not solve it, since it gives you the computed CSS family list, not the font actually selected.

Now I can only do something like this:

```css
@font-face {
  font-family: "__Exact_Raleway";
  src:
    local("Raleway"),
  font-weight: 400;
  font-style: normal;
}

.example {
  font-family: "__Exact_Raleway";
  font-synthesis: none;
}
```

Then try to load that face:

```js
async function hasFont(family, sample = "Webforall 0123456789") {
  try {
    const faces = await document.fonts.load(
      `16px "${family}"`,
      sample
    );

    return faces.length > 0 &&
           faces.every(face => face.status === "loaded");
  } catch {
    return false;
  }
}

const ok = await hasFont("__Exact_Raleway");

if (!ok) {
  console.log("Raleway is not available; fallback is occurring.");
}
```

Chrome DevTools has **Elements → Computed → Rendered Fonts**, and Firefox's Inspector has a **Fonts** panel which reports "Fonts used", so browser engines already have the information we want, but it isn't exposed through a Web API.

Exposing the resolved font runs used to render existing DOM text would be very useful.

/cc @r12a

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/14379 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 24 August 2026 03:21:18 UTC