1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00

fonts: fix automatic bold synthesis

For fonts like Lucida Console on Windows which do not have a bold
variant, we were not synthesizing bold.

The reason was that the config-level "make bold" logic works by adding
200 to the weight which takes normal -> demibold, but the bold synthesis
logic is enabled only for bold and higher.

This commit changes the threshold for synthesis to demibold or higher.

refs: https://github.com/wez/wezterm/issues/2074
This commit is contained in:
Wez Furlong 2022-06-05 06:32:36 -07:00
parent 9b6329b454
commit e7258e0e03
2 changed files with 2 additions and 1 deletions

View File

@ -77,6 +77,7 @@ As features stabilize some brief notes about them will accumulate here.
* Wayland: panic when display scaling is enabled. [#1727](https://github.com/wez/wezterm/issues/1727)
* `Dark+` color scheme background color [#2013](https://github.com/wez/wezterm/pull/2013)
* Avoid fragmenting XTVERSION, DA2, DA3 query responses [#2060](https://github.com/wez/wezterm/issues/2060)
* Synthesized bold didn't kick in for automatically computed `font_rules`. [#2074](https://github.com/wez/wezterm/issues/2074)
### 20220408-101518-b908e2dd

View File

@ -656,7 +656,7 @@ impl ParsedFont {
self.scale = attr.scale.map(|f| *f);
self.synthesize_italic = self.style == FontStyle::Normal && attr.style != FontStyle::Normal;
self.synthesize_bold = attr.weight >= FontWeight::BOLD
self.synthesize_bold = attr.weight >= FontWeight::DEMIBOLD
&& attr.weight > self.weight
&& self.weight <= FontWeight::REGULAR;
self.synthesize_dim = attr.weight < FontWeight::REGULAR