1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

fonts: improve(!) identifying italic fonts

refs: #1162
This commit is contained in:
Wez Furlong 2021-09-22 11:00:06 -07:00
parent 0ee1f7529b
commit c1515404b7

View File

@ -189,8 +189,17 @@ impl ParsedFont {
};
let assume_emoji_presentation = has_color;
let names = Names::from_ft_face(&face);
let italic = italic || {
// Objectively gross, but freetype's italic property isn't always
// set for italic fonts.
// fontconfig resorts to name matching, so we do too :-/
let lower = names.full_name.to_lowercase();
lower.contains("italic") || lower.contains("kursiv")
};
Ok(Self {
names: Names::from_ft_face(&face),
names,
weight,
stretch,
italic,