Skip to content

qt fonts: ship the glyph fonts Toad draws with, ahead of emoji (Android tofu and orange symbols) - #2105

Merged
trissim merged 1 commit into
mainfrom
fork-android-fonts
Nov 18, 2026
Merged

trissim merged 1 commit into
mainfrom
fork-android-fonts

Conversation

@trissim

@trissim trissim commented Nov 18, 2026 •

Copy link
Copy Markdown

Why glyphs were missing on Android

Toad draws box drawing, block elements, braille, arrows and symbols: the ☰ multi-line message symbol, ✓, ❯, ⏎, table rules, and the ANSI Shadow welcome banner (the "multi-line font"). On the Pixel 8a every one of those exists only in Android's Noto Sans Symbols (subsetted).

  • Missing glyphs: that font is on none of Qt-on-Android's per-family fallback lists, so text drawn through the app font's explicit family list or <pre>'s Courier New showed nothing.
  • Orange glyphs: Toad's own chain (SYMBOL_FALLBACKS) put Noto Color Emoji first, so symbols the emoji font also holds (the ↗ receipt arrow, ⚠, ✔, ☑, ⬅) drew in colour.

The fix: one owner, toad.qt.glyph_fonts

  • Bundled fonts: Noto Sans Mono, Noto Sans Symbols 2, Noto Sans Symbols and Noto Sans Math, under SIL OFL 1.1 (src/toad/qt/fonts/OFL.txt).
    • Subset with fontTools pyftsubset to the blocks Toad draws: Latin-1, punctuation, letterlike, arrows, maths, misc technical, control pictures, box, blocks, geometric, misc symbols, dingbats, braille, and supplemental and misc arrows.
    • 454 KiB, down from 2.4 MiB unsubset; that's the APK size increase.
  • Registration: the fonts are registered once at start (install_glyph_fonts) and placed in every Qt font's fallback, ahead of the emoji fonts:
    • the application font's families;
    • substitutes for each family asked for by name: Courier New/courier (Qt HTML <pre>/<code>, which is how history rows draw), monospace, pyqt-reactive's Arial/Courier/Consolas, Android's own faces, and each bundled family itself.
  • Banner: qt/banner.py's banner (welcome and splash) draws in the bundled Noto Sans Mono, so its block and box glyphs share one cell grid on every platform.
  • Registration point: QtSplash.shown registers the fonts before the first frame paints, so the splash banner already draws in Noto Sans Mono. qt_drive and qt_scroll_profile open the client without a splash, so they register the fonts right after creating their QApplication.
  • APK packaging: ttf is added to source.include_exts, alongside qt start: first frame in 0.3 s at phone speed; APK ships bytecode; settings pages build lazily #2104's pyc.
  • Deleted: the old SYMBOL_FALLBACKS/use_symbol_fallbacks in qt/client_start.py.

Receipt glyph presentation (U+FE0E on the declarations) belongs to the arrival-polish fork. This PR supplies the font those glyphs now fall back to, so ↗ ⚠ ✔ ☑ ⬅ are already monochrome text.

Evidence

Method. Qt offscreen, with fontconfig restricted to Android's fonts as Qt's fallback reaches them: Roboto, RobotoStatic, Droid Sans Mono, Cutive Mono and Noto Color Emoji, pulled read-only from the phone's /system/fonts. Each inventoried glyph is laid out in each of Toad's four text contexts. "Tofu" means a glyph run contains glyph index 0 (notdef).

Context main: tofu main: text symbol drawn as colour emoji this PR: tofu this PR: as emoji
app font (widgets) 93 17 0 5 (⏪⏳⚡⚫❓)
monospace 93 17 0 0
<pre> (history rows) 93 17 0 0
welcome banner 93 17 0 0

The 5 left in the app-font context are Emoji_Presentation=Yes characters. Unicode draws them as emoji unless U+FE0E follows, which is the polish fork's change.

Banner at 380 px:

  • main: every cell is tofu;
  • this PR: the full ANSI Shadow "COMMS", with the █ blocks and the ═║╔╗╚╝ shadow lines on one grid, the same 6 rows × 47 columns the TUI draws.

Caveat: Tristan's screenshot shows the banner drawing on the device before this change, so Qt-on-Android does reach Noto Sans Symbols for a bare QFont("monospace"). The model is stricter there. The fix doesn't depend on Android's fallback in any context.

