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

+19 -17
View File
@@ -819,23 +819,25 @@ has the fuller account.
nothing on screen says it was cut. Whichever end is cut has to be a
choice when this lands: a path is identified by its tail, a command by
its head.
- [x] **A drawn chevron.** **Done 2026-09-08**: `iris::widget::mark(dir,
dp, colour)` rasterises an antialiased triangle into the ordinary
texture path and scales it into the box asked for, so no line/path
primitive was needed after all. `tool.rs` uses it for all three marks.
The original entry, for the record: *the bundled fonts
were removed on 2026-09-07 in favour of the platform collection, so the
mark is a codepoint the phone's own faces may not have -- Iris's
2026-09-08 screenshot shows an empty box where it should be, and the
desktop render draws it as a small dot. UI_RULES: "don't rely on
characters the platform might not have." iris has rects, text and
textures, so the smallest honest fix is a generated texture rather than
a new primitive.* `Chevron.kt` draws its own strokes precisely
because a chevron from a font is a glyph a system font may not have --
and the bundled `NotoSans-Regular.ttf` indeed has no U+25B8/25BE/25B4,
while `NotoSansMono-Regular.ttf` does. `tool.rs` sets the mark in the
monospace face as a result. A real fix needs a line/path primitive;
iris has rects, text and textures only.
- [x] **A chevron the platform cannot fail to have.** **Done
2026-09-08**, twice. First as `iris::widget::mark(dir, dp, colour)`,
which rasterised an antialiased triangle into the ordinary texture path
-- correct, but one bespoke shape, and it built a texture *per widget*,
which is what crashed the bench (RUST.md's 2026-09-08 evening entry).
Then, on Iris's question -- "why does mark exist? The font should be
working if it's working for compose and nerd fonts are bundled" -- as
what the Compose app has always done: **iris ships its own Nerd Fonts
subset** (`iris/core/build-icon-font.sh` -> `iris/core/assets/fonts/
nerd_icons.ttf`, 992 bytes, three Material Design glyphs), named in
`iris::icon` and drawn with `Family::Icons`. `mark` is deleted. That
serves every future icon rather than one triangle, and an icon is text,
so it takes the size, colour and baseline of the line it sits in for
free. The original entry, for the record: *the bundled fonts were
removed on 2026-09-07 in favour of the platform collection, so the mark
is a codepoint the phone's own faces may not have -- Iris's 2026-09-08
screenshot shows an empty box where it should be, and the desktop render
draws it as a small dot. UI_RULES: "don't rely on characters the
platform might not have."*
- [ ] **A tool card's text is not selectable.** `Selection` is keyed
`(RowKey, block index)` and a card has no markdown blocks, so nothing in
a card registers. Compose's `SelectionContainer` covers tool output,