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

Improve glyphset viewing and embedding specific characters #8082

Open
kontur opened this issue Aug 24, 2024 · 0 comments
Open

Improve glyphset viewing and embedding specific characters #8082

kontur opened this issue Aug 24, 2024 · 0 comments

Comments

@kontur
Copy link
Contributor

kontur commented Aug 24, 2024

Describe the issue
Wondering why a css2 embedded font was lacking certain characters revealed a number of issues with embed documentation and font presentation. For example with this embed code:

<link href="https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap">

a website would not render "→" U+2192. The issues encountered along the chain of trying to debug this:

  1. The font page Gylphs tab seemingly shows the fonts character set, yet it actually shows an arbitrary selection of characters. This is misleading to the point of making the user think the font does not, in fact, include characters not listed here.
  2. The github documentation link on a font page links only to the project website, not the Google fonts repository of the font. To find the actual truth of what characters are currently in the Google fonts version the repository link should be added.
  3. Neither the embed code page nor the css2 API documentation page clearly state that the embed code will, in fact, load an arbitrary subset of the font.
  4. This subset is not readily documented anywhere I could find, other than by intercepting the webfont sent to the browser and inspecting it.
  5. The &text=... parameter could facilitate adding a specific character to the default charset, instead of requiring a full text. e.g. to use Work Sans for normal Latin text setting, but also including "→" the text parameter needs to be explicitly fed a url encoded full Latin charset, e.g. to add "→" (%E2%86%92) to the embed, instead of:

<link href="https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap&text=ABCDEFGH...........%E2%86%92">

the parameter could support a similar shortform:

<link href="https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap&additional_text=%E2%86%92">

To Reproduce
See the embed code above.

Expected behavior
A clear documentation that:

  1. Fonts are subset
  2. What that subset is
  3. How to add specific characters to an embed more easily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant