Skip to content

fix(desktop): render Nerd Font UI glyphs - #81013

Open
Antikythera wants to merge 1 commit into
NousResearch:mainfrom
Antikythera:fix/desktop-nerd-glyph-fallback
Open

fix(desktop): render Nerd Font UI glyphs#81013
Antikythera wants to merge 1 commit into
NousResearch:mainfrom
Antikythera:fix/desktop-nerd-glyph-fallback

Conversation

@Antikythera

@Antikythera Antikythera commented Aug 7, 2026

Copy link
Copy Markdown

What does this PR do?

Hermes Desktop can now render Nerd Font private-use glyphs in ordinary desktop UI text when a compatible Nerd Font is installed locally. This covers chat prose, code/mono surfaces, system messages, tool output, and theme-provided typography. Previously those glyphs could render as tofu boxes even though the same font worked in the embedded terminal.

Root cause

The embedded terminal and the desktop renderer use separate typography paths. terminal.font_family configures xterm.js, while chat and the rest of the renderer use the CSS families exposed through --dt-font-sans and --dt-font-mono. Those UI stacks had no Nerd Font fallback, and a custom, user, or backend theme could replace the built-in typography entirely.

Putting a full Nerd Font directly at the front of every UI stack would fix the icons but could also change normal prose/code metrics and interfere with color emoji. This PR instead declares a virtual local face, Hermes Nerd Glyphs, whose unicode-range is restricted to the Nerd Font private-use planes:

  • U+E000-F8FF
  • U+F0000-F2FFF

The face prefers Symbols Nerd Font Mono / Symbols Nerd Font, then accepts JetBrains Mono Nerd Font as a fallback. It is placed first in the family list so platform fonts such as Segoe UI Symbol cannot claim a private-use codepoint first, but it is ineligible for ordinary text and emoji because of the restricted range. If none of the local font names exists, Chromium skips the face and the current typography continues unchanged.

Resolved theme typography is normalized at application time, so custom, user, and backend themes cannot accidentally drop the glyph fallback. Existing entries are moved to the front and deduplicated.

Related Issue

No matching issue was found for the desktop chat/UI typography path.

Related but intentionally not duplicated:

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • apps/desktop/src/styles.css — declare the local-only, PUA-scoped Hermes Nerd Glyphs face and add it to the boot-time sans/mono variables.
  • apps/desktop/src/themes/presets.ts — add the canonical glyph family, include it in built-in typography, and normalize external stacks without duplicates or invalid empty values.
  • apps/desktop/src/themes/context.tsx — apply the normalization after built-in, user, and backend theme typography has been resolved.
  • apps/desktop/src/themes/presets.test.ts — cover built-in presence, external-stack preservation, priority, deduplication, and the empty-stack edge case while retaining the existing emoji fallback contract.

How to Test

  1. Install either Symbols Nerd Font Mono or JetBrainsMono Nerd Font Mono.
  2. Build and launch the packaged desktop app.
  3. Render private-use test glyphs in chat, for example 󰣇 󰉋 󰆍 󰄬.
  4. Verify they render as icons rather than tofu boxes in prose and mono/code surfaces.
  5. Verify ordinary prose/code typography and emoji remain unchanged.
  6. Select a theme with custom typography and repeat the glyph check.
  7. On a system without any matching Nerd Font, verify the app keeps its existing font stack and remains usable.

Automated and packaged-app validation on Bazzite Linux, KDE Plasma/Wayland, Electron 40.10.2:

Check Result
npm run test:ui -- src/themes/presets.test.ts 13/13 passed
npm run typecheck passed
npm run lint 0 errors; existing unrelated warnings only
git diff --check passed
hermes desktop --build-only packaged successfully
Packaged-app UI check Nerd private-use glyphs rendered in chat

Checklist

Code

Documentation & Housekeeping

  • Documentation: N/A — no user-facing command, setting, or configuration key changed
  • cli-config.yaml.example: N/A — no configuration keys changed
  • CONTRIBUTING.md / AGENTS.md: N/A — no architecture or workflow contract changed
  • Cross-platform impact considered: macOS, Windows, and Linux local font names are optional; unresolved names degrade to the existing stack
  • Tool descriptions/schemas: N/A — no tool behavior changed

Screenshots / Logs

Packaged desktop UI

Hermes Desktop rendering Nerd Font private-use glyphs

Manual packaged-app verification string:

󰣇 󰉋 󰆍 󰄬

Before the change these private-use codepoints could render as tofu boxes in the renderer. With a matching local Nerd Font they render as icons; normal UI typography remains selected for non-PUA text.

@Antikythera
Antikythera marked this pull request as ready for review August 7, 2026 12:33
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants