Skip to content

Load fonts from the repo instead of Google Fonts at build time - #1185

Merged
helpcodeai merged 1 commit into
mainfrom
helpcodeai/local-fonts
Oct 21, 2026
Merged

helpcodeai merged 1 commit into
mainfrom
helpcodeai/local-fonts

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

next/font/google fetches Geist and Geist Mono from Google Fonts during next build. When that fetch fails the build stops with "Can't resolve '@vercel/turbopack-next/internal/font/google/font'", which broke the Frontend and Docker build jobs a few times on 19 and 20 Oct (#1150, #1179, main).

This commits the fonts and loads them with next/font/local:

  • packages/frontend/src/fonts/geist/: Geist-Variable.woff2 (69 KB) and GeistMono-Variable.woff2 (71 KB) from the vercel/geist-font v1.8.1 release, plus OFL.txt.
  • Same --font-geist-sans / --font-geist-mono variables, weights (400-700 sans, 400-500 mono), display: swap and Arial-based fallback.
  • unicode-range is the union of the subsets Google served, so characters Google didn't cover (arrows, for example) still fall back to the system font like today.
  • No new dependency, lockfile untouched. The Dockerfile already copies all of packages/frontend/.

Checked:

  • next build passes with every proxy pointed at a dead port; main fails the same way CI does under that setup.
  • /login before and after on the standalone build: computed font-family, weights and element boxes are identical and the screenshots match pixel for pixel.
  • lint, tsc, build and the Playwright suite (223 passed).

Small differences: the mono family is now called GeistMono (the local loader names the family after the constant), and the preloaded files are the full variable fonts (69 + 71 KB instead of 29 + 23 KB for the latin slices).

next/font/google downloads Geist and Geist Mono during next build, and a
failed fetch kills the build (frontend CI and Docker build jobs). Commit the
variable woff2 files of the vercel/geist-font v1.8.1 release with their OFL
licence and load them with next/font/local. Weight ranges, display and the
--font-geist-* variables are unchanged, and unicode-range matches the
subsets Google served so rendering stays the same.
@helpcodeai
helpcodeai enabled auto-merge (squash) October 21, 2026 11:57
@helpcodeai
helpcodeai merged commit 25a4eb8 into main Oct 21, 2026
15 checks passed
@helpcodeai
helpcodeai deleted the helpcodeai/local-fonts branch October 21, 2026 12:01
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant