Skip to content

fix(font): embed Symbols Nerd Font Mono fallback for Nerd Font PUA icons#8

Merged
simota merged 1 commit into
mainfrom
fix/embedded-nerd-font-fallback
Jul 13, 2026
Merged

fix(font): embed Symbols Nerd Font Mono fallback for Nerd Font PUA icons#8
simota merged 1 commit into
mainfrom
fix/embedded-nerd-font-fallback

Conversation

@simota

@simota simota commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • The sidebar draws Nerd Font PUA glyphs (status dot U+F111 nf-fa-circle, project icons U+E5FF/U+E7A8/… from icon_glyph), but on a machine with no Nerd Font family installed they rendered as tofu boxes: name-list discovery and all_families() find no candidate, and the CoreText cascade cannot map private-use codepoints (reported via annotated screenshot, sidebar card header).
  • Vendor Symbols Nerd Font Mono v3.4.0 (MIT, symbols-only — no Latin/CJK letterforms; SHA-256 pinned in crates/noa-font/vendor/ATTRIBUTION.md) and embed it via include_bytes! as a permanent fallback face, mirroring Ghostty's bundled-font coverage guarantee.
  • Stack order: emoji → installed Nerd Fonts (user's own font keeps winning) → embedded Symbols → CJK, so PUA never resolves to a CJK private glyph and the embedded face can never shadow a face that actually covers a codepoint. It rides the existing is_icon_fallback_face icon sizing/styling path (fix(font): align fallback styling and glyph sizing with Ghostty #6).
  • Terminal-grid Nerd Font glyphs (starship/p10k prompts etc.) gain the same render guarantee.
  • docs/specs/session-sidebar.md NFR-5/AC-21/A1 revised: tofu is no longer the accepted degradation for missing Nerd Fonts.

Test plan

  • New: sidebar_icon_codepoints_resolve_without_installed_nerd_font — real load_font_stack resolves all 8 sidebar PUA codepoints to non-notdef glyphs, deliberately without the skip-if-font-absent pattern (that absence is the case under test).
  • New: embedded_symbols_font_is_classified_icon_fallback_face.
  • Workspace: 1779 passed / 0 failed (unsandboxed; sandboxed noa-ipc bind failures are pre-existing), clippy no new warnings, fmt clean.
  • Manual: relaunch noa on a machine without any Nerd Font — sidebar dot + project icons render (was: tofu boxes).

The sidebar's own UI draws Nerd Font private-use-area glyphs (status dot
U+F111 nf-fa-circle, project icons U+E5FF/U+E7A8/... from icon_glyph), but
on a machine with no Nerd Font family installed nothing in the fallback
chain can resolve PUA codepoints — name-list discovery and all_families()
find no candidate, and the CoreText cascade cannot map private-use
codepoints — so the sidebar rendered tofu boxes.

Vendor Symbols Nerd Font Mono (v3.4.0, MIT, symbols-only — no Latin/CJK
letterforms) into noa-font and embed it via include_bytes! as a permanent
fallback face, mirroring Ghostty's bundled-font coverage guarantee. Stack
order: emoji, installed Nerd Fonts (user's choice keeps winning), embedded
Symbols, CJK — so PUA never resolves to a CJK private glyph and the
embedded face can never shadow a face that actually covers a codepoint.
The face rides the existing is_icon_fallback_face styling/sizing path.
FontBytes gains a Static variant since the embedded bytes are already
resident (no heap copy, no mmap).

Terminal-grid Nerd Font glyphs (e.g. starship/p10k prompts) gain the same
guarantee. session-sidebar.md NFR-5/AC-21/A1 revised: tofu is no longer
the accepted degradation for missing Nerd Fonts.
@simota simota merged commit 7b587c1 into main Jul 13, 2026
1 check passed
@simota simota deleted the fix/embedded-nerd-font-fallback branch July 13, 2026 06:32
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