Allow fallback to fonts with mismatched stretch or style

This commit is contained in:
Todd York 2026-01-01 14:15:22 +08:00 committed by Jeremy Soller
parent cfb7224370
commit e9075aeae8
2 changed files with 37 additions and 19 deletions

View file

@ -319,13 +319,6 @@ impl<'a> Attrs<'a> {
self
}
/// Check if font matches
pub fn matches(&self, face: &fontdb::FaceInfo) -> bool {
//TODO: smarter way of including emoji
face.post_script_name.contains("Emoji")
|| (face.style == self.style && face.stretch == self.stretch)
}
/// Check if this set of attributes can be shaped with another
pub fn compatible(&self, other: &Self) -> bool {
self.family == other.family