summaryrefslogtreecommitdiffstats
path: root/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-11-10 06:26:17 +0100
committerPetr Mrázek <peterix@gmail.com>2014-11-10 06:26:17 +0100
commitec4805cce8ee252989f62a70b5672f93f07af7ec (patch)
treee09f76d73c5d2f176d827887e1886a47aee6fab1 /MultiMC.cpp
parenta2ac9c5a3ace39975060a4f9d6660a467934c300 (diff)
downloadMultiMC-ec4805cce8ee252989f62a70b5672f93f07af7ec.tar
MultiMC-ec4805cce8ee252989f62a70b5672f93f07af7ec.tar.gz
MultiMC-ec4805cce8ee252989f62a70b5672f93f07af7ec.tar.lz
MultiMC-ec4805cce8ee252989f62a70b5672f93f07af7ec.tar.xz
MultiMC-ec4805cce8ee252989f62a70b5672f93f07af7ec.zip
Default console font tweaks
* Lucida Console on Windows * Menlo on OSX * Monospace (resolved to whatever Monospace means) on linux * Added ability to select proportional fonts in settings
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r--MultiMC.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index b7a68eea..c1af23e0 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -380,21 +380,32 @@ void MultiMC::initGlobalSettings(bool test_mode)
// Remembered state
m_settings->registerSetting("LastUsedGroupForNewInstance", QString());
- // in test mode, we don't have UI.
+ QString defaultMonospace;
+#ifdef Q_OS_WIN32
+ defaultMonospace = "Lucida Console";
+#elif Q_OS_MAC
+ defaultMonospace = "Menlo";
+#else
+ defaultMonospace = "Monospace";
+#endif
if(!test_mode)
{
- // Console settings
+ // resolve the font so the default actually matches
QFont consoleFont;
- consoleFont.setFamily("");
+ consoleFont.setFamily(defaultMonospace);
consoleFont.setStyleHint(QFont::Monospace);
consoleFont.setFixedPitch(true);
QFontInfo consoleFontInfo(consoleFont);
- QString consoleFontFamily = consoleFontInfo.family();
- m_settings->registerSetting("ConsoleFont", consoleFontFamily);
+ QString resolvedDefaultMonospace = consoleFontInfo.family();
+ QFont resolvedFont(resolvedDefaultMonospace);
+ QLOG_DEBUG() << "Detected default console font:" << resolvedDefaultMonospace
+ << ", substitutions:" << resolvedFont.substitutions().join(',');
+ m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace);
}
else
{
- m_settings->registerSetting("ConsoleFont", "Courier");
+ // in test mode, we don't have UI, so we don't do any font resolving
+ m_settings->registerSetting("ConsoleFont", defaultMonospace);
}
// FTB