Track · fonts
Fonts track
Self-hosted @font-face CSS + subsetted WOFF2 binaries. No third-party font CDN dependencies — Urja owns the binaries end-to-end.
Endpoints
| Route | Auth | Purpose |
|---|---|---|
GET /api/v1/fonts?format=css&families=display,sans | public | @font-face declarations + :root type aliases. |
GET /api/v1/fonts/:family/:slug | public | Raw WOFF2 binary. |
GET /api/v1/fonts | studio:v1:use | JSON catalog (registered faces + scale). |
Drop-in setup
<!-- Preload the above-the-fold face -->
<link rel="preload"
href="https://urja.insightsbyomkar.com/api/v1/fonts/display/display-400-normal-latin.woff2"
as="font" type="font/woff2" crossorigin="anonymous" />
<!-- @font-face declarations -->
<link rel="stylesheet"
href="https://urja.insightsbyomkar.com/api/v1/fonts?format=css&families=display,sans" />
CSS emits one @font-face per registered variant pointing at the WOFF2 route, plus a :root block exposing the aliases:
:root {
--ifv-font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
--ifv-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
Hosts can consume via the semantic tokens track's --ds-font-* references, which wrap these aliases with fallbacks.
Families today
| Family | Role | Source | Weights | Optical size |
|---|---|---|---|---|
display | Display / headlines | Fraunces (OFL-1.1) | 400–700 (variable) | 9–144 |
sans | Body / UI | Inter (OFL-1.1) | 400–700 (variable) | — |
Both subsetted to latin + latin-ext via HarfBuzz-WASM. Binaries committed at data/fonts/*.woff2 (~447 KB total); regenerable via npm run fonts:sync.
Note: Fraunces is a Phase 1 placeholder. A commissioned display face is planned for months 4–6 — the slug contract stays stable across the swap, so consumers don't change anything.
WOFF2 binary paths
/api/v1/fonts/display/display-400-normal-latin.woff2
/api/v1/fonts/display/display-400-normal-latin-ext.woff2
/api/v1/fonts/display/display-700-normal-latin.woff2
/api/v1/fonts/sans/sans-400-normal-latin.woff2
/api/v1/fonts/sans/sans-500-normal-latin.woff2
/api/v1/fonts/sans/sans-700-normal-latin.woff2
Slugs are allowlisted against the registry — unknown / traversal slugs 404 before any filesystem read.
Response contracts
- CSS:
Content-Type: text/css,Cache-Control: public, max-age=86400, s-maxage=604800, immutable. - WOFF2:
Content-Type: font/woff2,Cache-Control: public, max-age=31536000, immutable(1 year).
Variant paths are content-addressed — a slug change means a new URL, so long cache is safe.
