Pure Rust font subsetting library powered by klippa.
See the fontcull crate documentation for API details and examples.
The fontcull-cli crate provides a command-line tool that:
- Opens URLs in a headless browser (via chromiumoxide)
- Extracts all glyphs/characters used on the page (including
::before/::afterpseudo-elements) - Optionally spiders the site to find more pages
- Subsets font files to only include the characters actually used
cargo install fontcull-cliRequires Chrome/Chromium installed (uses your system browser, no specific version needed).
# Just get the unicode range of characters used
fontcull https://example.com
# Subset fonts based on page content
fontcull https://example.com --subset=fonts/*.ttf
# Spider multiple pages
fontcull https://example.com --spider-limit=10 --subset=fonts/*.ttf
# Filter by font family
fontcull https://example.com --subset=fonts/*.ttf --family="My Font"
# Add extra characters to always include
fontcull https://example.com --subset=fonts/*.ttf --whitelist="0123456789"Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.