WICG / local-font-access

Web API for enumerating fonts on the local system
https://wicg.github.io/local-font-access
Apache License 2.0
76 stars 16 forks source link

Browser fallback font information #93

Open my2iu opened 2 years ago

my2iu commented 2 years ago

It might be nice if the font API also exposed what fallback fonts the browser is using. So, if I need to render some sans-serif text, and it's missing some Chinese and Hindi characters shapes, Chrome knows how to fallback to other fonts for those characters. It would be great if I could query the browser for how it handles those fallbacks, so then I could emulate that behavior in JavaScript and substitute fonts in the same way for missing characters.

inexorabletash commented 2 years ago

This sounds more like a DOM question, e.g. given a specific character in a text run, what actual font was used to render it.

Also potentially related to https://github.com/WICG/canvas-formatted-text ?