Skip to content

Bundle Nerd Font symbol fallback for terminal glyphs - #5712

Merged
Jinwoo-H merged 1 commit into
stablyai:mainfrom
wolfiesch:contrib/omp-glyph-fallback
Jun 29, 2026
Merged

Jinwoo-H merged 1 commit into
stablyai:mainfrom
wolfiesch:contrib/omp-glyph-fallback

Conversation

@wolfiesch

@wolfiesch wolfiesch commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Draft PR for #5711. Maintainer decision needed on packaging.

User-visible change: OMP, Powerline, starship, and other terminal tools that emit Nerd Font / Private Use Area glyphs can render symbols in Orca's terminal without requiring the user to change their primary terminal font.

This draft implements the most deterministic option:

  • Bundle SymbolsNerdFontMono-Regular.woff2 under the SIL OFL.
  • Register it as Orca Nerd Font Symbols with unicode-range limited to Private Use Area codepoints.
  • Add it after OS monospace fonts and before optional installed Nerd Fonts in the terminal fallback chain.
  • Keep the user's configured terminal font first.

Review choice for maintainers:

  1. Keep this PR: offline, deterministic, no runtime network request, adds about 1.18 MB.
  2. Ask me to convert this to guidance/settings copy only: smallest app bundle, but users still install/configure a Nerd Font manually.
  3. Ask me to prototype runtime download/cache: smaller initial bundle, but more code, cache/provenance work, offline failure modes, and network behavior in a rendering path.

My recommendation is option 1 or option 2. I would avoid option 3 unless Orca already wants a general downloadable-assets system.

X handle: @wolfie_

Screenshots

No new Orca chrome or settings UI.

The visible behavior is terminal glyph fallback. A useful before/after screenshot requires a clean system without user-installed Nerd Fonts, so I did not attach a local screenshot from my now-modified machine.

Testing

  • pnpm lint - not run; draft PR, scoped CSS/font-stack change
  • pnpm typecheck - not run; ran renderer typecheck instead
  • pnpm run typecheck:web - passed
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/layout-serialization.test.ts - passed, 24 tests
  • pnpm build - attempted pnpm run build:web; it timed out after 300s during Vite transforming..., so build coverage is not claimed
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
  • python3 asset-link check - passed; CSS references the bundled WOFF2 font, PUA unicode-range is present, and the TTF source is absent

AI Review Report

Reviewed for:

  • Cross-platform compatibility: change uses CSS @font-face and xterm font-family fallback. No platform-specific shortcuts, labels, shell commands, or path separators changed.
  • macOS/Linux/Windows behavior: fallback ordering keeps platform monospace fonts first, then uses the bundled PUA-only symbol font for missing glyphs.
  • SSH/remote/local behavior: remote output still renders in the local xterm renderer, so the fallback is local-renderer-only and does not assume remote fonts or files.
  • Agent/integration compatibility: generic terminal rendering path only. No OMP-specific parsing and no provider-specific logic.
  • Performance: WOFF2 replaces the original TTF draft, reducing the font asset from about 2.5 MB to about 1.18 MB. unicode-range limits when the browser considers the fallback face.
  • Review comments: Copilot suggested unicode-range and WOFF2. Both were implemented and replied to inline.

Security Audit

Reviewed risks:

  • Input handling: no new input parsing.
  • Command execution: no new commands in app code.
  • Auth/secrets: no auth or secret handling touched.
  • IPC: no IPC touched.
  • Paths: no runtime filesystem paths added. Renderer CSS references a packaged asset.
  • Network: no runtime download or remote font request added.
  • Licensing/supply chain: bundled font includes SIL OFL text in src/renderer/src/assets/fonts/SymbolsNerdFontMono-OFL.txt.

Follow-up needed only if maintainers prefer a different packaging strategy.

Notes

  • The existing code already had installed Nerd Font fallback names. This PR adds a known bundled fallback so clean installs do not depend on user-installed fonts.
  • Existing bundled-font precedent: Geist-Variable.woff2.
  • Existing static web MIME precedent: .woff2 is mapped in static-web-client-handler.ts.
  • Local shell used Node 25.2.1 while the repo declares Node 24; pnpm emitted the expected engine warning during install/typecheck.

Copilot AI review requested due to automatic review settings June 18, 2026 13:41
@ghost

ghost commented Jun 18, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Bundle Nerd Font symbols and license
2 Integrate bundled font into terminal fallback chain
3 Update terminal font tests for new fallback
4 Other changes
Open in Stage

