Expand description
Testing helpers for asserting glyph coverage against a font::FontChain
(testing::assert_glyphs_covered, testing::uncovered_glyphs).
Glyph-coverage testing helpers, feature-gated (testing), no effect on release builds.
A character no font in a FontChain covers still renders: it falls back to the substituted
solid block (or, rarely, draws nothing at all – see
FontChain::resolve). That fallback is a legitimate cell
on its own, so a snapshot test of the rendered output cannot tell “this glyph is missing” from
“this glyph is a block on purpose”: both are a stable, correctly-rendered image
(crates-lurey-io/retroglyph#1292). This module is the check that actually asks the question a
snapshot can’t: does chain.resolve(ch) answer with ch’s own glyph, or with the fallback?
diagnostics::warn_notdef_glyph catches the same gap
at render time in a dev build; this module is for asserting it directly in a test, over
whatever repertoire a consumer’s own UI actually draws, without hand-rolling a
resolve-and-check loop or scanning source text for character literals.
Functions§
- assert_
glyphs_ covered - Asserts every character in
charsrenders as itself inchain. - is_
glyph_ covered - Whether
chrenders as its own glyph inchain: covered by some font in the chain, not the substituted notdef fallback. - uncovered_
glyphs - Every character in
charsthat does not render as itself inchain, in iteration order, duplicates included.