iris: ship an icon font subset, and delete the drawn mark

Iris asked why `mark` existed at all -- "the font should be working if
it's working for compose and nerd fonts are bundled". It was not: the
Compose app draws its icons from its own committed Nerd Fonts subset,
while iris, which bundles no font since 2026-09-07, was setting the
disclosure mark with bare geometric codepoints (U+25B8/25BE/25B4) out of
whatever face the platform resolved -- an empty box on her phone, a dot
on this VM. The 2026-09-07 note that "iris had no equivalent icon font to
keep" is the gap: it had none because it had never had one.

So iris ships the same kind of subset. iris/core/build-icon-font.sh is
the Compose script with its own GLYPHS list, writing a 992-byte
nerd_icons.ttf with three Material Design glyphs from the Mono face;
iris::icon names the codepoints; Family::Icons is how text asks for them.
The variant names an intention rather than a font name -- only TextData
knows what the file registered as, and it resolves it during shaping --
and it is a named family, never a generic one, so nothing falls back into
it for text and an icon cannot fall back out of it onto a system face
that happens to have the codepoint.

every_icon_is_in_the_bundled_font maps each constant through the shipped
font's charmap, which is the guard the script's "the two lists have to
agree" comment asks for. FontDiagnostics gains icon_family, so a build
whose font failed to register says so instead of drawing tofu; the
emulator reports icons=Some("Symbols Nerd Font Mono").

widget/mark.rs is deleted. It drew one correct triangle, but every
further icon would have been another rasteriser, and an icon as text
takes the size, colour and baseline of the line it sits in for free.

Looked at rather than only compiled: closed and open marks in
run-headless.sh phone --phone either side of a tap, and the collapse
bar's up mark under IRIS_TOOLS_EXPANDED=1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
irisandClaude Opus 5 committed 2026-09-08 14:42:16 -04:00
1 parent 341b7a5922
commit 9e301f30c6
17 files changed
+423 -313

No files matched your search

+43 -11
View File
@@ -8143,16 +8143,48 @@ recorded anywhere. It is the crash this code had; the devlog fix above is
what will say whether it was hers. Ask for the Runtime tab after the next
bench APK.
### Open: why `mark` exists at all (Iris asked, 2026-09-08)
### Why `mark` existed, and what replaced it (Iris asked, 2026-09-08)
Her question, mid-fix: "why does mark exist? The font should be working if
it's working for compose and nerd fonts are bundled." The Compose app
draws its chevron from **its own committed Nerd Fonts subset**
(`app/build-icon-font.sh`, `NerdIcons.kt`); iris bundles no font at all
since 2026-09-07, and `tool.rs` was using bare geometric codepoints
(U+25B8/25BE/25B4) out of whatever system face resolved -- which her phone
had none for. So the two apps were never doing the same thing, and the
2026-09-07 note that "iris had no equivalent icon font to keep" is what
left the gap. The alternative to `mark` is to bundle the same ~100-glyph
subset in iris and take icons from it, which would serve every future icon
rather than one triangle. Not done: it is hers to choose.
it's working for compose and nerd fonts are bundled." It was not working,
and the two apps were never doing the same thing. The Compose app draws
its icons from **its own committed Nerd Fonts subset**
(`app/build-icon-font.sh`, `NerdIcons.kt`); iris bundles no font since
2026-09-07, and `tool.rs` was setting its mark with bare geometric
codepoints (U+25B8/25BE/25B4) out of whatever system face resolved --
which her phone had none for. The 2026-09-07 note that "iris had no
equivalent icon font to keep" is the gap: iris had none because it had
never had one.
**Done, on her instruction.** iris ships the same kind of subset:
- `iris/core/build-icon-font.sh` -- a copy of the Compose app's script
with its own `GLYPHS` list, writing
`iris/core/assets/fonts/nerd_icons.ttf`. **992 bytes** for three
Material Design glyphs (`md-menu_down`, `md-menu_right`, `md-menu_up`),
from the **Mono** face for the reason the Compose script gives.
- `iris::icon` names the codepoints, one constant each, and
`iris_core::Family::Icons` is how a `TextBuilder` asks for the family.
The name behind it is read back from the collection at registration
rather than written down, and resolved during shaping
(`TextData::resolve_family`), so nothing outside `TextData` needs to
know what the file calls itself. A *named* family, never a generic one:
nothing should fall back into it for text, and an icon must not fall
back out of it onto a system face that happens to have the codepoint.
- `iris::widget::mark` and `src/widget/mark.rs` are **deleted**.
`tool.rs`'s three call sites are `disclosure(icon::OPEN | CLOSED |
COLLAPSE)`, which is `text(...).family(Family::Icons)`.
- `every_icon_is_in_the_bundled_font` is the guard the script's comment
asks for: it maps each `icon::` constant through the shipped font's own
charmap, so a constant added on one side and not the other fails a test
instead of drawing nothing.
- The startup font line and the Diagnostics pane now say which family the
icons resolved to, so a build whose font failed to register says so
rather than drawing tofu. On the emulator:
`icons=Some("Symbols Nerd Font Mono")`.
Looked at, per UI_RULES, rather than only compiled: the closed and open
marks in `run-headless.sh phone --phone` (before and after a tap that
opens the card), and the collapse bar's up mark in `IRIS_TOOLS_EXPANDED=1
run-headless.sh transcript`. All three draw, at the size and alignment the
drawn triangle had.