mirror of
https://github.com/wez/wezterm.git
synced 2024-11-22 22:42:48 +03:00
macos: constrain fallback to normal attributes
refs: https://github.com/wez/wezterm/issues/4808
This commit is contained in:
parent
a51c6a2638
commit
c4f16fe339
@ -25,6 +25,8 @@ As features stabilize some brief notes about them will accumulate here.
|
|||||||
* Not yet!
|
* Not yet!
|
||||||
#### New
|
#### New
|
||||||
#### Fixed
|
#### Fixed
|
||||||
|
* macOS: fallback fonts could select thin or otherwise unspecified font
|
||||||
|
attributes. #4808
|
||||||
|
|
||||||
### 20240128-202157-1e552d76
|
### 20240128-202157-1e552d76
|
||||||
|
|
||||||
|
@ -162,6 +162,17 @@ impl FontLocator for CoreTextFontLocator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let is_normal = font.weight() == FontWeight::REGULAR
|
||||||
|
&& font.stretch() == FontStretch::Normal
|
||||||
|
&& font.style() == FontStyle::Normal;
|
||||||
|
if !is_normal {
|
||||||
|
// Only use normal attributed text for fallbacks,
|
||||||
|
// otherwise we'll end up picking something with
|
||||||
|
// undefined and undesirable attributes
|
||||||
|
// <https://github.com/wez/wezterm/issues/4808>
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if let Ok(cov) = font.coverage_intersection(&wanted) {
|
if let Ok(cov) = font.coverage_intersection(&wanted) {
|
||||||
// Explicitly check coverage because the list may not
|
// Explicitly check coverage because the list may not
|
||||||
// actually match the text we asked about(!)
|
// actually match the text we asked about(!)
|
||||||
|
Loading…
Reference in New Issue
Block a user