Is there a way to subset fonts in order to reduce the size of the font sent over the network?
I’ve previously used the hb-subset crate for this in one of my own projects, but I’m not sure how I can apply that to zola’s output.
Is there a way to subset fonts in order to reduce the size of the font sent over the network?
I’ve previously used the hb-subset crate for this in one of my own projects, but I’m not sure how I can apply that to zola’s output.
In particular:
How does this work with HTML? doesn’t look like it can properly parse HTML files.
Personally, I just pick out the Unicode ranges I need for the whole site (usually U-0000 to U-00FF, plus anything incidental from other ranges), or if it is just for a phrase for some title text or suchlike you can tell it to just pick the glyphs for that phrase by giving it the actual text.
You could also just feed it the output html files as text files if you wanted – it would only add a few ASCII characters from the tags. My font files usually end up around 15kB, which, combined with preloading and immutable caching is more than good enough to use –font-display: block with no discernible pause; optimising beyond that is definitely not worth the effort.