diff --git a/source/Core/Inc/FontUtils.h b/source/Core/Inc/FontUtils.h index 68c376be..bb08db51 100644 --- a/source/Core/Inc/FontUtils.h +++ b/source/Core/Inc/FontUtils.h @@ -8,5 +8,6 @@ enum class FontStyle { FROM_HEIGHT, // Pick font to best fill the height }; -constexpr uint8_t get_fontstyle_height(const FontStyle font); -constexpr uint8_t get_fontstyle_width(const FontStyle font); +constexpr uint8_t get_fontstyle_height(const FontStyle font); +constexpr uint8_t get_fontstyle_width(const FontStyle font); +constexpr FontStyle get_fontstyle_fromHeight(const uint8_t height); \ No newline at end of file diff --git a/source/Core/Src/FontUtils.cpp b/source/Core/Src/FontUtils.cpp index 58ec3b80..27354eb2 100644 --- a/source/Core/Src/FontUtils.cpp +++ b/source/Core/Src/FontUtils.cpp @@ -9,4 +9,6 @@ constexpr uint8_t get_fontstyle_width(const FontStyle font) { if (font == FontStyle::SMALL) return 6; return 12; -} \ No newline at end of file +} + +constexpr FontStyle get_fontstyle_fromHeight(const uint8_t height) { return (height <= 8) ? FontStyle::SMALL : FontStyle::LARGE; } \ No newline at end of file