From 32638aa9ce6d6049fdec2c09f768a2c3aaf646d4 Mon Sep 17 00:00:00 2001 From: Miroslav Talasek Date: Mon, 8 Mar 2021 17:32:47 +0100 Subject: [PATCH 1/4] add getters for text size , color and font --- Adafruit_GFX.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index a75e5fb..36e3cf1 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -135,6 +135,30 @@ public: void setTextSize(uint8_t sx, uint8_t sy); void setFont(const GFXfont *f = NULL); + /**********************************************************************/ + /*! + @brief Get GFX font + @returns GFX font + */ + /**********************************************************************/ + GFXfont* getFont() { return gfxFont; } + + /**********************************************************************/ + /*! + @brief Get text size multiplier x + @returns text size multiplier x + */ + /**********************************************************************/ + uint8_t getTextSizeX() { return textsize_x; } + + /**********************************************************************/ + /*! + @brief Get text size multiplier y + @returns text size multiplier y + */ + /**********************************************************************/ + uint8_t getTextSizeY() { return textsize_y; } + /**********************************************************************/ /*! @brief Set text cursor location @@ -169,6 +193,23 @@ public: textbgcolor = bg; } + /**********************************************************************/ + /*! + @brief Get text color + @returns text color + */ + /**********************************************************************/ + uint16_t getTextColor() { return textcolor; } + + /**********************************************************************/ + /*! + @brief Get text background color + @returns text background color + */ + /**********************************************************************/ + uint16_t getTextBgColor() { return textbgcolor; } + + /**********************************************************************/ /*! @brief Set whether text that is too long for the screen width should From 5f1a82dd8f274e2e77f99de6bcd481b9eebba504 Mon Sep 17 00:00:00 2001 From: Miroslav Talasek Date: Mon, 8 Mar 2021 17:52:54 +0100 Subject: [PATCH 2/4] fix whitespace --- Adafruit_GFX.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index 36e3cf1..28bc11e 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -209,7 +209,6 @@ public: /**********************************************************************/ uint16_t getTextBgColor() { return textbgcolor; } - /**********************************************************************/ /*! @brief Set whether text that is too long for the screen width should From 98a19a453116c65bb77089921a1f57c2776fd69e Mon Sep 17 00:00:00 2001 From: Miroslav Talasek Date: Mon, 8 Mar 2021 18:03:03 +0100 Subject: [PATCH 3/4] fix const --- Adafruit_GFX.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index 28bc11e..56a12a6 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -141,7 +141,7 @@ public: @returns GFX font */ /**********************************************************************/ - GFXfont* getFont() { return gfxFont; } + GFXfont *getFont() const { return gfxFont; } /**********************************************************************/ /*! @@ -149,7 +149,7 @@ public: @returns text size multiplier x */ /**********************************************************************/ - uint8_t getTextSizeX() { return textsize_x; } + uint8_t getTextSizeX() const { return textsize_x; } /**********************************************************************/ /*! @@ -157,7 +157,7 @@ public: @returns text size multiplier y */ /**********************************************************************/ - uint8_t getTextSizeY() { return textsize_y; } + uint8_t getTextSizeY() const { return textsize_y; } /**********************************************************************/ /*! @@ -199,7 +199,7 @@ public: @returns text color */ /**********************************************************************/ - uint16_t getTextColor() { return textcolor; } + uint16_t getTextColor() const { return textcolor; } /**********************************************************************/ /*! @@ -207,7 +207,7 @@ public: @returns text background color */ /**********************************************************************/ - uint16_t getTextBgColor() { return textbgcolor; } + uint16_t getTextBgColor() const { return textbgcolor; } /**********************************************************************/ /*! From 1d7a85355f072cd51a24df681cc00be46e538927 Mon Sep 17 00:00:00 2001 From: Miroslav Talasek Date: Mon, 8 Mar 2021 18:36:11 +0100 Subject: [PATCH 4/4] fix format --- Adafruit_GFX.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index 56a12a6..4047171 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -198,7 +198,7 @@ public: @brief Get text color @returns text color */ - /**********************************************************************/ + /**********************************************************************/ uint16_t getTextColor() const { return textcolor; } /**********************************************************************/ @@ -206,7 +206,7 @@ public: @brief Get text background color @returns text background color */ - /**********************************************************************/ + /**********************************************************************/ uint16_t getTextBgColor() const { return textbgcolor; } /**********************************************************************/