1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 14:22:37 +03:00

fonts: allow svg fonts to take precedence over bitmap versions

But note that we don't currently render svg

refs: https://github.com/wez/wezterm/issues/4148
This commit is contained in:
Wez Furlong 2023-08-14 20:23:17 -07:00
parent 0f1ffacefc
commit 8c77ea1d9e
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -617,7 +617,12 @@ impl ParsedFont {
// Reduce to matching weight
candidates.retain(|&idx| fonts[idx].weight == weight);
// Check for best matching pixel strike
// Check for best matching pixel strike, but only if all
// candidates have pixel strikes
if candidates
.iter()
.all(|&idx| !fonts[idx].pixel_sizes.is_empty())
{
if let Some((_distance, idx)) = candidates
.iter()
.map(|&idx| {
@ -633,6 +638,7 @@ impl ParsedFont {
{
return Some(idx);
}
}
// The first one in this set is our best match
candidates.into_iter().next()