symbol_glyphs test: compare against a private-use code point no font covers (review fix-up for #298)

U+25FB is a real glyph in DejaVu, so the test could pass while symbols still rendered as boxes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas 2026-10-11 13:14:30 -04:00
parent 6cf32cf4eb
commit 27ef18ec2c
1 changed files with 2 additions and 1 deletions

View File

@ -22,7 +22,8 @@ fn ui_symbols_have_glyphs_when_a_symbol_face_is_installed() {
let galley = ctx.fonts_mut(|f| f.layout_no_wrap(text.to_owned(), font.clone(), Color32::BLACK));
galley.rows.iter().flat_map(|r| r.glyphs.iter().map(|g| (g.chr, g.uv_rect))).collect::<Vec<_>>()
};
let tofu: Vec<_> = glyphs("\u{25FB}").into_iter().map(|(_, uv)| uv).collect();
// A private-use code point no font covers renders as the replacement box.
let tofu: Vec<_> = glyphs("\u{10FFFD}").into_iter().map(|(_, uv)| uv).collect();
let missing: String = glyphs(UI_SYMBOLS).into_iter().filter(|(_, uv)| tofu.contains(uv)).map(|(c, _)| c).collect();
assert!(missing.is_empty(), "these interface symbols render as boxes in {:?}: {missing}", font.family);
}