From f636596ee29cef621c9f5ef59fde4be5338b92a6 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sat, 25 Feb 2023 10:52:45 +1100 Subject: [PATCH] daybreak: scale title font size (cherry picked from commit 035b37c615183bd387210a54d269346e3a9b379a) --- troposphere/daybreak/source/ui_util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/troposphere/daybreak/source/ui_util.cpp b/troposphere/daybreak/source/ui_util.cpp index d58e881b8..224ab5c52 100644 --- a/troposphere/daybreak/source/ui_util.cpp +++ b/troposphere/daybreak/source/ui_util.cpp @@ -16,6 +16,7 @@ #include "ui_util.hpp" #include #include +#include namespace dbk { @@ -73,7 +74,7 @@ namespace dbk { nvgFill(vg); /* Setup the font. */ - nvgFontSize(vg, 32.0f); + nvgFontSize(vg, std::min(32.0f, -(strlen(title)*0.5f) + 47.0f)); nvgFontFace(vg, SwitchStandardFont); nvgTextAlign(vg, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE); nvgFillColor(vg, nvgRGB(0, 0, 0));