Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a definition for getting fonts from the system #53

Closed
jakearchibald opened this issue Oct 8, 2020 · 0 comments
Closed

Create a definition for getting fonts from the system #53

jakearchibald opened this issue Oct 8, 2020 · 0 comments
Labels
spec-text Wording/algorithm improvements
Milestone

Comments

@jakearchibald
Copy link

Right now the spec says "For each local font font on the system".

I think it'd be better to create definitions for this. Eg:

Font metadata has:

  • A postscript name, a DOMString.
  • A full name, a DOMString.
  • A family, a DOMString.

A system font is a font that is available system-wide by the operating system.

To read a system font as a font representation… (this lets you detail the kinds of filtering a browser may perform here)

To get all system font metadata, perform the following steps:

  1. Let |fonts| be a subset of [=system fonts=] [=read as font representations=]. Subsetting may be defined by the user agent, and can include safelists, or a selection UI shown to the user.
  2. Let |fontMetadatas| be a new list.
  3. [=For each=] |font| of |fonts|:
    1. Let |metadata| be a new [=font metadata=].
    2. Set |metadata|'s [=postscript name=] to…
    3. Etc etc
  4. Sort |fontMetadatas| by…
  5. Return |fontMetadatas|.
@jakearchibald jakearchibald mentioned this issue Oct 8, 2020
@inexorabletash inexorabletash added the spec-text Wording/algorithm improvements label Apr 30, 2021
@inexorabletash inexorabletash added this to the MVP milestone Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec-text Wording/algorithm improvements
Projects
None yet
Development

No branches or pull requests

2 participants