Chapters generated by Stage for commit fb0ff36 on Jun 18, 2026 2:05pm UTC.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A bundled Nerd Font Symbols font file (SymbolsNerdFontMono-Regular.woff2) is wired into the renderer. Its OFL v1.1 license text is added as a new file. A @font-face block in main.css registers it under the family name 'Orca Nerd Font Symbols' with WOFF2 sourcing, font-display: swap, and a unicode-range targeting private-use glyph blocks. The FALLBACK_FONTS array in layout-serialization.ts is updated to include this name, along with a revised comment explaining the fallback ordering rationale. Tests in layout-serialization.test.ts are updated to reflect the new fallback chain and add a non-duplication assertion for the new font name.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely summarizes the main change: bundling a Nerd Font symbol fallback for terminal glyph rendering.
Linked Issues check ✅ Passed All requirements from issue #5711 are met: symbol font bundled under OFL, registered as 'Orca Nerd Font Symbols' via @font-face with PUA unicode-range, added to fallback chain after OS fonts and before user fonts, and test coverage added for duplicate suppression.
Out of Scope Changes check ✅ Passed All changes are directly scoped to bundling and integrating the Nerd Font symbol fallback; no unrelated modifications detected across license file, CSS, tests, and serialization logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description is comprehensive and addresses all template requirements including summary, testing, AI review with cross-platform analysis, security audit, and notes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bundles a Symbols Nerd Font Mono (symbols-only) fallback font into the renderer so terminal Private Use Area (PUA) glyphs (OMP/Powerline/starship, etc.) render correctly even on systems without user-installed Nerd Fonts.

Changes:

  • Added bundled SymbolsNerdFontMono-Regular.ttf (SIL OFL) and registered it as Orca Nerd Font Symbols via @font-face.
  • Inserted the bundled font into the terminal font fallback chain ahead of optional user-installed Nerd Fonts.
  • Updated/extended buildFontFamily tests to cover fallback ordering and duplicate suppression (including the new bundled family).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/renderer/src/components/terminal-pane/layout-serialization.ts Adds Orca Nerd Font Symbols into the terminal fallback font list and updates rationale comments.
src/renderer/src/components/terminal-pane/layout-serialization.test.ts Updates expected fallback strings and adds a test ensuring the new bundled family is not duplicated.
src/renderer/src/assets/main.css Registers the bundled font via @font-face for use by the renderer.
src/renderer/src/assets/fonts/SymbolsNerdFontMono-OFL.txt Adds required SIL OFL license text for the bundled font.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +24
@font-face {
font-family: 'Orca Nerd Font Symbols';
src: url('./fonts/SymbolsNerdFontMono-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fb0ff36: the bundled symbol face is now scoped to Unicode Private Use Area ranges so it is only considered for OMP/Powerline/Nerd Font glyph fallback.

Comment thread src/renderer/src/assets/main.css Outdated
@@ -15,6 +15,14 @@
font-display: swap;
}

@font-face {
font-family: 'Orca Nerd Font Symbols';
src: url('./fonts/SymbolsNerdFontMono-Regular.ttf') format('truetype');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fb0ff36: replaced the TTF asset with WOFF2 only, matching the existing Geist font precedent and reducing the bundled asset from 2.5 MB to about 1.18 MB.

@wolfiesch
wolfiesch force-pushed the contrib/omp-glyph-fallback branch from 55652e8 to fb0ff36 Compare June 18, 2026 14:04
@wolfiesch
wolfiesch marked this pull request as draft June 18, 2026 14:35
@AmethystLiang
AmethystLiang requested a review from Jinwoo-H June 23, 2026 16:50
@wolfiesch
wolfiesch marked this pull request as ready for review June 27, 2026 11:53

@Jinwoo-H Jinwoo-H left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — and for laying out the packaging options so clearly. Reviewed and validated locally:

  • Bundled font is symbols-only (no text glyphs), so normal terminal text is never affected; unicode-range correctly scopes it to the Private Use Area.
  • Verified in the app: the fallback loads and renders OMP/Powerline glyphs that previously showed as missing-glyph boxes on a system without an installed Nerd Font.
  • Full build, typecheck, lint, and the terminal font-stack tests all pass.

Option 1 (the bundled fallback) is the right call here — deterministic, offline, and no network in the render path. Merging.

@AmethystLiang

Copy link
Copy Markdown
Contributor

thanks for reporting. looking into it

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 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.

5 participants