macos: ignore LastResort font in fallback suggestions
refs: https://github.com/wez/wezterm/issues/4877
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user