From cc11326baa1d8991c99be969795abd675b10d46e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Feb 2022 07:51:15 +0530 Subject: [PATCH] Linux: Do not rescale fallback fonts to match the main font cell height Fixes #4707 --- docs/changelog.rst | 4 ++++ kitty/freetype.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3e098d4b6..b547e7dc9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -98,6 +98,10 @@ Detailed list of changes - A new action :ac:`copy_ansi_to_clipboard` to copy the current selection with ANSI formatting codes (:iss:`4665`) +- Linux: Do not rescale fallback fonts to match the main font cell height, instead just + set the font size and let FreeType take care of it. This matches + rendering on macOS (:iss:`4707`) + - macOS: Fix a regression in the previous release that broke switching input sources by keyboard (:iss:`4621`) diff --git a/kitty/freetype.c b/kitty/freetype.c index 5e187c06f..40a244a40 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -143,11 +143,6 @@ static bool set_font_size(Face *self, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt xdpi, FT_UInt ydpi, unsigned int desired_height, unsigned int cell_height) { int error = FT_Set_Char_Size(self->face, 0, char_height, xdpi, ydpi); if (!error) { - unsigned int ch = calc_cell_height(self, false); - if (desired_height && ch != desired_height) { - FT_F26Dot6 h = (FT_F26Dot6)floor((double)char_height * (double)desired_height / (double) ch); - return set_font_size(self, 0, h, xdpi, ydpi, 0, cell_height); - } self->char_width = char_width; self->char_height = char_height; self->xdpi = xdpi; self->ydpi = ydpi; if (self->harfbuzz_font != NULL) hb_ft_font_changed(self->harfbuzz_font); } else {