vonbelk.fonts
← all posts

How to Subset Fonts to Shrink File Size

Many fonts contain thousands of glyphs covering dozens of languages. If your site only uses English, most of that is dead weight. Subsetting trims a font to just the characters you need — often shrinking it dramatically.

What subsetting does

It produces a new font file containing only a chosen set of glyphs — say, basic Latin letters, numbers, and common punctuation — and drops the rest. The font looks identical for your content but downloads much faster.

How to do it

The standard open-source tool is fontTools. A typical command keeps Latin characters:

pyftsubset MyFont.ttf \
  --unicodes=U+0000-00FF \
  --flavor=woff2 \
  --output-file=MyFont.subset.woff2

This outputs a compressed WOFF2 containing only the specified range.

When to subset — and when not to

  • Do it for production web fonts on single-language sites.
  • Be careful with user-generated content, which may include characters you didn't anticipate. Include the ranges you actually need.
  • Skip it for downloadable desktop fonts — users expect the complete glyph set.

Subsetting is one of the highest-impact font optimizations available, and the tooling is free.

Sources & further reading

Advertisement