macos: ignore LastResort font in fallback suggestions

refs: https://github.com/wez/wezterm/issues/4877
This commit is contained in:
Wez Furlong committed 2024-01-27 23:28:20 -07:00
1 parent 6de7c60452
commit e23ab47239
2 files changed
+12

No files matched your search

+4
View File
@@ -23,6 +23,10 @@ As features stabilize some brief notes about them will accumulate here.
#### Changed
* Not yet!
#### New
#### Fixed
* macOS: System LastResort font would be taken in preference to other fonts
in some cases when trying to find the fallback for bold fonts. #4877
### 20240127-113634-bbcac864
+8
View File
@@ -146,6 +146,14 @@ impl FontLocator for CoreTextFontLocator {
let candidates = handles_from_descriptor(&font.copy_descriptor());
for font in candidates {
if font.names().family == ".LastResort"
|| font.names().postscript_name.as_deref() == Some("LastResort")
{
// Always exclude a last resort font, as it has
// placeholder glyphs for everything
continue;
}
if let Ok(cov) = font.coverage_intersection(&wanted) {
if !cov.is_empty() {
matches.push((cov.len(), font));