mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 13:21:38 +03:00
Avoid confusing error when the font has no bold/italic variant
refs: https://github.com/wez/wezterm/issues/617
This commit is contained in:
parent
f2334fc46c
commit
47e62cc243
@ -1380,9 +1380,24 @@ impl Config {
|
|||||||
if cfg.font_rules.is_empty() {
|
if cfg.font_rules.is_empty() {
|
||||||
// Expand out some reasonable default font rules
|
// Expand out some reasonable default font rules
|
||||||
let reduced = self.font.reduce_first_font_to_family();
|
let reduced = self.font.reduce_first_font_to_family();
|
||||||
let bold = reduced.make_bold();
|
let mut bold = reduced.make_bold();
|
||||||
let italic = reduced.make_italic();
|
let mut italic = reduced.make_italic();
|
||||||
let bold_italic = bold.make_italic();
|
let mut bold_italic = bold.make_italic();
|
||||||
|
|
||||||
|
// add the reduced version of the font as a fallback right after
|
||||||
|
// the bold/italic variants. Some users have installed just the
|
||||||
|
// regular weight variant of a font and we'd like to fall back
|
||||||
|
// to that weight in that case, rather than show them an error
|
||||||
|
bold.font.insert(1, reduced.font[0].clone());
|
||||||
|
italic.font.insert(1, reduced.font[0].clone());
|
||||||
|
bold_italic.font.insert(1, reduced.font[0].clone());
|
||||||
|
|
||||||
|
// and with that in mind: make sure that we flag these synthesized
|
||||||
|
// variants of fonts as fallbacks so that failure to resolve them
|
||||||
|
// doesn't trigger the error window
|
||||||
|
bold.font[0].is_fallback = true;
|
||||||
|
italic.font[0].is_fallback = true;
|
||||||
|
bold_italic.font[0].is_fallback = true;
|
||||||
|
|
||||||
cfg.font_rules.push(StyleRule {
|
cfg.font_rules.push(StyleRule {
|
||||||
italic: Some(true),
|
italic: Some(true),
|
||||||
|
@ -37,6 +37,7 @@ brief notes about them may accumulate here.
|
|||||||
* Fixed: macOS: middle mouse button wasn't recognized. Thanks to [@guswynn](https://github.com/guswynn)! [#599](https://github.com/wez/wezterm/pull/599)
|
* Fixed: macOS: middle mouse button wasn't recognized. Thanks to [@guswynn](https://github.com/guswynn)! [#599](https://github.com/wez/wezterm/pull/599)
|
||||||
* New: added [ActivateLastTab](config/lua/keyassignment/ActivateLastTab.md) key assignment for jumping back to a previously active tab. Thanks to [@alexgartrell](https://github.com/alexgartrell) [#610](https://github.com/wez/wezterm/pull/610)
|
* New: added [ActivateLastTab](config/lua/keyassignment/ActivateLastTab.md) key assignment for jumping back to a previously active tab. Thanks to [@alexgartrell](https://github.com/alexgartrell) [#610](https://github.com/wez/wezterm/pull/610)
|
||||||
* Fixed: added missing XTSMGRAPHICS query/response for sixel support [#609](https://github.com/wez/wezterm/issues/609)
|
* Fixed: added missing XTSMGRAPHICS query/response for sixel support [#609](https://github.com/wez/wezterm/issues/609)
|
||||||
|
* Fixed: avoid showing an error dialog for synthesized `font_rules` when the configuration specifies a font that doesn't have bold/italic variants. [#617](https://github.com/wez/wezterm/issues/617)
|
||||||
|
|
||||||
### 20210314-114017-04b7cedd
|
### 20210314-114017-04b7cedd
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user