Bloggings

Back

Reducing web font size

2025-04-06

I stumbled on a marvellous post

I started using the Jetbrains font for this blog, but adding the font in the css file makes it pretty heavy, and I've been considering removing it. BUT...

I stumbled on this post and tried Neil's suggestion on the JetbrainsMono-Regular truetype font, and the font filesize was reduced from 274k to 66Kb

pipx install fonttools pyftsubset JetbrainsMono-Regular.ttf --output-file=JetbrainsMono-Regular-reduced.ttf --unicodes=U+0020-007E

So I decided to try it on the JetBrainsMono Regular Nerdfont, a whopping 2.4Mb, but the result was even better, 18Kb!

.rw-r--r-- 66k philip 6 avril 23:04 JetBrainsMono-reduced.ttf .rw-r--r-- 18k philip 6 avril 23:20 JetBrainsMonoNerd-reduced.ttf

Understanding why will take a bit of forensics, in the mean time this blog has become much lighter.

Update

I wound up just using the default monospace for the main text, and Ultra (reduced) for the title .

 


ยง