• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
Filters

Introducing Fontimize| Subset Fonts to Exactly and Only Your Website's Used Characters ⸺ Dave on Design

QRCode

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:

https://daveon.design/introducing-fontimize-subset-fonts-to-exactly-and-only-your-websites-used-characters.html
January 13, 2024 at 10:50:38 AM EST *
python fonts webdesign
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community