Skip to content

feat(data): use OpenMono as the mono typeface - #64798

Draft
iamdavidhill wants to merge 9 commits into
devfrom
openmono-data
Draft

iamdavidhill wants to merge 9 commits into
devfrom
openmono-data

Conversation

@iamdavidhill

@iamdavidhill iamdavidhill commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

No issue. This follows the release of OpenMono 1.000.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The data site (packages/data/app), its Open Graph cards and the shared nav menus set their text in OpenMono, Anomaly's typeface, built on Iosevka by Belleve Invis (SIL OFL 1.1). The files are the website's subsets of the OpenMono 1.000 build, so both sites serve the same bytes.

  • Family name. "OpenMono" in src/routes/index.css, with the stand-ins renamed to "OpenMono Menlo", "OpenMono Consolas" and "OpenMono Courier".
  • Layout does not move. The metrics are identical (advance 600 of 1000, ascender 965, descender 285, x-height 520, cap height 690). Only C, c, G and the letters built on them changed shape, by 0.002 em.
  • Weights. Unchanged: the Regular file serves 100 to 599 and the Bold file 600 to 900, so the page's 500 text stays Regular and its 600 and 900 text stays Bold.
  • Ligatures. Off, as before: the files have none.
  • Cyrillic. The language menu lists Русский and Українська, which OpenMono can now draw. They are in a cyrillic file of their own (18 kB, with the two stress marks), so a page fetches that and not the rest file, which is 122 kB now that the font has Greek, Vietnamese, Armenian and more. The cyrillic rule comes after the rest rule, which has the stress marks too, so a stressed word such as ру́сский fetches the Cyrillic file only (checked in Chromium).
  • Open Graph cards. The OG Worker's font modules are renamed to openmono-{regular,bold}-{latin,rest}.bin, in the build and in the pinned deploy targets. The deploy compares the two, so they change together. A card whose text is in the Latin file and has no C, c or G is pixel-identical.
  • Characters outside the Latin file now draw. Satori keeps one face per family name and weight, so with both files named alike the rest file was never used and ⚠, ✓ or ⥈ drew as the empty box. This was so before the rename. Each file now has a family name of its own (OpenMono, OpenMono Rest) and the card names both, which costs no bytes. A new test renders α, ⥈ and a character no file has, and fails if any two come out alike. With the final build the two rest modules are 414 kB and 407 kB (they were 90 kB each), and the OG Worker's files are 5.8 MB, 2.2 MB gzipped.
  • Common symbols in the Latin file. The site's Latin files now also have 27 common symbols (✓ ✗ ✕ ✖ ⚠ ∙ ⋅ ≈ ≠ ≤ ≥ ∞ √ ∑ ⋯ � and the numbers ⁰ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ₀ ₁ σ Σ), so a page or a card that shows one does not need the rest file. The Latin file grows by 1.5 kB.
  • This PR edits .github/release/targets/data/ (dev/og.json and production/og.json: the four font module names, nothing else). That path needs a review from its code owner, @thdxr.
  • Card cache. cardVersion goes from 2 to 3, so every page links a new image URL and the card is drawn with the new font the first time that URL is asked for. It does not purge the old URLs: a preview that a site has already unfurled stays as it is until that site fetches the page again, and an old URL can be served from the edge for up to 7 days, then one more day while it revalidates.
  • Nav menus. The fallback family in packages/nav-menus becomes "OpenMono". A host that does not set --nav-menu-mono gets that fallback, so it must load OpenMono or set the token. Hosts of the package:
    • packages/data/app (this PR): uses the fallback, and loads OpenMono here.
    • services/site: sets --nav-menu-mono, so it is not affected.
    • The Console repository's synced copy, used by its site and its status page (packages/status/public/nav-menus.css): neither sets the token on its dev. The Console must merge anomalyco/opencode-console#8139, which sets it in both, before it next syncs packages/nav-menus; otherwise its lockup and menus fall to the system monospace font.
    • A code search of the organisation finds no other copy.
Font bytes Before After
Regular Latin (preloaded) 19,084 29,416
Bold Latin 18,700 29,060
All served files 91,380 (4 files) 339,152 (6 files)
Of those, the two rest files 53,596 244,312

Feature flag. None. The data site reads no flags, and the pinned OG module names cannot be switched at run time. The gate was the font's release, and OpenMono 1.000 is out.

Refresh the fonts after the website's files change, from packages/data/app:

bun script/openmono.ts ../../../services/site/src/asset/fonts

It reads every file and checks each @font-face rule in index.css against the range of its own file before it writes anything, so a missing file or one stale rule leaves the app's fonts untouched. Until the website's PR is merged, give it that branch's folder.

Companion: #64796 (the website and docs). This PR can merge before or after it: it carries its own font files, and the website sets --nav-menu-mono and never uses the fallback family.

How did you verify your code works?

  • bun run check at the root (lint, and typecheck of every package), which the pre-push hook also ran. bun typecheck and bun test in packages/data/app (37 pass, including the OG Worker build and the new render test) and in packages/nav-menus (11 pass), and bun typecheck in services/data.
  • The OG Worker build lists exactly the modules in both pinned targets.
  • The new render test fails with the two files under one family name and passes with their own names.
  • The copy script with a source file missing, and with the Regular rules right and a Bold rule stale: each stops with "Nothing was written", names the file, and the app's fonts keep their hashes.
  • A model card and a lab card rendered from dev and from this branch: the letters change and the layout does not, and their ?v= values change.
  • /data/compare on the development server in Chromium, light and dark: the browser reports OpenMonoNerd-Regular and -Bold from the bundled files for all mono text, and the open nav menu resolves to OpenMono.
  • The main page needs the stats database, which was not available. It was checked as the deployed dev page with this branch's built stylesheets and fonts in place of the deployed ones: same 6,403 glyphs, all drawn by the bundled files, 0.009% of pixels differ.
  • Not checked: the deployed OG Worker, Safari, Firefox, Windows and Linux fallbacks, and phones.

Screenshots / recordings

Before After
Main page Data main page before Data main page after
Main page, dark Data main page in dark before Data main page in dark after
Link card Model link card before Model link card after

The main page is the deployed dev page; the after shots use this branch's stylesheets and fonts. Only the C, c and G change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant