diff --git a/config/src/lib.rs b/config/src/lib.rs index fcbda87fd..f5253b7ce 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -1095,6 +1095,9 @@ pub struct Config { #[serde(default)] pub sort_fallback_fonts_by_coverage: bool, + #[serde(default)] + pub search_font_dirs_for_fallback: bool, + #[serde(default)] pub swallow_mouse_click_on_pane_focus: bool, diff --git a/wezterm-font/src/lib.rs b/wezterm-font/src/lib.rs index 208cbb06b..2a4d0905b 100644 --- a/wezterm-font/src/lib.rs +++ b/wezterm-font/src/lib.rs @@ -224,15 +224,26 @@ impl FontConfigInner { fallback_str.escape_unicode() ); - match font_dirs.locate_fallback_for_codepoints(&no_glyphs) { + match locator.locate_fallback_for_codepoints(&no_glyphs) { Ok(ref mut handles) => extra_handles.append(handles), Err(err) => log::error!( - "Error: {:#} while resolving fallback for {} from font_dirs", + "Error: {:#} while resolving fallback for {} from font-locator", err, fallback_str.escape_unicode() ), } + if config.search_font_dirs_for_fallback { + match font_dirs.locate_fallback_for_codepoints(&no_glyphs) { + Ok(ref mut handles) => extra_handles.append(handles), + Err(err) => log::error!( + "Error: {:#} while resolving fallback for {} from font_dirs", + err, + fallback_str.escape_unicode() + ), + } + } + match built_in.locate_fallback_for_codepoints(&no_glyphs) { Ok(ref mut handles) => extra_handles.append(handles), Err(err) => log::error!( @@ -242,15 +253,6 @@ impl FontConfigInner { ), } - match locator.locate_fallback_for_codepoints(&no_glyphs) { - Ok(ref mut handles) => extra_handles.append(handles), - Err(err) => log::error!( - "Error: {:#} while resolving fallback for {} from font-locator", - err, - fallback_str.escape_unicode() - ), - } - let mut wanted = RangeSet::new(); for c in no_glyphs { wanted.add(c as u32);