Skip to content

fix(lens): load every symbol face, and stop failing on a host's missing emoji font - #33

Merged
h4x0r merged 1 commit into
mainfrom
fix/lens-font-fallback
Aug 20, 2026
Merged

h4x0r merged 1 commit into
mainfrom
fix/lens-font-fallback

Conversation

@h4x0r

@h4x0r h4x0r commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

tests/fonts.rs failed with ['🌐', '⚙'] uncovered. Two different problems wearing one error message, and only one was a bug.

⚙ was a real, user-visible bug

fallback_fonts() took first_readable(SYMBOL_FONTS) — one face. But Linux spreads symbol coverage across several that do not subsume one another:

face ◷ ⚙ 🌐
Noto Symbols2 ✓ ✗ ✗
Noto Symbols ✗ ✓ ✗
DejaVu Sans ✗ ✓ ✗
emoji face ✗ ✗ ✓

A host with Symbols2 installed rendered ⚙ as tofu in the overlay while a face that covers it sat unread beside it. Every readable symbol face is now loaded — as SCRIPT_FONTS already did — and the candidate list gains Noto Symbols, DejaVu and the platform emoji faces.

That is a rendering fix, not a test fix. Anyone running the overlay on such a host was seeing the box.

🌐 was not a bug

U+1F310 is astral and lives only in an emoji face; a host with none installed cannot render it whatever we ship. Failing on that made the test an audit of the developer's font packages rather than of the code — and it is exactly the kind of red that gets waved off until it hides something real.

The test now separates the two:

  • non-astral symbols — asserted unconditionally. An uncovered one means the chrome grew a glyph nothing carries, or SYMBOL_FONTS is missing a face. Both are ours.
  • astral symbols — asserted only when an emoji face is loaded. When it is not, the skip is reported by name:
no emoji face on this host — NOT checked: ['🌐'] (install a Noto Color Emoji /
Segoe UI Emoji / Apple Color Emoji face to cover them)

A silent skip would let the symbol set drift while the test still read green.

Proven to still fail

My first control was worthless: U+2C7F is covered by DejaVu, so the mutation passed and proved nothing. Probing the loaded stack for a genuinely uncovered codepoint gave U+A7CB; adding it to UI_SYMBOLS turns the test red and names the glyph, removing it turns it green.

lens: clippy -D warnings clean, 108 tests pass.

@h4x0r
h4x0r force-pushed the fix/lens-font-fallback branch from 8e161ec to 910bc4c Compare August 20, 2026 23:03
…ng emoji font

`tests/fonts.rs` failed on a Linux host with `['🌐', '⚙']` uncovered. Two
different problems wore one error message.

⚙ WAS A REAL BUG. `fallback_fonts()` took `first_readable(SYMBOL_FONTS)` -- one
face -- but Linux spreads symbol coverage across several that do not subsume one
another: Noto Symbols2 carries ◷ and not ⚙, Noto Symbols carries ⚙ and not 🌐,
and DejaVu carries ⚙ where Noto is absent. A host with Symbols2 installed
rendered ⚙ as tofu in the overlay while a face that covers it sat unread beside
it. Every readable symbol face is now loaded, as SCRIPT_FONTS already did, and
the candidate list gains Noto Symbols, DejaVu, and the platform emoji faces.

That is a user-visible rendering fix, not a test fix. Anyone running the overlay
on such a host was seeing the box.

🌐 WAS NOT A BUG. U+1F310 is astral and lives only in an emoji face; a host with
none installed cannot render it whatever we ship. Failing on that made the test
an audit of the developer's font packages rather than of the code -- and it is
exactly the kind of red that gets waved off until it hides something real.

The test now separates the two. Non-astral symbols are asserted unconditionally:
an uncovered one means the chrome grew a glyph nothing carries, or SYMBOL_FONTS
is missing a face, and both are ours to fix. Astral symbols are asserted only
when an emoji face is actually loaded -- and when it is not, the skip is REPORTED
BY NAME:

    no emoji face on this host — NOT checked: ['🌐'] (install a Noto Color
    Emoji / Segoe UI Emoji / Apple Color Emoji face to cover them)

A silent skip would let the symbol set drift while the test still read green.

PROVEN TO STILL FAIL. The first control I wrote was worthless: U+2C7F is covered
by DejaVu, so the mutation passed and proved nothing. Probing the loaded stack
for a genuinely uncovered codepoint gave U+A7CB; adding it to UI_SYMBOLS turns
the test red and names the glyph, and removing it turns it green again.

FOLLOW-UP after CI disagreed with the local run.

Loading every symbol face made the stack non-empty on the CI runners, where it
had been empty -- so the old `stack.is_empty()` skip stopped firing and the test
began running there for the first time. It immediately reported the pillar
labels and era kanji as tofu, because the ubuntu runner has no CJK face. Correct
observation, wrong conclusion to draw from it: that is the runner's font
packages, not this code.

So the partition is by REQUIRED FACE CLASS rather than by astral-ness. A symbol
is checked only when a face of its class actually parsed -- emoji for astral,
CJK for Han, any face otherwise -- and an unchecked class is named in the output.

`loaded()` now asks the PARSED faces, not the stack. NotoColorEmoji is a CBDT
bitmap font; a parser that declines it would otherwise leave the key present,
the glyph uncovered, and the test failing for a symbol nothing could render.

And the skip is closed rather than merely reported: the Lens build job now
installs fonts-noto-cjk, fonts-noto-core and fonts-noto-color-emoji, so CI is a
host where every class CAN be checked. A skip that fires on every run is a check
that never runs.
@h4x0r
h4x0r force-pushed the fix/lens-font-fallback branch from 910bc4c to 9f24730 Compare August 20, 2026 23:12
@h4x0r
h4x0r merged commit deb9376 into main Aug 20, 2026
33 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