Fix default font on macOS

Qt does not support fontconfig on macOS, so we need to work around it and
provide a "real" font family name for the default font. Otherwise, "Monospace"
will be unrecognized and it will fall back to a variable-width font.
This commit is contained in:
Andrew Janke
2019-03-09 19:04:32 -05:00
committed by Chih-Hsuan Yen
parent e292763e6d
commit fa4a1bad42
+7 -1
View File
@@ -33,6 +33,12 @@
#include "SearchBar.h"
#include "qtermwidget.h"
#ifdef Q_OS_MACOS
// Qt does not support fontconfig on macOS, so we need to use a "real" font name.
#define DEFAULT_FONT_FAMILY "Menlo"
#else
#define DEFAULT_FONT_FAMILY "Monospace"
#endif
#define STEP_ZOOM 1
@@ -321,7 +327,7 @@ void QTermWidget::init(int startnow)
// m_impl->m_terminalDisplay->setSize(80, 40);
QFont font = QApplication::font();
font.setFamily(QLatin1String("Monospace"));
font.setFamily(QLatin1String(DEFAULT_FONT_FAMILY));
font.setPointSize(10);
font.setStyleHint(QFont::TypeWriter);
setTerminalFont(font);