Skip to content

Commit

Permalink
Don't use Emoji fonts as monospace fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
hz committed Nov 4, 2023
1 parent 163d8ef commit ed67add
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/font/fallback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed67add

Please sign in to comment.