diff --git a/config/src/lib.rs b/config/src/lib.rs index 39c4432d9..ba30a90a1 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -558,6 +558,12 @@ pub struct Config { #[serde(default)] pub font_antialias: FontAntiAliasing, + /// Selects the freetype interpret version to use. + /// Likely values are 35, 38 and 40 which have different + /// characteristics with respective to subpixel hinting. + /// See https://freetype.org/freetype2/docs/subpixel-hinting.html + pub freetype_interpreter_version: Option, + /// Specify the features to enable when using harfbuzz for font shaping. /// There is some light documentation here: /// diff --git a/wezterm-font/src/ftwrap.rs b/wezterm-font/src/ftwrap.rs index a7209bde2..13adaa781 100644 --- a/wezterm-font/src/ftwrap.rs +++ b/wezterm-font/src/ftwrap.rs @@ -245,14 +245,17 @@ impl Library { let lib = ft_result(res, lib).context("FT_Init_FreeType")?; let mut lib = Library { lib }; - let interpreter_version: FT_UInt = 38; - unsafe { - FT_Property_Set( - lib.lib, - b"truetype\0" as *const u8 as *const FT_String, - b"interpreter-version\0" as *const u8 as *const FT_String, - &interpreter_version as *const FT_UInt as *const _, - ); + let config = configuration(); + if let Some(vers) = config.freetype_interpreter_version { + let interpreter_version: FT_UInt = vers; + unsafe { + FT_Property_Set( + lib.lib, + b"truetype\0" as *const u8 as *const FT_String, + b"interpreter-version\0" as *const u8 as *const FT_String, + &interpreter_version as *const FT_UInt as *const _, + ); + } } // Due to patent concerns, the freetype library disables the LCD