- Issue created by @dasginganinja
- πΊπΈUnited States dasginganinja Bethlehem, PA
Attaching a patch we used to slim down this to 800kb.
- πΊπΈUnited States dasginganinja Bethlehem, PA
Just some additional comments on this:
There are four parameters that can be used to size these URLs down. People probably won't need all of them. This module might want to make this configurable? Maybe?I was able to get the outlined fonts to <300kb with this URL for reference:
//fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..400,0..1
- π§π·Brazil mabho Rio de Janeiro, RJ
Yes, I see you have patched the module for your specific use-case. As you say, making it configurable is probably the way to go, otherwise, we would be limiting users' options and flexibility when applying the icons.
- π¨π¦Canada b_sharpe
I'd be in favor of using the "Most popular" set, and then anyone with other needs could use library overrides.
- π§π·Brazil gabriel.passarelli
Per Fonts API documentation when no additional paramenter is provided to the fontsapi URL, the default configuration for each axis, with weight at 400, optical size at 48, grade at 0 and fill (also 0.) is requested.
When the Material symbols change was added to the module, the fonts were requested with all possible variations filter
:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200
this is why the size increased a lot.If we follow that standard that we already have in the module, the other fonts that were already present in the module, the correct approach would be to load the fonts without any additional filter.
Here's a patch where I've changed the fonts to be loaded without any additional filters.
This patch applies to all fonts, but as example the Material Symbols Rounded was reduced from 4.5mb to 387kb