From f648d8a6a5a2c05aa16b636ffd0fe39c0a66593e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 25 Sep 2021 00:43:23 -0700 Subject: [PATCH] deps: Upgrade to freetype 2.11 --- deps/freetype/build.rs | 4 ++++ deps/freetype/freetype2 | 2 +- docs/changelog.md | 2 +- wezterm-font/src/ftwrap.rs | 12 ++++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/deps/freetype/build.rs b/deps/freetype/build.rs index 3422b6a0c..7e752f474 100644 --- a/deps/freetype/build.rs +++ b/deps/freetype/build.rs @@ -189,6 +189,10 @@ fn freetype() { "pshinter/pshinter.c", "psnames/psnames.c", "raster/raster.c", + "sdf/ftbsdf.c", + "sdf/ftsdf.c", + "sdf/ftsdfcommon.c", + "sdf/ftsdfrend.c", "sfnt/sfnt.c", "smooth/smooth.c", "truetype/truetype.c", diff --git a/deps/freetype/freetype2 b/deps/freetype/freetype2 index 6a2b3e400..801cd842e 160000 --- a/deps/freetype/freetype2 +++ b/deps/freetype/freetype2 @@ -1 +1 @@ -Subproject commit 6a2b3e4007e794bfc6c91030d0ed987f925164a8 +Subproject commit 801cd842e27c85cb1d5000f6397f382ffe295daa diff --git a/docs/changelog.md b/docs/changelog.md index 66145660e..6bcbf39e4 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -21,7 +21,7 @@ As features stabilize some brief notes about them will accumulate here. * New: X11 now supports IME. It currently defaults to disabled, but you can set `use_ime = true` in your config to enable it (you need to restart wezterm for this to take effect). Many thanks to [@H-M-H](https://github.com/H-M-H) for bringing xcb-imdkit to Rust and implementing this in wezterm! [#250](https://github.com/wez/wezterm/issues/250) [#1043](https://github.com/wez/wezterm/pull/1043) * New: it is now possible to define colors in the range 16-255 in `colors` and color scheme definitions. Thanks to [@potamides](https://github.com/potamides)! [#841](https://github.com/wez/wezterm/issues/841) [#1056](https://github.com/wez/wezterm/pull/1056) * Fixed: X11: laggy input after selecting text. [#1027](https://github.com/wez/wezterm/issues/1027) -* Updated: bundled harfbuzz to version 3.0.0 +* Updated: bundled harfbuzz to version 3.0.0, bundled freetype to 2.11 * Changed: X11: we now allow matching visuals with >= 8 bits per rgb value. Previously, we only matched exactly 8 bits. This improve compatibility with systems that have the COMPOSITE extension disabled. Thanks to [@shizeeg](https://github.com/shizeeg)! [#1083](https://github.com/wez/wezterm/pull/1083) * Fixed: macOS: `send_composed_key_when_left_alt_is_pressed` and `send_composed_key_when_right_alt_is_pressed` are now respected when `use_ime=true`. Thanks to [@jakelinnzy](https://github.com/jakelinnzy)! [#1096](https://github.com/wez/wezterm/pull/1096) * Fixed: X11: jittery resize with some window managers [#1051](https://github.com/wez/wezterm/issues/1051) diff --git a/wezterm-font/src/ftwrap.rs b/wezterm-font/src/ftwrap.rs index 5b9acd864..4b4d7d36e 100644 --- a/wezterm-font/src/ftwrap.rs +++ b/wezterm-font/src/ftwrap.rs @@ -472,6 +472,18 @@ impl Face { FT_GlyphSlot_Embolden(slot as *mut _); } + if let Some(size) = self.size.as_ref() { + if !size.is_scaled { + // Non-scaled == bitmap, which doesn't need to be rendered. + // We check specially for this because freetype 2.11 + // started to return an error in this case. + // + // This workaround can be removed when freetype 2.11.1 + // is released and we upgrade to it. + return Ok(slot); + } + } + ft_result(FT_Render_Glyph(slot, render_mode), ()) .context("load_and_render_glyph: FT_Render_Glyph")?; Ok(slot)