Repository navigation
Use OpenMono for monospace text - #184
Conversation
The app now ships one open mono family, OpenMono, in place of two. OpenCodeFonts.monospace is OpenMono (SIL OFL 1.1), from the OpenMono 1.000 app build without ligatures: text-only files, so every text character, box drawing and the status symbols, and none of the Nerd Fonts icons. OpenMono has Regular, Bold and their italics. The family declares Regular for Normal and Medium and Bold for SemiBold and Bold, each with its italic, so no weight or slant is synthesized. Medium mono text (server host, skill names) now draws as Regular, SemiBold (shell sheet title, inline code in headings) as Bold, and emphasised inline code gets a real italic. Replaced: IBM Plex Mono everywhere OpenCodeFonts.monospace is used; OpenCodeFonts.berkeleyMono (removed) in the Onboarding Playground's "opencode" mark, onboarding's website mock and the design gallery's two specimens; and the system FontFamily.Monospace in devtools. Removed berkeley_mono.ttf, the three plex_mono_*.ttf files and the Plex licence text; added four openmono_*.ttf files (2,072,716 bytes in, 883,464 out) and docs/licenses/OpenMono-OFL.txt. Sizes, weights and line heights are unchanged; all three families have the same character width. scripts/update-openmono.py refreshes the fonts and the licence from an OpenMono app build and checks each file's weight, italic flags, cell width and lack of ligatures. AGENTS.md and docs/parity (core-ui, app) describe the new font. Verified: no reference to the removed resources, berkeleyMono or FontFamily.Monospace remains; resource names are valid; the script gives the same bytes on a second run. Not built or run: no Android toolchain on this machine.
…r-nothing The OFL asks that each copy of a font carries its copyright notice and licence. The texts were in docs/licenses/, which no build packages, so the APK had the fonts without them. They now live in core/src/main/assets/licenses/ (OpenMono-OFL.txt, Inter-OFL.txt) and every APK carries them as assets/licenses/, the way the Mermaid renderer's licence already ships beside it. One copy each; docs/licenses is gone. Inter's text was missing from the APK in the same way before this branch, so it moves too. scripts/update-openmono.py now converts and checks all four fonts and reads the licence before it replaces anything, then moves the staged files into place, so a failed refresh leaves the checkout as it was. It checks the bytes it will write as well as the input, needs fontTools 4.68.0 so the output is reproducible, and checks more: static fonts, a 0.6 em cell, zero width only for marks, format, separator and private-use characters, a required character set (ASCII, box drawing, block elements, ✓ ✗ ⚠), no ligature features, and few private-use characters in place of the glyph-count limit. Its text now says "text subset" and "no programming ligatures". Verified: the script on the released build rewrites byte-identical files; on copies of the build with a font missing, the licence missing, a truncated font, a font of the wrong weight and a font with the icon set, it exits 1 and the checkout is unchanged. Not built locally; CI builds it and the APK artifact is checked for the two licence files.
The fonts now come from the final OpenMono 1.000 build (build 2026-11-19), which adds Greek, Vietnamese, Armenian and more. Each text-subset file is about 1.1 MB as TTF, so four styles would cost the APK far more than the fonts they replace. The app ships Regular and Bold only: openmono_italic.ttf and openmono_bold_italic.ttf are removed and OpenCodeFonts.monospace declares the upright faces alone (Regular for Normal and Medium, Bold for SemiBold and Bold). Italic mono text (emphasised inline code in Markdown) is slanted by the system from the upright face, as it was with the old code font, which had no italic either. Compose 1.12.1 finds no italic entry, matches the upright font of the requested weight in the same family, and with the default FontSynthesis.All asks Android for an italic of that typeface; no call site sets fontSynthesis. scripts/update-openmono.py converts Regular and Bold only and rejects an italic file. It allows U+055F (Armenian abbreviation mark) to be zero-width: the final build draws it above the letter before it. The licence text is refreshed from the build (its first copyright line changed). Fonts now: openmono_regular.ttf 1,126,148 bytes and openmono_bold.ttf 1,109,980 bytes (2,236,128; was 883,464 for the four removed files). Verified: the script on the final build writes the same bytes twice; on copies of the build with Bold missing and with an italic file in Bold's place it exits 1 and changes nothing; no reference to a removed resource remains. Not built locally; CI builds it.
|
Tested 05a1569 on the Android VM emulator (Pixel 8, API 36), against Check: APK: What I checked, light and dark: code blocks with highlighting, inline code (plain, bold, italic, in a heading), tool output, the permission command, the onboarding playground's "opencode" mark, the website miniature in the Welcome animation, Server Details' address, Developer › Troubleshooting (devtools mono), and font scale 1.3. I also checked a glyph line: Greek, letterlike, arrows, Result: it works. Line heights, row heights and wrapping match Small things:
Not tested: the design system gallery (Compose preview only, not reachable in the app), diffs, the mixed glyph line inside shell output or a tool row (the lab has no way to inject it there), bold italic, Server Details skill tiles, the connection card, the numbered file preview, and a non-English language. |
|
Repeated the earlier emulator check on c8b8117 (after the merge with dev), same fixture content and same six views; the first two are now against today's dev (c001a08). |












