From d5a28283cc022cb7df8862ee8aabcb38cef32fdf Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Tue, 22 Nov 2022 17:01:35 +0100 Subject: [PATCH] Fixed TFT_eSPI::fontHeight() with autobahn --- TFT_eSPI.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index 421de02..03e6964 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -3020,16 +3020,20 @@ uint16_t TFT_eSPI::fontsLoaded(void) ***************************************************************************************/ int16_t TFT_eSPI::fontHeight(int16_t font) { +#ifdef CONFIG_TFT_IS_AUTOBAHN + if (font == 4) + font = 1; +#endif + #ifdef SMOOTH_FONT if(fontLoaded) return gFont.yAdvance; #endif #ifdef LOAD_GFXFF - if (font==1) { - if(gfxFont) { // New font + if (font == 1) + if (gfxFont) // New font return pgm_read_byte(&gfxFont->yAdvance) * textsize; - } - } + #endif return pgm_read_byte( &fontdata[font].height ) * textsize; }