Add more script specific fallbacks

This commit is contained in:
Jeremy Soller 2022-10-13 13:26:06 -06:00
parent f91cb3ce0f
commit fec418b3b1
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
4 changed files with 65 additions and 26 deletions

View file

@ -126,21 +126,12 @@ impl<'a> FontMatches<'a> {
}
}
if scripts.len() > 1 {
log::info!(
" Word {:?}{}: '{}'",
scripts,
if blank { " BLANK" } else { "" },
&line[start_word..end_word],
);
} else {
log::trace!(
" Word {:?}{}: '{}'",
scripts,
if blank { " BLANK" } else { "" },
&line[start_word..end_word],
);
}
log::trace!(
" Word {:?}{}: '{}'",
scripts,
if blank { " BLANK" } else { "" },
&line[start_word..end_word],
);
//TODO: configure default family
let mut font_iter = FontFallbackIter::new(&self.fonts, Some("Fira Sans"), scripts, &self.locale);
@ -226,6 +217,9 @@ impl<'a> FontMatches<'a> {
}
}
// Debug missing font fallbacks
font_iter.check_missing(&line[start_word..end_word]);
/*
for glyph in glyphs.iter() {
log::trace!("'{}': {}, {}, {}, {}", &line[glyph.start..glyph.end], glyph.x_advance, glyph.y_advance, glyph.x_offset, glyph.y_offset);