Generate Production @font-face & Preload CSS
Drop your WOFF2, WOFF, TTF, or OTF font files to auto-detect weights, italics, and variable ranges and emit production @font-face CSS, crossorigin preload HTML, and Anti-CLS fallbacks.
.woff2 · .woff · .ttf · .otf
- Auto weight/italic detection
- Includes crossorigin preload
- Optional Anti-CLS overrides
Benchmark & Expected Output
@font-face + preload snippetBefore (Input)
WOFF2 / TTF / OTF · inter-regular.woff2 (51 KB)
After (Output)
CSS + HTML Preload · @font-face { font-display: swap } + <link rel="preload"> snippet
| Property | Source: WOFF2 | Target: CSS @font-face |
|---|---|---|
| File extension | .woff2 | .css |
| Compression | Brotli (entropy + table transform) | Text / optional gzip |
| Outline / Curve | Quadratic or Cubic SFNT | CSS / Data URI Text |
| Browser support | All Modern Browsers (97%+) | Universal (Web + OS) |
| OpenType GSUB/GPOS | Yes | Yes |
| Best for | Production web typography across all modern browsers, delivering 40%–60% smaller payloads than TTF/OTF and ~30% smaller files than WOFF 1.0. | Loading self-hosted WOFF2 fonts with font-display: swap, unicode-range lazy slices, and zero-CLS size-adjust fallbacks. |
How it works
How to use @font-face CSS Generator locally in your browser
Generate clean @font-face CSS with font-display, variable weight ranges, <link rel='preload'>, and Anti-CLS fallbacks.
Drop font files
Add one or multiple weights from your self-hosted font folder.
Configure CSS options
Set your font URL prefix (e.g. /fonts/), font-display, preload tags, and CLS fallback preset.
Copy production CSS
Paste the generated @font-face + preload tags straight into your app.
FAQ
Frequently asked questions
Why does the generated preload link include crossorigin?
Font preloads always use anonymous CORS mode in browsers; omitting crossorigin causes duplicate double-downloads.
Does it auto-detect font-weight for variable fonts?
Yes. When fvar wght is present, it outputs ranges like font-weight: 100 900 automatically.
Can I include Anti-CLS fallback rules inside the same stylesheet?
Yes — keep 'Include Anti-CLS fallback CSS' enabled to include metric overrides automatically.
Format specs
Next step