WICG / local-font-access

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

Tease apart system fonts and font representations #78

Closed inexorabletash closed 2 years ago

inexorabletash commented 2 years ago

A first step at tackling #53 as well as some other feedback.

I will flesh out this PR with further changes that decouple the API from OpenType more. For example, https://www.w3.org/TR/css-fonts-4/#local-font-fallback uses wording like this:

Defined in terms of OpenType font data, the Postscript name is found in the font’s name table, in the name record with nameID = 6 (see [OPENTYPE] for more details).

So we can probably just say that a font representation has a serialization and a set of names, and that defined in terms of OpenType font data the serialization is SFNT and the names are name table entries 6 / 4 / 1 / 2.

BTW, w/r/t #53 I'm wanting to keep "font representation" as the abstract concept behind the "font metadata" (or now "font data"), and have it be a 1:1 association, rather than having a 3 way hop from system font → font representation → font data.


Preview | Diff

inexorabletash commented 2 years ago

(merging per offline conversation w/ jyasskin)