The app now ships one open mono family, OpenMono (SIL OFL 1.1), in place of two.
Before
core/src/main/res/fontheld IBM Plex Mono (Regular, Medium, SemiBold) for code, tool output, shell output, commands and paths, and Berkeley Mono (variable) for the Onboarding Playground's "opencode" mark, onboarding's website mock and two design gallery specimens.devtoolsused the systemFontFamily.Monospace.OpenCodeFontsinOpenCodeTypography.kt.docs/licenses/, which no build packages, so the APK had fonts without their licences. There is no in-app licences screen.What changed
OpenCodeFonts.monospaceis OpenMono.OpenCodeFonts.berkeleyMonois gone; its uses and the devtools uses point atmonospace.✓ ✗ ⚠, plus a few private-use Powerline separators), without the Nerd Fonts icon set. They have no programming ligatures (nocaltor ligature features; composition substitutions remain), so code shows as typed.core/src/main/assets/licenses/OpenMono-OFL.txtandInter-OFL.txt(moved fromdocs/licenses/, one copy each) are packaged in every APK asassets/licenses/, the way the Mermaid renderer's licence already ships. The Plex licence text is removed with its fonts.AGENTS.mdanddocs/parity(core-ui, app) describe the new font.Size
berkeley_mono.ttf470,964,plex_mono_regular.ttf135,580,plex_mono_medium.ttf136,704,plex_mono_semibold.ttf140,216openmono_regular.ttf1,126,148,openmono_bold.ttf1,109,980The CI debug APK is 143,652,303 bytes with this change and 143,417,287 bytes on
devat the same base: 235,016 bytes more (231,064 for the fonts, about 4 KB for the two licence texts).Known limits
hhea965/−220/65, typo 965/−285/0); the old code font was 1.30 em (1025/−275/0) and the old brand font 1.20 em (956/−244/0). No app code setsincludeFontPadding.Refreshing the fonts
It converts the build's Regular and Bold text-subset WOFF2 files to TTF and copies the licence. Everything is converted, checked and read before any file in the checkout is replaced, so a failed run changes nothing. Each font must be static and upright with the declared weight, have a 0.6 em cell (zero width only for marks, format, separator and private-use characters, and the Armenian abbreviation mark), have ASCII, box drawing, block elements and
✓ ✗ ⚠, have no ligature features, and have only a few private-use characters. The same input gives the same bytes.Testing
Not built or run locally, and not yet seen on a device. No images or video yet for that reason;
AGENTS.mdasks for them on visual changes, so they need to come from a device before this leaves draft.What was checked:
checkjob (scripts/check.sh: translations, assemble, lint, unit tests) passes on every commit.assets/licenses/OpenMono-OFL.txtandassets/licenses/Inter-OFL.txtand the two fonts, all identical to the checkout, and no other mono font.FontSynthesis.Allasks Android for an italic of that typeface, which slants it. No call site setsfontSynthesis.Installable build for the tester: each CI run on this PR uploads a debug APK. Open the PR's Checks tab, then CI, then Artifacts, and download
opencode-android-<commit>(kept 30 days; you must be signed in to GitHub), or rungh run download <run id> -R anomalyco/opencode-android. Install it withadb install -r. It is the.debugapp, so it installs beside the Play build.What a tester should look at
In light and dark, at the default and an accessibility font size:
Code text (was the old code font): code blocks, inline code (bold, in a heading), tool output, shell output, permission requests.
Italic inline code is slanted: emphasised inline code in a message (
*`code`*and***`code`***) shows slanted, in the mono font: not upright and not in another font.Brand-like places: the "opencode" word on the Onboarding playground (Settings › Developer › Playgrounds › Onboarding), the small picture of the website in onboarding, the design gallery samples.
A mixed line in shell output and in a tool row, for column alignment and row height:
Layout checklist
Natural line height (no line height set in code):
OnboardingPlaygroundView.kt:362,DesignSystemGallery.kt:185.WelcomeBrowser.kt:45-46,80-171,285-293. Check this fixed-height miniature with a non-English language and a larger font scale too.WelcomeDesktop.kt:204,229.Explicit line height, but constrained or baseline-sensitive:
MarkdownStyle.kt:79-84,116-118;ToolRows.kt:357-375,497.AgentCodeView.kt:70,119-129.ConnectionCard.kt:357-375.ServerDetailsView.kt:321-330.ShellOutputView.kt:405), permission requests, and the Developer screens.