Closed k2s closed 2 years ago
Hi @k2s!
The plugin supports any href="..."
value.
If you check the CSS there are a lot of subsets in the response: https://fonts.googleapis.com/css2?family=Dosis:wght@400;600;700&family=Roboto:wght@400;500;700&display=swap&subset=latin,latin-ext
Somehow Google ignores the subset
parameter in this case.
Seams that Google ignores https://stackoverflow.com/questions/42172042/google-chrome-ignores-google-font-subset if requested with browser that supports unicode-range
.
If requested for example with curl
it will download different CSS.
Current situation will not increase download size, but it will make asset folder size bigger than necessary.
The plugin loads the CSS with Chrome/51.0.2704.103
User-Agent.
This is a standard and stable method to get woff2
fonts.
I understand this results a more extensive set of downloaded fonts but at the end of the day, the users will benefit from the locally served fonts.
I have
vite-plugin-webfont-dl injects into index.html also definition for other subsets like vietnamese, cyrillic-ext, etc.
Injected should be only definition for latin and latin-ext definitions.
Thank you.