fix(desktop): render Nerd Font UI glyphs - #81013
Open
Antikythera wants to merge 1 commit into
Open
Conversation
Antikythera
marked this pull request as ready for review
August 7, 2026 12:33
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_familyconfigures xterm.js, while chat and the rest of the renderer use the CSS families exposed through--dt-font-sansand--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, whoseunicode-rangeis restricted to the Nerd Font private-use planes:U+E000-F8FFU+F0000-F2FFFThe 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 asSegoe UI Symbolcannot 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:
💾emoji with a bundled Codicon; that standard emoji is not a Nerd Font private-use glyph.Type of Change
Changes Made
apps/desktop/src/styles.css— declare the local-only, PUA-scopedHermes Nerd Glyphsface 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
Symbols Nerd Font MonoorJetBrainsMono Nerd Font Mono. .Automated and packaged-app validation on Bazzite Linux, KDE Plasma/Wayland, Electron 40.10.2:
npm run test:ui -- src/themes/presets.test.tsnpm run typechecknpm run lintgit diff --checkhermes desktop --build-onlyChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -q— not run; this change is isolated to the TypeScript/CSS desktop renderer and the relevant desktop checks above passDocumentation & Housekeeping
cli-config.yaml.example: N/A — no configuration keys changedCONTRIBUTING.md/AGENTS.md: N/A — no architecture or workflow contract changedScreenshots / Logs
Packaged desktop UI
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.