feat-agency / vite-plugin-webfont-dl

⚡ Webfont Download Vite Plugin - Make your Vite site load faster
MIT License
302 stars 11 forks source link

Allow to limit to used glyph #57

Closed riderx closed 1 month ago

riderx commented 1 month ago

Currently, the downloader will download all glyph, no matter which one used in the project, a regex or something to allow us to filter would be great and reduce a lot of the bandwidth.

Most font are used for uft8, example of project doing it: https://github.com/vintagedave/Fontimize

0xb4lint commented 1 month ago

This plugin doesn't analyze webfont CSS or font files; it simply downloads them as they are. However, in certain scenarios, you can optimize the CSS and font files on the webfont provider's side.

For example, Google Fonts allows optimization through the &text=abc... parameter, which you can read more about here: https://developers.google.com/fonts/docs/css2#optimizing_your_font_requests