# ⚡ spark-html-font Font loading optimizer for [spark-html](https://www.npmjs.com/package/spark-html) sites — configure every font **once**, get the whole loading story: correct `@font-face` + `font-display`, preload links, and a **size-adjusted fallback face** so the swap doesn't shift the layout. Zero dependencies. ```js // spark.config.js — bake into every built page import prerender from 'spark-prerender/bun'; import font from 'spark-html-font/bun'; export default { pipeline: [prerender(), font({ fonts: [ { family: 'Inter', src: '/fonts/inter-var.woff2', weight: '100 900' }, { family: 'Fira Code', google: true, weights: [400, 700] }, ], })], }; ``` ```css body { font-family: var(--font-inter); } code { font-family: var(--font-fira-code); } ``` What lands in `
` (before ``, on every built page): - `` per self-hosted file — the fetch starts with the HTML; - an inline `