mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 22:01:47 +03:00
fonts: tune up fallback font resolution
* Check built-in fonts before asking the system for codepoint coverage * If one of the earlier stages resolved some fonts, skip the remaining stages and speculatively shape what we have. This avoids triggering the system font lookup for fonts that are present in the font_dirs or that are built-in, such as powerline symbols. refs: https://github.com/wez/wezterm/issues/559
This commit is contained in:
parent
961e4ef9f7
commit
f7b0ea2eb7
@ -95,29 +95,34 @@ impl LoadedFont {
|
|||||||
fallback_str.escape_debug()
|
fallback_str.escape_debug()
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
match font_config
|
|
||||||
.locator
|
if extra_handles.is_empty() {
|
||||||
.locate_fallback_for_codepoints(&no_glyphs)
|
match font_config
|
||||||
{
|
.built_in
|
||||||
Ok(ref mut handles) => extra_handles.append(handles),
|
.borrow()
|
||||||
Err(err) => log::error!(
|
.locate_fallback_for_codepoints(&no_glyphs)
|
||||||
"Error: {} while resolving fallback for {} from font-locator",
|
{
|
||||||
err,
|
Ok(ref mut handles) => extra_handles.append(handles),
|
||||||
fallback_str.escape_debug()
|
Err(err) => log::error!(
|
||||||
),
|
"Error: {} while resolving fallback for {} for built-in fonts",
|
||||||
|
err,
|
||||||
|
fallback_str.escape_debug()
|
||||||
|
),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match font_config
|
if extra_handles.is_empty() {
|
||||||
.built_in
|
match font_config
|
||||||
.borrow()
|
.locator
|
||||||
.locate_fallback_for_codepoints(&no_glyphs)
|
.locate_fallback_for_codepoints(&no_glyphs)
|
||||||
{
|
{
|
||||||
Ok(ref mut handles) => extra_handles.append(handles),
|
Ok(ref mut handles) => extra_handles.append(handles),
|
||||||
Err(err) => log::error!(
|
Err(err) => log::error!(
|
||||||
"Error: {} while resolving fallback for {} for built-in fonts",
|
"Error: {} while resolving fallback for {} from font-locator",
|
||||||
err,
|
err,
|
||||||
fallback_str.escape_debug()
|
fallback_str.escape_debug()
|
||||||
),
|
),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if extra_handles.is_empty() {
|
if extra_handles.is_empty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user