From a2279cbdf3e87d1ac737b90b2bfdb488e9535d3f Mon Sep 17 00:00:00 2001 From: maxpautsch <29801538+maxpautsch@users.noreply.github.com> Date: Sun, 24 Jun 2018 10:15:43 +0200 Subject: [PATCH] added fontHeight() function with no parameter to be consistent with the textWith function and others. no parameter means default font. --- TFT_eSPI.cpp | 4 ++++ TFT_eSPI.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index b63a1bc..1fbcd63 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -2141,6 +2141,10 @@ int16_t TFT_eSPI::fontHeight(int16_t font) return pgm_read_byte( &fontdata[font].height ) * textsize; } +int16_t TFT_eSPI::fontHeight() +{ + return fontHeight(textfont); +} /*************************************************************************************** ** Function name: drawChar diff --git a/TFT_eSPI.h b/TFT_eSPI.h index 75362a9..afd700b 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -631,7 +631,8 @@ class TFT_eSPI : public Print { textWidth(const char *string), textWidth(const String& string, int font), textWidth(const String& string), - fontHeight(int16_t font); + fontHeight(int16_t font), + fontHeight(); void setAddrWindow(int32_t xs, int32_t ys, int32_t xe, int32_t ye);