Gates:

  • tools/qt_inherit_ratchet.py: rc 0. Bare 21/21, copies 0, Textual-UI loaders 11/11, qt→widgets imports 0. No new classes.
  • tools/shadow_check.py: 0.
  • tools/android/check.sh: rc 0. The shipped app ran every view kind and bound key on a scratch bus, from the assembled app folder, which holds toad/qt/fonts/*.ttf. install_glyph_fonts raises if a bundled font fails to load.

Not verified on the device: no APK was built or installed from this branch.

Glyph inventory

Every non-ASCII character in a non-docstring string literal in toad, ui_theme, pyqt_reactive, formbridge and agent_comms' presentation, registry and ui_model, plus markdown task boxes and braille spinner frames. Latin-1 is omitted: Roboto has it.

Glyphs Where Toad draws them Android default draws it Bundled font
– core, widgets yes Noto Sans Mono
— acp, client, ui_model yes Noto Sans Mono
• acp, large_text.py, plan.py, services yes Noto Sans Mono
… acp, registry, ui_model yes Noto Sans Mono
ℹ services no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
← dialogs, qt, sidebar_layout.py yes Noto Sans Mono
↑ app.py, sidebar_placement.py, widgets yes Noto Sans Mono
→ acp, animation, patch.py, registry yes Noto Sans Mono
↓ app.py, sidebar_placement.py, view_actio yes Noto Sans Mono
↗ registry, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols
↻⇄⋯ widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Math
− client, patch.py yes Noto Sans Mono
≠≤≥ dec.py yes Noto Sans Mono
≡ qt no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
⌕ widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols
⎺⎻⎼⎽┼▒◆ dec.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
⏎ prompt_actions.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
⏪⏳⬍ widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
⏭ services, widgets, windows no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
⏰ mixins no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Color Emoji (emoji-default)
⏱ core, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
␉␊␋␌␍␤ dec.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
␣ conversation_actions.py yes Noto Sans Symbols 2
─ acp, dec.py, large_text.py, message_rows no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
━▉▊▋▍▎▏▐░▸◀◌ widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
│ dec.py, large_text.py, qt, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
┌ dec.py, large_text.py, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
┐└┘ dec.py, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
├┤┬┴ dec.py, large_text.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
═║╔╗╚╝▌▾ client, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
╪╱╲╳╴╵╶╷╹ large_text.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
╭╮╯╰ large_text.py, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
▄ textual_colours.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
█ client, qt, textual_colours.py, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
▪▫◦ ? no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
▶▼ client, qt, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Mono
○ qt, registry, widgets yes Noto Sans Mono
● form_family.py, forms, ui_model, widgets yes Noto Sans Mono
☐☑☒⠁⠂⠄⠈⠐⠠⡀⡿⢀⢿⣟⣯⣷⣻⣽⣾⣿ ? no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
☰ preferences.py no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
⚠ services, shared no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
⚡⬅ shared no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
⚫❓ services no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
✅ services, shared no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Color Emoji (emoji-default)
✓ qt, registry, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
✔ acp, plan.py, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
✗ registry no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
❌ shared, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Color Emoji (emoji-default)
❯ preferences.py, widgets no: only Noto Sans Symbols (subset), on none of Qt's fallback lists Noto Sans Symbols 2
🎨🐸👉📁📄📜📡📣📦🔄🔍🔑🔔🔧🔬🗑🚀🚫🟢🧹 pictograph emoji only Noto Color Emoji (unchanged)

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

Box drawing, block elements, braille, arrows and symbols (the ☰ multi-line
message symbol, ✓, ❯, ⏎, table rules, the ANSI Shadow banner) drew as nothing
on Android: the one Android font holding them, a subset of Noto Sans Symbols,
is on none of Qt's per-family fallback lists, and Toad's own chain put Noto
Color Emoji first, so the symbols it does hold (↗ receipts, ⚠, ✔) drew orange.

toad.qt.glyph_fonts owns the fix: Noto Sans Mono, Noto Sans Symbols 2, Noto
Sans Symbols and Noto Sans Math (SIL OFL 1.1, subset with pyftsubset to the
blocks Toad draws, 454 KiB from 2.4 MiB) are registered at start and put in
every Qt font's fallback ahead of the emoji fonts: the application font's
families, and the substitutes for each family asked for by name (<pre> asks for
Courier New, the banner for the bundled monospace face). QtSplash.shown
registers them before the first frame paints, so the splash banner draws in
Noto Sans Mono; qt_drive and qt_scroll_profile, which open the client with no
splash, register them after making their QApplication. The APK ships them (ttf
beside pyc in source.include_exts). The old SYMBOL_FALLBACKS chain in
qt/client_start.py is deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
@trissim
trissim merged commit 0d938f9 into main Nov 18, 2026
1 of 2 checks passed
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