diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 6f48c9c6..61cddac3 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3869,6 +3869,7 @@ bool FurnaceGUI::loop() { mainFont=ImGui::GetIO().Fonts->AddFontDefault(); patFont=mainFont; bigFont=mainFont; + headFont=mainFont; if (rend) rend->destroyFontsTexture(); if (!ImGui::GetIO().Fonts->Build()) { logE("error again while building font atlas!"); @@ -6025,6 +6026,7 @@ bool FurnaceGUI::loop() { mainFont=ImGui::GetIO().Fonts->AddFontDefault(); patFont=mainFont; bigFont=mainFont; + headFont=mainFont; if (rend) rend->destroyFontsTexture(); if (!ImGui::GetIO().Fonts->Build()) { logE("error again while building font atlas!"); @@ -6480,6 +6482,7 @@ bool FurnaceGUI::init() { mainFont=ImGui::GetIO().Fonts->AddFontDefault(); patFont=mainFont; bigFont=mainFont; + headFont=headFont; if (rend) rend->destroyFontsTexture(); if (!ImGui::GetIO().Fonts->Build()) { logE("error again while building font atlas!"); @@ -6826,6 +6829,7 @@ FurnaceGUI::FurnaceGUI(): iconFont(NULL), patFont(NULL), bigFont(NULL), + headFont(NULL), fontRange(NULL), prevInsData(NULL), curIns(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index 8fa81c1b..b4deadf2 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1389,7 +1389,7 @@ class FurnaceGUI { char emptyLabel2[32]; struct Settings { - int mainFontSize, headFontSize, patFontSize, iconSize; + int mainFontSize, patFontSize, headFontSize, iconSize; int audioEngine; int audioQuality; int audioChans; @@ -1548,6 +1548,7 @@ class FurnaceGUI { Settings(): mainFontSize(18), patFontSize(18), + headFontSize(27), iconSize(16), audioEngine(DIV_AUDIO_SDL), audioQuality(0), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 4980d7e5..b1fc3e2b 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -2736,7 +2736,7 @@ void FurnaceGUI::drawSettings() { void FurnaceGUI::syncSettings() { settings.mainFontSize=e->getConfInt("mainFontSize",18); - settings.headFontSize=e->getConfInt("headFontSize",36); + settings.headFontSize=e->getConfInt("headFontSize",27); settings.patFontSize=e->getConfInt("patFontSize",18); settings.iconSize=e->getConfInt("iconSize",16); settings.audioEngine=(e->getConfString("audioEngine","SDL")=="SDL")?1:0; @@ -4064,21 +4064,21 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { headFont=mainFont; } else { if (settings.headFont==6) { // custom font - if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.headFontPath.c_str(),MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.headFontPath.c_str(),MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { logW("could not load header font! reverting to default font"); settings.headFont=0; - if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { logE("could not load header font! falling back to IBM Plex Sans."); headFont=ImGui::GetIO().Fonts->AddFontDefault(); } } } else if (settings.headFont==5) { // system font - if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_1,MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { - if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_2,MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { - if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_3,MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_1,MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_2,MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_3,MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { logW("could not load header font! reverting to default font"); settings.headFont=0; - if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { logE("could not load header font! falling back to IBM Plex Sans."); headFont=ImGui::GetIO().Fonts->AddFontDefault(); } @@ -4086,7 +4086,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { } } } else { - if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) { + if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),NULL,upTo800))==NULL) { logE("could not load header font!"); headFont=ImGui::GetIO().Fonts->AddFontDefault(); }