Skip to main content

warn_notdef_glyph

Function warn_notdef_glyph 

Source
pub fn warn_notdef_glyph(seen: &mut BTreeSet<char>, ch: char) -> bool
Expand description

Warns, at most once per character, that ch did not resolve to its own glyph anywhere in the chain.

No font covered it, so FontChain::resolve substituted the solid block (or, for a chain built entirely from BitmapFont::with_charset fonts, some other font’s own notdef box) instead of ch’s real shape. That substitute is a legitimate cell on its own (a full block is a valid glyph to draw on purpose), so nothing about the rendered output distinguishes “this glyph is missing” from “this glyph is a block” without a diagnostic naming which one happened (crates-lurey-io/retroglyph#1292). Call this from the branch that already knows a resolved glyph was flagged ResolvedGlyph::is_notdef; both graphical backends do, right after their own resolve call, so the diagnostic and the character it names are identical on each.

seen is caller-owned state so a redraw loop reports each offending character once rather than every frame; entries are only ever added.

Returns whether a warning was emitted, which is always false in a build that compiles diagnostics out: the seen bookkeeping and the message both sit inside dev_only!, so a release build does neither. See BuildMode.