Skip to content

feat(fonts): load geist mono for the tool panels - #266

Merged
yigitdot merged 2 commits into
mainfrom
claude/geist-mono-font-loading-67d4db
Oct 5, 2026
Merged

yigitdot merged 2 commits into
mainfrom
claude/geist-mono-font-loading-67d4db

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

Loads Geist Mono through next/font/google, the same way the site already loads Geist Sans, and puts it first in --font-mono. The hero terminal, the Contact fleet panel and prose code/pre now use the same font on every platform. Before this, everything except Apple devices fell back to Menlo, Courier New or the browser default.

  • app/layout.tsx: adds Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], weight: ["400","500","600","700"] }) and puts its variable on <html>.
  • app/globals.css: the old system list moves to a new --font-mono-system token, and --font-mono becomes var(--font-geist-mono), var(--font-mono-system).
  • components/site/FleetStatus.tsx: wraps the Σ in the two 24h labels in a .fleet-sigma span (see below).

Characters Geist Mono doesn't have

Google's Geist Mono files leave out → (U+2192), ✓ (U+2713) and Σ (U+03A3). The extra symbols2 subset covers only box-drawing characters. Without a fix, → and Σ land in the fallback face next/font generates, a resized Arial, where the terminal arrow is 16.5px wide against a 7.4px character cell. That pushes the text on each arrow line out of line with the rest of the terminal. Σ in the fleet labels rendered about 35% taller than the letters around it. (✓ isn't in Arial either, so it already fell through to the system font.) adjustFontFallback: false should drop that fallback, but it has no effect in this build: the generated CSS still contains the Arial face. So:

  • .terminal .arrow, .terminal .ok, the fleet's .fleet-sigma and the drawer's .mm-arrow use --font-mono-system directly. They render exactly as they did before this PR and each takes one character cell.
  • The terminal glyphs and .fleet-sigma also get line-height: 1. Without it, mixing two fonts' vertical metrics on one line made each affected line about 1px taller.

Cost

Geist Mono is a variable font, so the four weights share one file per character subset. The build adds 6 woff2 files (~68K total), and only the 22.6K Latin one is preloaded. The others load only on pages that use their characters. The CSP is unchanged because next/font self-hosts the files (font-src 'self').

Verification

  • pnpm typecheck, pnpm lint, pnpm format:check and pnpm test (520 passing) all pass, as does pnpm build including check:out and check:og-image.
  • Compared on the static export at 375px and desktop width, swapping Geist Mono against the system font in the same page:
    • Terminal text widths are within 1px of the system font. The longest line at 375px is 282px in a 289px space, so the 140px .progress line still fits.
    • Terminal panel height is 216px with both fonts; fleet panel is 520px with both.
    • Fleet rows (56px 14px 1fr) wrap and line up the same as before. The 700-weight summary value renders bold.
    • Σ is one 7.5px character cell, and the 24h label rows are 20.1px tall with both fonts.
  • Two review agents (code and comments) found no critical issues. The Σ fallback and some comment wording they flagged are fixed in the second commit.

Not checked: I only checked on macOS. Windows and Android rendering, and a throttled-network reload to watch the font swap in, haven't been done.

Closes #257

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

@yigitdot
yigitdot merged commit 8fec7f1 into main Oct 5, 2026
5 of 7 checks passed
@yigitdot
yigitdot deleted the claude/geist-mono-font-loading-67d4db branch October 5, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

load geist mono so the tool panels render the same everywhere

2 participants