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:
parent
5b9e2f2588
commit
d2e3794fa8
1 changed files with 8 additions and 1 deletions
|
|
@ -331,7 +331,14 @@ impl<'a> FontFallbackIter<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
match (is_mono, default_font_match_key.as_ref()) {
|
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)) => {
|
(false, Some(m_key)) => {
|
||||||
if let Some(font) = self.font_system.get_font(m_key.id, self.ideal_weight) {
|
if let Some(font) = self.font_system.get_font(m_key.id, self.ideal_weight) {
|
||||||
return Some(font);
|
return Some(font);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue