-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Docs are available here: https://developers.google.com/fonts/docs/css2
Changes:
- different syntax for multiple font families - https://developers.google.com/fonts/docs/css2#multiple_families
- different format and style syntax - https://developers.google.com/fonts/docs/css2#axis_ranges
- "As a general note, the updated CSS API is more strict about what requests are accepted than the original CSS API." - https://developers.google.com/fonts/docs/css2#strictness
- a display parameter is supported - https://developers.google.com/fonts/docs/css2#use_font-display
- a text parameter is supported - https://developers.google.com/fonts/docs/css2#optimizing_your_font_requests
- the subset parameter is no longer supported
- for modern browsers, a font-face with a unicorn-range prop (https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face/unicode-range) is returned for each available subset
- for legacy browsers (https://caniuse.com/#feat=font-unicode-range), a font with all subsets is returned
- some info: v2 API for old browsers google/fonts#2379
Things to do:
- add a parser for v2 URLs
- make sure we handle https://fonts.google.com/xxx URLs correctly, as these can use both the v1 and the v2 format/style syntax
- unrelated, but we could also parse more than just the font family and weight from URLs - this also applies to v1 (and would fix Some characters look out of place when Latin Extended variant is used in URL #23)
- replace
--format
with something like--legacy-browsers
to download the font with all subsets (or the old API can be used when--format
is used) - add support for display and text parameters
- add support for additional axis like slnt - (https://developers.google.com/fonts/docs/css2#list_of_variable_fonts)
- make sure we handle fallback weights correctly - https://developers.google.com/fonts/docs/css2#legacy_browser_support
- use the new API for downloading
I wrote these notes down mostly for myself to slowly work through, but if anyone else wants to help, that's even better!
massimo-cassandro, timohausmann, AmirSavand, glen-84 and TechnologyClassroom
Metadata
Metadata
Assignees
Labels
No labels