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

Support "text" parameter for font queries #36

Closed
Hanziness opened this issue Nov 20, 2020 · 2 comments · Fixed by #44
Closed

Support "text" parameter for font queries #36

Hanziness opened this issue Nov 20, 2020 · 2 comments · Fixed by #44
Labels
enhancement New feature or request

Comments

@Hanziness
Copy link

Hi!
I've recently noticed that the Google Fonts CSS API v2 has an option to not only specify the subset parameter for a font but also a text one: this is a (URL-enconded) string that contains the characters you want to use from the font and only these will be downloaded. For example, the following URL will result in only the number glyphs being downloaded for the Source Sans Pro font's bold weight, saving a lot of bandwidth by not downloading a full Latin subset of it.

https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@700&display=swap&text=1234567890

Unfortunately, this module does not seem to support this parameter so I ended up manually importing the font for now, but I would love to see it support this part of the API, too -- especially since I cannot use some of the module's convenient features this way, like automatic prefetching.

If specified, text should be used instead of subset, details here.

Is there any plan to implement the handling of this parameter?

@ricardogobbosouza
Copy link
Collaborator

Hi @Hanziness

I will add this option by the end of the week.
datalogix/google-fonts-helper#8

Thanks for reporting 😄

@ricardogobbosouza ricardogobbosouza added the enhancement New feature or request label Dec 16, 2020
@Hanziness
Copy link
Author

Awesome, thank you very much! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants