Skip to content

feat(app): bundle OpenMono as the default mono font (opencode#64797) - #1346

Merged
Hona merged 3 commits into
devfrom
upstream-f/bundle-openmono
Nov 26, 2026
Merged

Hona merged 3 commits into
devfrom
upstream-f/bundle-openmono

Conversation

@Hona

@Hona Hona commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Ports official anomalyco/opencode#64797 (b15f4e9301676df78944d2db581bc7e454a62b9f, UP-259): bundles OpenMono (Regular, Bold, Italic, and Nerd Fonts icons) as the default code and terminal mono font in place of IBM Plex Mono and JetBrainsMono Nerd Font Mono, and fixes a pre-existing UTF-8 slicing panic in the Third-party notices parser.

Summary

  • Bundled OpenMono TTF faces (apps/desktop/assets/fonts/, apps/desktop/src/lib.rs, scripts/web.ps1):
    • Reconstructed full non-ligature 1-cell (600 / 1000 UPM, hhea 965 / -220 / 65) .ttf faces from official b15f4e9301's .woff2 files via fontTools (OpenMono-Regular.ttf, OpenMono-Bold.ttf, OpenMono-Italic.ttf under family OpenMono, plus OpenMono-Icons.ttf under family OpenMono Icons covering all 10,876 Nerd Fonts icons), alongside OpenMono-OFL.txt.
    • Removed IBMPlexMono-{Text,Bold,TextItalic}.ttf, IBMPlexMono-LICENSE.txt, JetBrainsMonoNerdFontMono-{Regular,Bold}.ttf, and JetBrainsMonoNerdFontMono-LICENSE.txt (net ~1.4 MiB smaller binary/bundle).
    • Updated native FONTS, macOS FONT_FILES, wasm32 FONTS/LATE_FONTS/TERMINAL_FONTS, and scripts/web.ps1 copy includes.
  • Appearance, terminal, and plugin defaults (apps/desktop/src/shell/appearance/mod.rs, plugin_host/services/session.rs, features/settings/src/{types,lib,pages/appearance}.rs, features/terminal-surface/src/{lib,grid/mod}.rs, crates/session-view/examples/read_only.rs):
    • Switched CODE_FONTS[0], TERMINAL_FONTS[3], CODE_DEFAULT, TERMINAL_DEFAULT, FACE_WEIGHTS (100..599 Regular 400, 600..900 Bold 700), and plugin appearance.font("mono") to OpenMono (OpenMono, OpenMono Icons).
    • Migrated untouched saved legacy default names ("IBM Plex Mono" in codeFont and "JetBrainsMono Nerd Font Mono" in terminalFontName) to default OpenMono on load.
    • Updated terminal default cell box metrics in features/terminal-surface/src/grid/mod.rs to OpenMono's hhea (0.965 ascent / 0.22 descent).
  • About copy, locales, and third-party notices (crates/opencode-i18n/locales/official/*.json, THIRD_PARTY_NOTICES.md, features/settings/src/pages/about/notices.rs):
    • Updated settings.about.typeset from IBM Plex Mono to OpenMono across all 62 official locale files and added settings.about.notices.{openMono,nerdFonts} to official/en.json.
    • Replaced IBM Plex Mono and JetBrains Mono entries in THIRD_PARTY_NOTICES.md with verbatim OpenMono (SIL OFL 1.1, plain heading with no link) and Nerd Fonts v3.5.1 notices plus collapsible full icon-set licenses from b15f4e9301.
    • Fixed a pre-existing UTF-8 char-boundary panic in features/settings/src/pages/about/notices.rs (split_license_dash now iterates s.char_indices() and handles leading em-dashes for URL-less entries like OpenMono; dedent slices strictly on counted ASCII spaces).

Verification

  • CI run 45897512979 on head 14fec3dcb2: green (guardrails, build-macos, build-windows (x64), build-windows (arm64), build-linux (x64); Linux arm64 skipped).
  • Headless verification on the Windows x64 PR build beside a before build (b113398d10), all 4/4 cases passed:
    1. Settings > Appearance (--scene settings-appearance): Code Font and Terminal Font placeholders both show OpenMono (before: IBM Plex Mono and JetBrainsMono Nerd Font Mono).
    2. Settings > About (--scene settings-about): reads Typeset in Inter and OpenMono (before: Typeset in Inter and IBM Plex Mono).
    3. Third-party notices modal (settings-about-notices): opens cleanly with exit 0 (pre-existing panic fixed), lists OpenMono (plain heading, SIL Open Font License 1.1, OpenMono-OFL.txt) and Nerd Fonts (v3.5.1 + collapsible Nerd Fonts Icon Set Licenses), with IBM Plex Mono (0 hits) and JetBrains Mono (0 hits) removed.
    4. Code & terminal rendering: code block (1367 px diff) and --scene "Terminal/Pane" (9687 px diff, single-cell Nerd Font git branch glyph) render cleanly in OpenMono.
  • Local guardrails (scripts/guardrails.ps1): 9/9 passed; bun scripts/web-clock.ts: 0 violations.
  • Not run: real window, macOS, Linux.

@Hona
Hona marked this pull request as ready for review November 26, 2026 21:53
@Hona
Hona merged commit 088e3be into dev Nov 26, 2026
7 checks passed
@Hona
Hona deleted the upstream-f/bundle-openmono branch November 26, 2026 21:53
Hona added a commit that referenced this pull request Nov 26, 2026
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.

1 participant