Log when default font family match fails due to weight mismatch

Uses missing_warn! (debug or warn depending on warn_on_missing_glyphs
feature) to surface when a requested family cannot be matched at the
desired weight, which is the root cause of variable font fallback
issues.
This commit is contained in:
Andy Terra 2026-03-05 16:56:49 -05:00 committed by Jeremy Soller
parent 5b9e2f2588
commit d2e3794fa8

View file

@ -331,7 +331,14 @@ impl<'a> FontFallbackIter<'a> {
}
match (is_mono, default_font_match_key.as_ref()) {
(false, None) => break 'DEF_FAM,
(false, None) => {
missing_warn!(
"No default font match for {:?} at weight {}",
self.default_families[self.default_i - 1],
self.ideal_weight.0,
);
break 'DEF_FAM;
}
(false, Some(m_key)) => {
if let Some(font) = self.font_system.get_font(m_key.id, self.ideal_weight) {
return Some(font);