From a5bb5be80aa5e9e5ae49400507a43523ae2edf2d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 5 Apr 2021 09:27:01 -0700 Subject: [PATCH] fonts: fix other platforms and tests Ungh, shouldn't push before I'm awake :-/ refs: #648 --- wezterm-font/src/lib.rs | 2 +- wezterm-font/src/locator/core_text.rs | 1 + wezterm-font/src/locator/gdi.rs | 1 + wezterm-font/src/shaper/harfbuzz.rs | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wezterm-font/src/lib.rs b/wezterm-font/src/lib.rs index 149cbc2a9..e66314a40 100644 --- a/wezterm-font/src/lib.rs +++ b/wezterm-font/src/lib.rs @@ -280,7 +280,7 @@ impl FontConfigInner { } for attr in &attributes { - if !attr.is_fallback && !loaded.contains(attr) { + if !attr.is_synthetic && !attr.is_fallback && !loaded.contains(attr) { let styled_extra = if attr.bold || attr.italic { ". A bold or italic variant of the font was requested; \ TrueType and OpenType fonts don't have an automatic way to \ diff --git a/wezterm-font/src/locator/core_text.rs b/wezterm-font/src/locator/core_text.rs index fb9acda32..ac5b14a36 100644 --- a/wezterm-font/src/locator/core_text.rs +++ b/wezterm-font/src/locator/core_text.rs @@ -151,6 +151,7 @@ fn build_fallback_list_impl() -> anyhow::Result> { bold: false, italic: false, is_fallback: true, + is_synthetic: true, }; if let Ok(descriptor) = descriptor_from_attr(&symbols) { if let Some(handle) = handle_from_descriptor(&descriptor) { diff --git a/wezterm-font/src/locator/gdi.rs b/wezterm-font/src/locator/gdi.rs index c6c49d9eb..b8f279016 100644 --- a/wezterm-font/src/locator/gdi.rs +++ b/wezterm-font/src/locator/gdi.rs @@ -309,6 +309,7 @@ impl FontLocator for GdiFontLocator { italic: false, family: font.family_name(), is_fallback: true, + is_synthetic: true, }; if !resolved.contains(&attr) { diff --git a/wezterm-font/src/shaper/harfbuzz.rs b/wezterm-font/src/shaper/harfbuzz.rs index c26278184..ec3e7e288 100644 --- a/wezterm-font/src/shaper/harfbuzz.rs +++ b/wezterm-font/src/shaper/harfbuzz.rs @@ -469,6 +469,7 @@ mod test { family: "JetBrains Mono".into(), bold: false, is_fallback: false, + is_synthetic: false, italic: false, }) .unwrap()