diff --git a/radio/src/gui/colorlcd/draw_functions.cpp b/radio/src/gui/colorlcd/draw_functions.cpp index 8fdd71ba3..fd2ec8566 100644 --- a/radio/src/gui/colorlcd/draw_functions.cpp +++ b/radio/src/gui/colorlcd/draw_functions.cpp @@ -580,7 +580,7 @@ void drawTextLines(BitmapBuffer * dc, coord_t left, coord_t top, coord_t width, { coord_t x = left; coord_t y = top; - coord_t line = getFontHeight(flags & 0xFFFF); + coord_t line = getFontHeightCondensed(flags & 0xFFFF); coord_t space = getTextWidth(" ", 1, flags); coord_t word; const char * nxt = str; diff --git a/radio/src/gui/colorlcd/fonts.cpp b/radio/src/gui/colorlcd/fonts.cpp index 06fb91910..8d4558204 100644 --- a/radio/src/gui/colorlcd/fonts.cpp +++ b/radio/src/gui/colorlcd/fonts.cpp @@ -45,6 +45,17 @@ #endif // BOOT +// used to set the line height to the line heights used in Edgetx < 2.7 and OpenTX +static const int8_t FontHeightCorrection[FONTS_COUNT] { + -2, // STD + -2, // BOLD + -2, // XXS + -2, // XS + -3, // L + -5, // XL + -2, // XXL +}; + const lv_font_t* getFont(LcdFlags flags) { #if defined(BOOT) @@ -62,6 +73,12 @@ uint8_t getFontHeight(LcdFlags flags) return lv_font_get_line_height(font); } +uint8_t getFontHeightCondensed(LcdFlags flags) +{ + auto font = getFont(flags); + return lv_font_get_line_height(font) + FontHeightCorrection[FONT_INDEX(flags)]; +} + int getTextWidth(const char * s, int len, LcdFlags flags) { auto font = getFont(flags); diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index 2ccef5198..3dc03495a 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit 2ccef5198aeb75295f1eb3d0c725bc91872ff7b9 +Subproject commit 3dc03495a699931acb0c39937f489a3bd9e8c693