From ed67add28a09cab342e8537ef2e061fd175aa2ad Mon Sep 17 00:00:00 2001 From: hz Date: Sat, 4 Nov 2023 14:31:18 +0100 Subject: [PATCH] Don't use Emoji fonts as monospace fallback --- src/font/fallback/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/font/fallback/mod.rs b/src/font/fallback/mod.rs index 4cf43828f5..845cf5daf0 100644 --- a/src/font/fallback/mod.rs +++ b/src/font/fallback/mod.rs @@ -130,10 +130,14 @@ impl<'a> Iterator for FontFallbackIter<'a> { } // Set a monospace fallback if Monospace family is not found if self.default_families[self.default_i - 1] == &Family::Monospace - && self.font_system.db().face(*id).map(|f| f.monospaced) == Some(true) && monospace_fallback.is_none() { - monospace_fallback = Some(id); + if let Some(face_info) = self.font_system.db().face(*id) { + // Don't use emoji fonts as Monospace + if face_info.monospaced && !face_info.post_script_name.contains("Emoji") { + monospace_fallback = Some(id); + } + } } } // If default family is Monospace fallback to first monospaced font