From fd813d0e6cfff57cf8a8f55e9a249ddb6fbdb6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 28 Jul 2023 15:36:48 +0200 Subject: [PATCH] font baseline: use max(font->height, font->ascent + font->descent) when calculating font height This is how it's done when calculating the cell height, and we should do the same thing when calculating the font baseline. --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 5736400b..d4132c24 100644 --- a/terminal.c +++ b/terminal.c @@ -2181,7 +2181,7 @@ term_font_baseline(const struct terminal *term) { const struct fcft_font *font = term->fonts[0]; const int line_height = term->cell_height; - const int font_height = font->ascent + font->descent; + const int font_height = max(font->height, font->ascent + font->descent); const int glyph_top_y = round((line_height - font_height) / 2.); return term->font_y_ofs + glyph_top_y + font->ascent;