Repository navigation
feat(site): use OpenMono as the mono typeface - #64796
Draft
iamdavidhill wants to merge 9 commits into
Draft
iamdavidhill wants to merge 9 commits into
iamdavidhill wants to merge 9 commits into
Conversation
This was referenced Nov 19, 2026
simonklee
pushed a commit
to anomalyco/opentui
that referenced
this pull request
Nov 19, 2026
The site moves from its own Iosevka build, OpenTUI Mono, to OpenMono, Anomaly's monospace family. OpenMono grew out of OpenTUI Mono. It is built on Iosevka by Belleve Invis, under the SIL Open Font License 1.1. The font files are the ones that the OpenCode website serves. They are subsets of the OpenMono 1.000 build, made in the `anomalyco/opencode` repository by `services/site/script/openmono.py`. Until it merges, that script is in the open pull request anomalyco/opencode#64796. Each style is split by `unicode-range`, so a page loads only the files that its text needs. ## First visit Font bytes that a page loads with an empty cache, measured in Chromium: | Page | `main` | This change | |-|-|-| | Home | 138,196 B | 54,160 B | | Box (code, terminal frames) | 138,196 B | 54,160 B | | Embedded terminal (diagram, terminal frame with `✓`) | 138,196 B | 88,512 B | | Native overview (diagrams, italic text) | 219,928 B | 84,636 B | | Keymap addons (one Cyrillic letter) | 138,196 B | 72,312 B | The `@font-face` rules now have `unicode-range` lists, so the CSS of `Minimal.astro` is 8.6 KB (1.7 KB with gzip). Astro inlines a stylesheet below 4 KB and writes a larger one to a file. The home page had no stylesheet request and now has one. A documentation page had two and now has three. ## What changed - `public/fonts/` has ten files: `latin`, `cyrillic`, and `rest` for Regular and Bold, and `latin` and `rest` for Italic and Bold Italic. `layouts/Minimal.astro` declares them as the `OpenMono` family with the `unicode-range` of each file. It preloads Regular `latin`, where it preloaded Regular before. `styles/terminal-illustration.css` names the same family. - `public/fonts/LICENSE` is the license file that comes with the files, with one line above it that names their source. - `.prose .box-figure pre` no longer sets `font-feature-settings: "NWID"`. OpenTUI Mono drew arrows and geometric shapes two cells wide and needed that feature in diagrams. OpenMono draws them one cell wide by default. - `bun run fonts:update <folder>` copies the files from an `anomalyco/opencode` checkout. Then it compares the `unicode-range` of each rule in `Minimal.astro` with `openmono.json` from that folder and fails if they differ. - `AGENTS.md`, two code comments, and the recordings README use the new name. - Sizes, weights, line heights, `font-display`, and ligature settings are not changed. The files have no ligatures, as before. ## What was removed - `src/font/private-build-plans.toml`, the Iosevka build plan. The site no longer compiles a typeface. - The build steps in `src/font/README.md`. The file now says where the font files come from and how to update them. - `/lab/font` (`src/pages/lab/font.astro`) and `public/fonts/candidate/`. They compared the live files with the next compile. ## What a reader sees Metrics are identical in all four styles: 1000 units per em, 600 advance, ascender 965, descender −285 (`hhea` −220, line gap 65), x-height 520, cap height 690. OpenTUI Mono had 1,627 characters. In Regular: | Characters | Count | Difference | |-|-|-| | Identical outline | 952 | None. This includes box drawing and block elements. | | Same shape, other curve points | 402 | None. The bounding box and the area are equal. | | Redrawn | 39 | The terminals of `C`, `G`, and `c`, and the letters built from them (`Ç ç Ć ć`, Cyrillic `С с`, `¢ ©`, and more). | | Narrower | 233 | Two cells before, one cell now: arrows (U+2190–21FF), most geometric shapes (U+25A0–25FF), `—`, `…`, `‰`, and some math operators. The shape is the old `NWID` form. | | Not in the files | 1 | `⇧` (U+21E7). No page uses it. | The files also have 43 characters that OpenTUI Mono did not have, such as `✓ ✕ ✗ ⚠ ⚙ ⟳ ✱`. They used a fallback font before. The identity glyphs `a g l I 1 0 8 6 9 @ { } ( ) _ *` are the same shape in every style. Coverage is narrower than with the old files in two cases. No page has either one. - Italic and Bold Italic have no Cyrillic file, so italic text in Cyrillic uses a fallback font. Regular and Bold have Cyrillic. Keymap addons draws its Cyrillic letter from the bundled file. - A letter and a combining mark (U+0300–036F) are in different files. A pair that has no precomposed character, such as `x̂`, uses a fallback font. Precomposed letters such as `é` are in `latin`, and `e` with a combining acute still draws as `é` from that file. Braille patterns and CJK are in neither typeface. The browser still uses a fallback font for them, for example in the recordings. On seven pages at 1440px, the page height and the size of each paragraph, code block, table, diagram, and recording are equal before and after. The visible differences are the `C`, `G`, and `c` terminals and the narrower symbols outside diagrams: the em dash (a paragraph in "What's Next for OpenTUI" wraps one word earlier), `→` in one table in Native resources, and `…`. | | Before | After | |-|-|-| | Home |  |  | | Embedded terminal, light |  |  | | Embedded terminal, dark |  |  | ## Bytes in the repository | Files | Before | After | |-|-|-| | Regular | 69,408 B | `latin` 27,280 B, `cyrillic` 18,152 B, `rest` 34,352 B | | Bold | 68,788 B | `latin` 26,880 B, `cyrillic` 17,724 B, `rest` 34,212 B | | Italic | 81,732 B | `latin` 30,476 B, `rest` 38,712 B | | Bold Italic | 81,504 B | `latin` 30,296 B, `rest` 38,888 B | | Candidate copies of the four files | 301,432 B | removed | | Total | 602,864 B | 296,972 B | ## Update the fonts ``` cd packages/web bun run fonts:update <opencode checkout>/services/site/src/asset/fonts ``` `src/font/README.md` has the details. ## Tested From `packages/web`, as `build-web.yml` does: - `bun run validate:docs:metadata`, `validate:docs:links`, `validate:docs:skill`, and `validate:docs:releases` pass. - `bun run api:check` passes. - `bun run test:site` passes (132 tests). `bun run test:packages` (15) and `bun test scripts/theme.test.ts` (19) pass. - `bun run build:site` builds both documentation channels and validates the links. The output has no reference to the old files. - `bun run fmt:check` and `bun run lint` pass from the repository root. With fontTools: - Each bundled file has exactly the characters of its `unicode-range`. The outlines, advances, and metrics are equal to the unsplit OpenMono files. - Every character of OpenTUI Mono except `⇧` is in a bundled Regular and Bold file. The italics also lack Cyrillic. In Chromium, with `bun run dev`: - The first-visit numbers and the screenshots above. - `CSS.getPlatformFontsForNode` reports the bundled files for body text, headings, navigation, code, tables, diagrams, terminal frames, and recordings. Box drawing and block elements are in `latin`, so diagrams and terminal frames need no other file. - `scripts/prose-layout.check.mjs` passes on five pages with text diagrams, without the `NWID` rule. - Nine pages have no horizontal overflow at 390px, 768px, 1025px, and 1440px. ## Not tested - `bun run test:docs`. Four tests in `scripts/doc-visuals.test.ts` need the native library, which I did not build. They fail the same way on `main`. - Safari and Firefox. - The blue and cobalt themes. - The deployed site.
3 of 6 tasks
simonklee
pushed a commit
to anomalyco/opentui
that referenced
this pull request
Nov 21, 2026
This follows #2159. That change gave the site the first build of OpenMono 1.000. This change brings the site to the final build (2026-11-19). The font files are again the ones that the OpenCode website serves. They are subsets of the final OpenMono 1.000 build, made in the `anomalyco/opencode` repository by `services/site/script/openmono.py`. Until it merges, that script is in the open pull request anomalyco/opencode#64796. ## What changed - **New characters.** Each style has 3,552 characters. Regular and Bold had 1,669, and Italic and Bold Italic had 1,363. The new ones are in `rest`: Greek and Greek Extended, Vietnamese, Armenian, more of Latin Extended-B and IPA, and letterlike and technical symbols. The Vietnamese letters with two accents, such as `ấ` and `ữ`, are in the form that the final build redrew. The earlier files did not have them. - **Shortcut keys.** `latin` now has `⇧` and `⌃ ⌘ ⌥ ⌫ ⎋ ⏎`. #2159 listed `⇧` as the one character of OpenTUI Mono that was not in the files. - **Common symbols.** `latin` also has 27 common symbols: `✓ ✗ ✕ ✖ ⚠ ∙ ⋅ ≈ ≠ ≤ ≥ ∞ √ ∑ ⋯ �`, `⁰ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ₀ ₁`, and `σ Σ`. In the files from #2159, those that existed were in `rest`. A page with `✓` no longer loads `rest`. - **Italic Cyrillic.** Italic and Bold Italic now have `cyrillic` files. With this, every style has all 1,627 characters of OpenTUI Mono. - **License.** `public/fonts/LICENSE` has Iosevka's exact copyright line: `Copyright (c) 2015-2026, Renzhi Li (aka. Belleve Invis, belleve@typeof.net)`. The font README gives the same name. - **Rules.** `layouts/Minimal.astro` has twelve `@font-face` rules with the new ranges of `openmono.json`. The `cyrillic` rule of each style is now after its `rest` rule. Both files have the stress marks U+0300–0301, and the browser uses the last rule that has a character. Cyrillic text with a stress mark therefore loads only the `cyrillic` file. - **Script.** `bun run fonts:update <folder>` copies twelve files and also fails if the rules of a style are in another order. The characters that the site already had keep their outline, metrics, and advance. The exceptions are `⎇` (Bold, Italic, Bold Italic) and `⌕` (Italic, Bold Italic). No page uses them. ## First visit Font bytes that a page loads with an empty cache, measured in Chromium: | Page | Live (#2159) | This change | |-|-|-| | Home | 54,160 B | 58,476 B | | Box (code, terminal frames) | 54,160 B | 58,476 B | | Native overview (diagrams, italic text) | 84,636 B | 91,360 B | | Keymap addons (one Cyrillic letter) | 72,312 B | 76,888 B | | Embedded terminal (terminal frame with `✓`) | 88,512 B | 58,476 B | | Release notes 0.8.0 (`✓`) | 88,512 B | 58,476 B | A page that has only characters of `latin` loads about 4 KB more than it does now, because the Regular and Bold `latin` files are each about 2 KB larger. The last two rows are smaller because `✓` is now in `latin`, so those pages no longer load `rest`. `rest` grew from 34 KB to 122 KB with the new scripts. A page loads it only if its text has a character from that file. No page of the site has one now: `✓` and the `∙ ⋅` of two recordings are in `latin`. The CSS of `Minimal.astro` is 8,876 B. It was 8,619 B. ## What a reader sees The existing pages do not change. On seven pages at 1440px, the layout measurements are equal, and 29 of 32 screenshots in light and dark mode are identical pixel for pixel. The other three differ in patches of one glyph, and two runs of the same build differ in such patches too. Text in the new characters now draws in the site typeface. Before, it used a fallback font: | Before | After | |-|-| |  |  | ## Bytes in the repository | Style | `latin` | `cyrillic` | `rest` | |-|-|-|-| | Regular | 27,280 → 29,416 B | 18,152 → 18,412 B | 34,352 → 122,432 B | | Bold | 26,880 → 29,060 B | 17,724 → 17,952 B | 34,212 → 121,880 B | | Italic | 30,476 → 32,884 B | new, 21,968 B | 38,712 → 139,804 B | | Bold Italic | 30,296 → 32,764 B | new, 21,856 B | 38,888 → 139,856 B | The total goes from 296,972 B to 728,284 B. ## Tested From `packages/web`, as `build-web.yml` does: - `bun run validate:docs:metadata`, `validate:docs:links`, `validate:docs:skill`, and `validate:docs:releases` pass. - `bun run api:check` passes. - `bun run test:site` passes (132 tests). `bun run test:packages` (15) and `bun test scripts/theme.test.ts` (19) pass. - `bun run build:site` builds both documentation channels and validates the links. - `bun run fmt:check` and `bun run lint` pass from the repository root. With fontTools: - No file has a character outside the `unicode-range` of its rule. No character is wider than one cell. - Every character of OpenTUI Mono is in a bundled file of every style. - The files of the four styles have the same metrics as the files from #2159. In Chromium, with `bun run dev`: - The first-visit numbers and the screenshots above. - `CSS.getPlatformFontsForNode` reports the bundled files for all text on Home, Box, and Embedded terminal, and for all of the specimen above. Embedded terminal and the 0.8.0 release notes request no `rest` file. On Keymap addons, only the Korean letter uses a fallback font, as before. - A page with only Cyrillic text and a stress mark loads the `cyrillic` files and not `rest`. - `scripts/prose-layout.check.mjs` passes on five pages with text diagrams. - Nine pages have no horizontal overflow at 390px, 768px, 1025px, and 1440px. ## Not tested - `bun run test:docs`. Four tests in `scripts/doc-visuals.test.ts` need the native library, which I did not build. They fail the same way on `main`. - Safari and Firefox. - The blue and cobalt themes. - The deployed site.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
No issue. This follows the release of OpenMono 1.000.
Type of change
What does this PR do?
The website and the docs (
services/site) set their mono text in OpenMono, Anomaly's typeface, built on Iosevka by Belleve Invis (SIL OFL 1.1). The files come from the OpenMono 1.000 build."OpenMono"in CSS, with the metric-matched stand-ins renamed to"OpenMono Menlo","OpenMono Consolas"and"OpenMono Courier". The previous family name is gone from the service, andtest/fonts.test.tsnow fails if it comes back.src/docs/assets/fonts/OpenMono-{Regular,Bold,Italic,BoldItalic}.woff2are the text files of the final app build (1.000, build 2026-11-19; no ligatures, every character one cell).script/openmono.pysplits each into three files by the rules OpenCode Desktop's script uses: no character is left out, every style has a Cyrillic file, and the ranges around the Powerline characters are exact. The Latin file also has the six keys that shortcuts name (⌃ ⌘ ⌥ ⌫ ⎋ ⏎) and 27 common symbols (below). With the same two lists, both scripts make the same files.⥈and⬰are now one cell wide.ccmp,locl,markandmkmk.cyrillic, in every style) so those pages fetch 18 kB and not the wholerestfile. That file also has the two stress marks (U+0300 and U+0301), so a stressed letter such asу́sets in OpenMono; a browser takes a letter and its mark from one file or falls back for both. Therestfile has those marks too, so each style'scyrillicrule comes after itsrestrule: a browser asks the last rule that has a character first, andру́сскийthen fetches the Latin and Cyrillic files only (checked in Chromium; with the other order it also fetched the 123 kBrestfile). A Latin letter that has no code point of its own with its mark, such asx́, still falls back, as ondev.restfile (122 kB in Regular).⇧is in the Latin range again. The search box on every docs page shows⌘K, which the font now has: from therestfile that one character would cost 122 kB a page, so the shortcut keys are in the Latin file and a docs page still fetches only the two Latin files.✓ ✗ ✕ ✖ ⚠; the dots∙ ⋅of terminal recordings; the math signs≈ ≠ ≤ ≥ ∞ √ ∑;⋯and�, which a changelog page has in code; and⁰ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ₀ ₁ σ Σ, the numbers on/font(the page sets itsσin capitals). The list comes from a scan of the rendered mono text of every page of the site and the docs in Chromium, each page in a browser context of its own. Before,/fontand/changelog/v2.3.1fetched therestfile; now no page does.devis at 30,492). In blocks where the font lacks only unassigned or rare code points (Greek, Armenian, phonetic letters, superscripts, currency, letterlike and technical symbols, Latin Extended-D to G, double-struck letters, legacy computing symbols) aunicode-rangeruns on across the gaps, up to a character another file has. The only cost is that a page using one of the lacking characters fetches therestfile before it falls back.monoFontRevisiongoes to 3, so a mono font saved on the development server resets to OpenMono once.humans.txtcredits OpenMono, Iosevka by Belleve Invis, and the licence.src/asset/fonts/OpenMono-OFL.txtcarries the copyright lines of the build.script/og.tsrenders its four cards (/product/browse, the changelog release card, and the two legal documents) with the new files. Each font file now has a family name of its own there: Satori keeps one face per family name and weight, so under one name only the Latin file was ever used. The four cards are English and render the same bytes as before that fix.src/asset/og/release.jpgis captured again from this branch; inside the card's crop it differs from the old still only by the font. The two legal stills stay: those pages have changed since the stills were made, so a new capture changes more than the font./brand.md). One new rule: turn OpenMono's code ligatures off, because the released family has them on and OpenCode shows none.script/capture-assets.tsrecords the Terminal screenshots and product video cuts with VHS and an installed font. Its default is now OpenMono Nerd, the terminal family: the status marks come from the font, and arrows and the ellipsis are one cell wide. VHS draws each cell on its own, so neither family shows ligatures.-monobadge files are not redrawn. Their text is outlines, and only the C of OpenCode differs, by 0.002 em: 0.02 px on the 20 px badge and 0.05 px on the 44 px one.restfilesThe Latin files are larger because the build stores accented letters as full outlines, not as components. The
restfiles are larger because the font has 3,552 characters where it had 1,321; a page fetches one only when it uses one of those characters. First load of mono fonts: 29,416 bytes on the home page, 58,476 on a docs page (Regular and Bold Latin), 47,828 on the Russian home page.Feature flag. None. The site reads no flags, and a typeface cannot be half on: both families would have to ship. The gate was the font's release, and OpenMono 1.000 is out.
Refresh the fonts after a font build, from
services/site:uvx --from 'fonttools[woff]==4.60.1' python script/openmono.py path/to/app-nerdIt reads and checks every input and builds every file in a temporary folder before it replaces anything, so a missing source, a file that is not the one-cell build, or styles whose characters differ leave the checkout untouched. With the same ranges, no other file changes.
Follow-ups, after this merges:
src/asset/og-studio/manifest.json). They are made by hand in OG Studio and are not part of this PR.-monobadge files inpublic/brand/badges. They were drawn with the earlier build of the same letters, so the copy that calls them OpenMono is right to within 0.002 em in one letter, the C of OpenCode.src/asset/og/privacy-policy.jpgandterms-of-service.jpgagain, as a change of their own.public/brand/screenshots/opencode-terminal-{dark,light}.png(and.webp) again withscript/capture-assets.ts./brand.mdand fromhumans.txt.Companion: #64798 (the data app). The two can merge in either order.
packages/nav-menusis not in this PR. The site sets--nav-menu-monoitself, so the menus follow--font-monoand never use the package's fallback family. Until #64798 merges, that fallback still carries the old family name into the site's compiled stylesheet as a dead value; the guard test scansservices/site, not that package.How did you verify your code works?
bun run checkat the root (lint, and typecheck of every package), which the pre-push hook also ran.bun typecheckandbun testinservices/site(242 pass).bun run build -- --mode devon the currentdev, which includes the docs build and its budget. Then the home page, product, Brand, legal, changelog, the font page and three docs pages in Chromium, light and dark. On each page the browser reports the drawn mono font asOpenMonoNerd-Regularor-Boldfrom the bundled files, no element still names the old family, and on the English pages under 0.03% of pixels differ fromdev(the C, c and G shapes). With the final build, checked again on the home page, the Russian home page, the changelog, the font page and three docs pages: no mono text is drawn by a system font. With the common symbols in the Latin file, a scan of all 265 site pages and 666 docs pages finds none that fetches arestfile.devby under 0.03% of pixels.ру́in a browser with the old and the new Cyrillic file: the stressed letters were Menlo and are now OpenMono.script/og.tsbuild and are byte-identical before and after the family names. A test line with⥈ ⚠ ✓and Cyrillic drew empty boxes under one family name and the glyphs under separate names. The new release still was compared with the old one and with a capture ofdev.Screenshots / recordings
The English pages differ only in the C, c and G. The Russian page shows the visible change: its mono text was the system font. Docs code blocks use the browser's own monospace font on
devtoday, so they do not change here.Checklist