diff --git a/LICENSE.md b/LICENSE.md index ed10878ce..72d0c0dc6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -20,6 +20,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -WezTerm bundles `JetBrains Mono` and `Noto Color Emoji` fonts. +WezTerm bundles `JetBrains Mono`, `Noto Color Emoji` and `Roboto` fonts. Those are distributed under the terms of the OFL 1.1, the text of which can be found in the assets/fonts directory. diff --git a/assets/fonts/Roboto-Black.ttf b/assets/fonts/Roboto-Black.ttf new file mode 100644 index 000000000..43a00e0df Binary files /dev/null and b/assets/fonts/Roboto-Black.ttf differ diff --git a/assets/fonts/Roboto-BlackItalic.ttf b/assets/fonts/Roboto-BlackItalic.ttf new file mode 100644 index 000000000..5082cdc4e Binary files /dev/null and b/assets/fonts/Roboto-BlackItalic.ttf differ diff --git a/assets/fonts/Roboto-Bold.ttf b/assets/fonts/Roboto-Bold.ttf new file mode 100644 index 000000000..374245790 Binary files /dev/null and b/assets/fonts/Roboto-Bold.ttf differ diff --git a/assets/fonts/Roboto-BoldItalic.ttf b/assets/fonts/Roboto-BoldItalic.ttf new file mode 100644 index 000000000..e85e7fb9e Binary files /dev/null and b/assets/fonts/Roboto-BoldItalic.ttf differ diff --git a/assets/fonts/Roboto-Italic.ttf b/assets/fonts/Roboto-Italic.ttf new file mode 100644 index 000000000..c9df607a4 Binary files /dev/null and b/assets/fonts/Roboto-Italic.ttf differ diff --git a/assets/fonts/Roboto-Light.ttf b/assets/fonts/Roboto-Light.ttf new file mode 100644 index 000000000..0e977514f Binary files /dev/null and b/assets/fonts/Roboto-Light.ttf differ diff --git a/assets/fonts/Roboto-LightItalic.ttf b/assets/fonts/Roboto-LightItalic.ttf new file mode 100644 index 000000000..3ad14fa7c Binary files /dev/null and b/assets/fonts/Roboto-LightItalic.ttf differ diff --git a/assets/fonts/Roboto-Medium.ttf b/assets/fonts/Roboto-Medium.ttf new file mode 100644 index 000000000..e89b0b79a Binary files /dev/null and b/assets/fonts/Roboto-Medium.ttf differ diff --git a/assets/fonts/Roboto-MediumItalic.ttf b/assets/fonts/Roboto-MediumItalic.ttf new file mode 100644 index 000000000..a5a41d3d0 Binary files /dev/null and b/assets/fonts/Roboto-MediumItalic.ttf differ diff --git a/assets/fonts/Roboto-Regular.ttf b/assets/fonts/Roboto-Regular.ttf new file mode 100644 index 000000000..3d6861b42 Binary files /dev/null and b/assets/fonts/Roboto-Regular.ttf differ diff --git a/assets/fonts/Roboto-Thin.ttf b/assets/fonts/Roboto-Thin.ttf new file mode 100644 index 000000000..7d084aed8 Binary files /dev/null and b/assets/fonts/Roboto-Thin.ttf differ diff --git a/assets/fonts/Roboto-ThinItalic.ttf b/assets/fonts/Roboto-ThinItalic.ttf new file mode 100644 index 000000000..c17338960 Binary files /dev/null and b/assets/fonts/Roboto-ThinItalic.ttf differ diff --git a/wezterm-font/src/lib.rs b/wezterm-font/src/lib.rs index db700070b..b31586a54 100644 --- a/wezterm-font/src/lib.rs +++ b/wezterm-font/src/lib.rs @@ -395,7 +395,6 @@ struct FontConfigInner { no_glyphs: RefCell>, title_font: RefCell>>, fallback_channel: RefCell>>, - system_title_font: RefCell>, } /// Matches and loads fonts for a given input style @@ -420,7 +419,6 @@ impl FontConfigInner { built_in: RefCell::new(Arc::new(FontDatabase::with_built_in()?)), no_glyphs: RefCell::new(HashSet::new()), fallback_channel: RefCell::new(None), - system_title_font: RefCell::new(None), }) } @@ -489,7 +487,7 @@ impl FontConfigInner { } } - let mut fonts = vec![if cfg!(target_os = "macos") { + let fonts = vec![if cfg!(target_os = "macos") { // "SF Pro" or one of the San Francisco font variants // are the official fonts for the macOS UI, but those // are not directly accessible to non-Apple applications, @@ -498,16 +496,10 @@ impl FontConfigInner { // but has slightly different spacing. // It's close enough for me! bold("Galvji") - } else if cfg!(windows) { - FontAttributes::new("Segoe UI") } else { - bold("Cantarell") + bold("Roboto") }]; - if !cfg!(windows) && !cfg!(target_os = "macos") { - fonts.push(bold("DejaVu Sans")); - } - let font_size = if cfg!(windows) { 10. } else { 12. }; ( @@ -519,11 +511,6 @@ impl FontConfigInner { ) } - fn advise_title_font(&self, info: Option<(ParsedFont, f64)>) { - self.title_font.borrow_mut().take(); - *self.system_title_font.borrow_mut() = info; - } - fn title_font(&self, myself: &Rc) -> anyhow::Result> { let config = self.config.borrow(); @@ -533,17 +520,10 @@ impl FontConfigInner { return Ok(Rc::clone(entry)); } - let (sys_font, mut sys_size) = Self::last_ditch_title_font(); + let (sys_font, sys_size) = Self::last_ditch_title_font(); let mut handles = vec![]; - if config.window_frame.font.is_none() { - if let Some((font, size)) = self.system_title_font.borrow().as_ref() { - handles.push(font.clone()); - sys_size = *size; - } - } - let font_size = config.window_frame.font_size.unwrap_or(sys_size); let text_style = config @@ -879,10 +859,6 @@ impl FontConfiguration { self.inner.resolve_font(&self.inner, style) } - pub fn advise_title_font(&self, info: Option<(ParsedFont, f64)>) { - self.inner.advise_title_font(info); - } - pub fn change_scaling(&self, font_scale: f64, dpi: usize) -> (f64, usize) { self.inner.change_scaling(font_scale, dpi) } diff --git a/wezterm-font/src/parser.rs b/wezterm-font/src/parser.rs index ec8249a25..4a501db33 100644 --- a/wezterm-font/src/parser.rs +++ b/wezterm-font/src/parser.rs @@ -537,6 +537,18 @@ pub(crate) fn load_built_in_fonts(font_info: &mut Vec) -> anyhow::Re font!("../../assets/fonts/JetBrainsMono-Regular.ttf"), font!("../../assets/fonts/JetBrainsMono-ThinItalic.ttf"), font!("../../assets/fonts/JetBrainsMono-Thin.ttf"), + font!("../../assets/fonts/Roboto-Black.ttf"), + font!("../../assets/fonts/Roboto-BlackItalic.ttf"), + font!("../../assets/fonts/Roboto-Bold.ttf"), + font!("../../assets/fonts/Roboto-BoldItalic.ttf"), + font!("../../assets/fonts/Roboto-Italic.ttf"), + font!("../../assets/fonts/Roboto-Light.ttf"), + font!("../../assets/fonts/Roboto-LightItalic.ttf"), + font!("../../assets/fonts/Roboto-Medium.ttf"), + font!("../../assets/fonts/Roboto-MediumItalic.ttf"), + font!("../../assets/fonts/Roboto-Regular.ttf"), + font!("../../assets/fonts/Roboto-Thin.ttf"), + font!("../../assets/fonts/Roboto-ThinItalic.ttf"), font!("../../assets/fonts/NotoColorEmoji.ttf"), font!("../../assets/fonts/PowerlineExtraSymbols.otf"), font!("../../assets/fonts/LastResortHE-Regular.ttf"), diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs index 6904c5e58..583962256 100644 --- a/wezterm-gui/src/termwindow/mod.rs +++ b/wezterm-gui/src/termwindow/mod.rs @@ -579,24 +579,6 @@ impl TermWindow { let dpi = config.dpi.unwrap_or_else(|| ::window::default_dpi()) as usize; let fontconfig = Rc::new(FontConfiguration::new(Some(config.clone()), dpi)?); - // If we need the title font, it's easier to extract that information - // from a cheeky temporary invisible window and use its metrics below. - if config.use_fancy_tab_bar { - let cheeky_window = Window::new_window( - &*WINDOW_CLASS.lock().unwrap(), - "wezterm", - 100, - 100, - Some(&config), - Rc::clone(&fontconfig), - move |_, _| {}, - ) - .await?; - - fontconfig.advise_title_font(cheeky_window.get_title_font_and_point_size()); - cheeky_window.close(); - } - let mux = Mux::get().expect("to be main thread with mux running"); let size = match mux.get_active_tab_for_window(mux_window_id) { Some(tab) => tab.get_size(),