Fonts
dodeca automatically subsets fonts to only the characters used on your site, powered by fontcull.
How it works
- All rendered HTML is scanned for used characters
- Each font file is subsetted to only those glyphs
- The subsetted fonts get content-hashed filenames
- All CSS
@font-facereferences are rewritten
This typically removes 90%+ of the font file size. Variable fonts are preserved.
Usage
Place font files in your static/fonts/ directory and reference them in CSS:
css
@font-face {
font-family : "My Font" ;
src : url ( "/fonts/MyFont-Regular.woff2" ) format ( "woff2" );
font-weight : 400 ;
font-style : normal;
} dodeca handles the rest — subsetting, cache busting, and URL rewriting all happen automatically.