mirror of
https://github.com/bitbaum/petvity.git
synced 2026-12-04 15:47:01 +01:00
next/font/google downloaded the faces from fonts.gstatic.com **at build time**, which put a third party on the critical path of every CI run and every deploy. It failed twice in one week — module-not-found on the generated @font-face for Jost — blocking a merge each time, both on changes that had nothing to do with typography. A build that only succeeds when Google is reachable cannot be trusted to ship an urgent fix, and re-running until it passes is not a fix. The four .woff2 files are now vendored in lib/font-files/ and declared with next/font/local. 82 KB total, which also removes a render-blocking third-party connection for every visitor. Only the `latin` subset is vendored, matching the previous `subsets: ["latin"]` exactly — ja/zh/ko/ar and the Turkish latin-ext glyphs fell back to system faces before and still do. Plus Jakarta Sans (400–800) and Jost (200–400) are variable fonts, so each is a single file; IBM Plex Mono ships no variable axis and keeps its two static weights. scripts/fetch-fonts.mjs regenerates the files and documents where they came from. It is deliberately NOT wired into the build — doing so would reintroduce the exact network dependency this removes. Verified rendering is unchanged, not merely similar: measured actual glyph advance widths with a Range over the live hero text on prod (Google-hosted) and on the local build (self-hosted). Identical to three decimals — h1 669.688px, eyebrow 222.641px — and the screenshots are pixel-identical. The emitted @font-face URLs are now local ../media/*.woff2 with no gstatic reference in the build output. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>