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:
1 parent
341b7a5922
commit
9e301f30c6
17 files changed
+423
-313
No files matched your search
@@ -1422,3 +1422,47 @@ which is exactly the run nobody needs.
|
||||
`LogRing::try_tail_text`, because a panic raised while the ring's own
|
||||
lock was held would otherwise deadlock the hook and hang the process
|
||||
instead of aborting it.
|
||||
|
||||
## 2026-09-08: iris ships an icon font, and `widget::mark` is gone
|
||||
|
||||
Iris's question -- "why does mark exist? The font should be working if
|
||||
it's working for compose and nerd fonts are bundled" -- and its answer:
|
||||
the Compose app draws icons from its own committed Nerd Fonts subset,
|
||||
while iris was setting the disclosure mark with bare Unicode geometric
|
||||
codepoints out of whatever face the platform resolved. So iris now does
|
||||
what Compose does.
|
||||
|
||||
- **`iris::icon`** (new module): the codepoints iris draws, one constant
|
||||
each -- `OPEN`, `CLOSED`, `COLLAPSE` today. Every one has to have a
|
||||
matching entry in `iris/core/build-icon-font.sh`'s `GLYPHS`, which is
|
||||
what builds the shipped `iris/core/assets/fonts/nerd_icons.ttf` (992
|
||||
bytes, Material Design, Mono face). `every_icon_is_in_the_bundled_font`
|
||||
fails the build if the two lists drift.
|
||||
- **`Family::Icons`** (new variant): how any text asks for that family.
|
||||
Before/after:
|
||||
|
||||
// was
|
||||
mark(if open { Dir::DOWN } else { Dir::RIGHT }, 9.0, MUTED)
|
||||
// now
|
||||
text(if open { icon::OPEN } else { icon::CLOSED }, 9.0, MUTED)
|
||||
.family(Family::Icons)
|
||||
|
||||
It names an intention, not a font name: only `TextData` knows what the
|
||||
bundled file registered as, and it resolves the variant during shaping
|
||||
(`TextData::resolve_family`, also public). A *named* family rather than
|
||||
a generic one, so nothing falls back into it for ordinary text and an
|
||||
icon cannot fall back out of it onto a system face that happens to have
|
||||
the codepoint.
|
||||
- **`iris::widget::mark` is removed** -- added earlier the same day and
|
||||
superseded within it. It drew one correct triangle; 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.
|
||||
- **`FontDiagnostics::icon_family`** (new field), in the startup log line
|
||||
and the Diagnostics pane: which family the icons resolved to, so a
|
||||
build whose bundled font failed to register says so instead of drawing
|
||||
tofu.
|
||||
|
||||
This does not reopen the 2026-09-07 platform-fonts decision. Body and
|
||||
monospace text still come from the platform's own collection; an icon is
|
||||
the opposite case, a small closed set of codepoints no system font is
|
||||
guaranteed to have, and it is the same division the Compose app makes.
|
||||
Reference in new issue
Block a user