Commit e8804d60 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/main): fix font size on mac os

parent 2a77b298
...@@ -206,9 +206,9 @@ void App::parseArgs () { ...@@ -206,9 +206,9 @@ void App::parseArgs () {
mParser.addVersionOption(); mParser.addVersionOption();
mParser.addOptions({ mParser.addOptions({
{ "config", tr("commandLineOptionConfig"), tr("commandLineOptionConfigArg") }, { "config", tr("commandLineOptionConfig"), tr("commandLineOptionConfigArg") },
#ifndef __APPLE__ #ifndef Q_OS_MACOS
{ "iconified", tr("commandLineOptionIconified") }, { "iconified", tr("commandLineOptionIconified") },
#endif // ifndef __APPLE__ #endif // ifndef Q_OS_MACOS
{ "self-test", tr("commandLineOptionSelfTest") }, { "self-test", tr("commandLineOptionSelfTest") },
{ { "V", "verbose" }, tr("commandLineOptionVerbose") }, { { "V", "verbose" }, tr("commandLineOptionVerbose") },
{ { "c", "cmd" }, tr("commandLineOptionCmd"), tr("commandLineOptionCmdArg") } { { "c", "cmd" }, tr("commandLineOptionCmd"), tr("commandLineOptionCmdArg") }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <QDirIterator> #include <QDirIterator>
#include <QFontDatabase> #include <QFontDatabase>
#include <QScreen>
#include "app/App.hpp" #include "app/App.hpp"
...@@ -40,11 +41,11 @@ int main (int argc, char *argv[]) { ...@@ -40,11 +41,11 @@ int main (int argc, char *argv[]) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Options to get a nice video render. // Options to get a nice video render.
#ifdef _WIN32 #ifdef Q_OS_WIN
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES, true); QCoreApplication::setAttribute(Qt::AA_UseOpenGLES, true);
#else #else
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL, true); QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL, true);
#endif // ifdef _WIN32 #endif // ifdef Q_OS_WIN
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
{ {
...@@ -92,8 +93,16 @@ int main (int argc, char *argv[]) { ...@@ -92,8 +93,16 @@ int main (int argc, char *argv[]) {
} }
} }
{
QFont font(DEFAULT_FONT);
#ifdef Q_OS_MACOS
// 72 dpi on MacOs...
font.setPointSizeF(font.pointSize() * 96.0 / 72.0);
#endif // ifdef Q_OS_MACOS
app.setFont(QFont(DEFAULT_FONT)); app.setFont(QFont(DEFAULT_FONT));
qInfo() << QStringLiteral("Main font:") << app.font(); }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Init and run! // Init and run!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment