Set a default editor font for Windows and macOS (#990)

* Set a specific default editor font for Windows and macOS as GUI font isn't suitable
* Fix wrong reference
This commit is contained in:
Veronica Berglyd Olsen
2022-02-12 17:36:58 +01:00
committed by GitHub
parent 67c94314ed
commit 45def4b3b7
+13 -2
View File
@@ -235,8 +235,19 @@ class GuiDocEditor(QTextEdit):
theFont = QFont()
qDoc = self.document()
if self.mainConf.textFont is None:
# If none is defined, set the default back to config
self.mainConf.textFont = qDoc.defaultFont().family()
# If none is defined, set a default font
theFont = QFont()
if self.mainConf.osWindows and "Arial" in self.theTheme.guiFontDB.families():
theFont.setFamily("Arial")
theFont.setPointSize(12)
elif self.mainConf.osDarwin and "Courier" in self.theTheme.guiFontDB.families():
theFont.setFamily("Courier")
theFont.setPointSize(12)
else:
theFont = qDoc.defaultFont()
self.mainConf.textFont = theFont.family()
self.mainConf.textSize = theFont.pointSize()
theFont.setFamily(self.mainConf.textFont)
theFont.setPointSize(self.mainConf.textSize)