Skip to content
All projects

Case study

Glyphcut

A font subsetting CLI that cut web font payloads by 71% on average

Glyphcut scans your built site, finds every character you use and writes subset WOFF2 files with matching unicode ranges, in under a second.

The problem

A variable font with every language it supports is often 300 KB or more. Most sites use a few hundred characters from it. The existing subsetters needed Python and a list of characters you had to maintain by hand.

What I built

Glyphcut reads your build output (HTML, JS and CSS), collects every code point that can reach the screen, and writes a subset per font with a unicode-range rule to match. Anything it might have missed, like text injected at runtime, goes into a small fallback file that loads only when needed.

How it performs

On the 38 production sites in the benchmark suite, the median font payload dropped from 186 KB to 54 KB. The slowest run, a documentation site with 2,900 pages, takes 0.8 seconds.

What I learned

Parsing fonts is easy. Knowing which text can appear is the hard part. The fallback file exists because I was wrong about that twice in the first month.