From 3426c9cb2c598dc59edccb2201b6a6d8a82b8d8c Mon Sep 17 00:00:00 2001 From: The Dax Date: Fri, 30 Aug 2013 13:33:12 -0400 Subject: [PATCH 1/3] Allow user to specify what system font to use in their respective language's ini file. Fallback on Trebuchet MS if nothing is defined. --- Core/Config.h | 1 + UI/NativeApp.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Core/Config.h b/Core/Config.h index ae9ab8e794..f98545acc7 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -44,6 +44,7 @@ public: bool bEnableLogging; #ifdef _WIN32 bool bTopMost; + std::string sFont; #endif // Core bool bIgnoreBadMemAccess; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index d309637d42..74a9a21f6f 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -372,6 +372,11 @@ void NativeInit(int argc, const char *argv[], #endif i18nrepo.LoadIni(g_Config.languageIni); + I18NCategory *d = GetI18NCategory("DesktopUI"); + g_Config.sFont = d->T("Font"); + + if(g_Config.sFont == "Font") + g_Config.sFont = "Trebuchet MS"; if (!boot_filename.empty() && stateToLoad != NULL) SaveState::Load(stateToLoad); @@ -406,9 +411,9 @@ void NativeInitGraphics() { // memset(&ui_theme, 0, sizeof(ui_theme)); // New style theme - ui_theme.uiFont = UI::FontStyle(UBUNTU24, "Trebuchet MS", 20); - ui_theme.uiFontSmall = UI::FontStyle(UBUNTU24, "Trebuchet MS", 14); - ui_theme.uiFontSmaller = UI::FontStyle(UBUNTU24, "Trebuchet MS", 11); + ui_theme.uiFont = UI::FontStyle(UBUNTU24, g_Config.sFont.c_str(), 20); + ui_theme.uiFontSmall = UI::FontStyle(UBUNTU24, g_Config.sFont.c_str(), 14); + ui_theme.uiFontSmaller = UI::FontStyle(UBUNTU24, g_Config.sFont.c_str(), 11); ui_theme.checkOn = I_CHECKEDBOX; ui_theme.checkOff = I_SQUARE; From e859b799485686a592fea6c30748ab7c89ead84d Mon Sep 17 00:00:00 2001 From: The Dax Date: Fri, 30 Aug 2013 13:38:59 -0400 Subject: [PATCH 2/3] Remove useless if. --- UI/NativeApp.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 74a9a21f6f..0fa4633a0c 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -373,10 +373,7 @@ void NativeInit(int argc, const char *argv[], i18nrepo.LoadIni(g_Config.languageIni); I18NCategory *d = GetI18NCategory("DesktopUI"); - g_Config.sFont = d->T("Font"); - - if(g_Config.sFont == "Font") - g_Config.sFont = "Trebuchet MS"; + g_Config.sFont = d->T("Font", "Trebuchet MS"); if (!boot_filename.empty() && stateToLoad != NULL) SaveState::Load(stateToLoad); From 39db37cfd38f3796fb5d50d18dbb53bb44d74fb0 Mon Sep 17 00:00:00 2001 From: The Dax Date: Fri, 30 Aug 2013 13:52:15 -0400 Subject: [PATCH 3/3] Add a comment. --- UI/NativeApp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 0fa4633a0c..2b9c36ee46 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -373,6 +373,9 @@ void NativeInit(int argc, const char *argv[], i18nrepo.LoadIni(g_Config.languageIni); I18NCategory *d = GetI18NCategory("DesktopUI"); + // Note to translators: do not translate this/add this to PPSSPP-lang's files. + // It's intended to be custom for every user. + // Only add it to your own personal copies of PPSSPP. g_Config.sFont = d->T("Font", "Trebuchet MS"); if (!boot_filename.empty() && stateToLoad != NULL)