Fixed TFT_eSPI::fontHeight() with autobahn

This commit is contained in:
2022-11-22 17:01:35 +01:00
parent df3784b4e8
commit d5a28283cc

View File

@@ -3020,16 +3020,20 @@ uint16_t TFT_eSPI::fontsLoaded(void)
***************************************************************************************/ ***************************************************************************************/
int16_t TFT_eSPI::fontHeight(int16_t font) int16_t TFT_eSPI::fontHeight(int16_t font)
{ {
#ifdef CONFIG_TFT_IS_AUTOBAHN
if (font == 4)
font = 1;
#endif
#ifdef SMOOTH_FONT #ifdef SMOOTH_FONT
if(fontLoaded) return gFont.yAdvance; if(fontLoaded) return gFont.yAdvance;
#endif #endif
#ifdef LOAD_GFXFF #ifdef LOAD_GFXFF
if (font==1) { if (font == 1)
if(gfxFont) { // New font if (gfxFont) // New font
return pgm_read_byte(&gfxFont->yAdvance) * textsize; return pgm_read_byte(&gfxFont->yAdvance) * textsize;
}
}
#endif #endif
return pgm_read_byte( &fontdata[font].height ) * textsize; return pgm_read_byte( &fontdata[font].height ) * textsize;
} }