GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(site): use OpenMono as the mono typeface by iamdavidhill · Pull Request #64796 · anomalyco/opencode Conversation
|
| Font bytes | Before | After |
|---|---|---|
| Regular Latin (preloaded on every page) | 19,084 | 29,416 |
| Bold Latin | 18,700 | 29,060 |
| All served files | 193,076 (8 files) | 728,284 (12 files) |
Of those, the four rest files |
113,372 | 523,972 |
| Source files in the repo | 250,508 | 856,072 |
The Latin files are larger because the build stores accented letters as full outlines, not as components. The rest files 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.-mono badge files in public/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.jpg and terms-of-service.jpg again, as a change of their own.public/brand/screenshots/opencode-terminal-{dark,light}.png (and .webp) again with script/capture-assets.ts./brand.md and from humans.txt.Companion: #64798 (the data app). The two can merge in either order.
packages/nav-menus is not in this PR. The site sets --nav-menu-mono itself, so the menus follow --font-mono and 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 scans services/site, not that package.
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 services/site (242 pass).bun run build -- --mode dev on the current dev, 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 as OpenMonoNerd-Regular or -Bold from the bundled files, no element still names the old family, and on the English pages under 0.03% of pixels differ from dev (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 a rest file.dev by 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.ts build 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 of dev.| Before | After | |
|---|---|---|
| Home | ![]() |
![]() |
| Docs | ![]() |
![]() |
| Home in Russian | ![]() |
![]() |
| This branch at 390 px | Light | Dark |
|---|---|---|
| Home | ![]() |
![]() |
| Docs | ![]() |
![]() |
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 dev today, so they do not change here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.
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, [email protected])`. 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.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I found nothing that should block this merge. I didn't see the site render, because there is no browser in this environment.
How I checked it:
bun test in services/site passed, 242 of 242.tsc --noEmit came back clean. The package's typecheck script doesn't run on the Bun version here.openmono.json. Every file's characters are inside its own unicode-range, and no range takes a character that only another file has; only the stress marks are shared, as intended. Every glyph is one cell (600 units, or 0 for the combining marks). The shortcut keys and status marks are in the Latin file.Public API: unchanged. This touches only the site's fonts, CSS, scripts and a development-only setting.
One thing that isn't blocking: the docs stylesheet now has about 55 bytes of its gzipped budget left, so the next small docs CSS change will hit the limit.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approved by Adam. Please rebase onto dev (conflicts); merge #64796 first.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
8e4f37f to
e508bb6
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approved by Adam.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.