Repository navigation
qt fonts: ship the glyph fonts Toad draws with, ahead of emoji (Android tofu and orange symbols) - #2105
Merged
Conversation
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
force-pushed
the
fork-android-fonts
branch
from
November 18, 2026 07:15
2b1876c to
7b05b08
Compare
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.
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).
<pre>'sCourier Newshowed nothing.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_fontssrc/toad/qt/fonts/OFL.txt).pyftsubsetto 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.install_glyph_fonts) and placed in every Qt font's fallback, ahead of the emoji fonts:Courier New/courier(Qt HTML<pre>/<code>, which is how history rows draw),monospace, pyqt-reactive'sArial/Courier/Consolas, Android's own faces, and each bundled family itself.qt/banner.py's banner (welcome and splash) draws in the bundledNoto Sans Mono, so its block and box glyphs share one cell grid on every platform.QtSplash.shownregisters the fonts before the first frame paints, so the splash banner already draws in Noto Sans Mono.qt_driveandqt_scroll_profileopen the client without a splash, so they register the fonts right after creating their QApplication.ttfis added tosource.include_exts, alongside qt start: first frame in 0.3 s at phone speed; APK ships bytecode; settings pages build lazily #2104'spyc.SYMBOL_FALLBACKS/use_symbol_fallbacksinqt/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).monospace<pre>(history rows)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:
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 holdstoad/qt/fonts/*.ttf.install_glyph_fontsraises 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.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3