Introducing Fontimize| Subset Fonts to Exactly and Only Your Website's Used Characters ⸺ Dave on Design
Fontimize: Subset Fonts to Exactly and Only Your Website's Used Characters
A Python library to subset fonts, which cuts ~95% from the size of your site’s font files & downloads/bandwidth. To use: from fontimize import optimise_fonts_for_files and call it with a list of HTML files. See the the full API docs for more info.
Find Fontimize on Github and PyPi.
https://github.com/vintagedave/Fontimize/issues/1
I randomly came across your blog post on this library and thought I'd take a look at the code. I noticed you have an accidental O(n^2) string concatenation. In a few places in your code, you're appending lists of strings. This is a problem as it creates new intermediate strings in each iteration. Here is one such example:
January 13, 2024 at 10:50:38 AM EST
*
FILLER