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:
committed by
GitHub
parent
67c94314ed
commit
45def4b3b7
@@ -235,8 +235,19 @@ class GuiDocEditor(QTextEdit):
|
|||||||
theFont = QFont()
|
theFont = QFont()
|
||||||
qDoc = self.document()
|
qDoc = self.document()
|
||||||
if self.mainConf.textFont is None:
|
if self.mainConf.textFont is None:
|
||||||
# If none is defined, set the default back to config
|
# If none is defined, set a default font
|
||||||
self.mainConf.textFont = qDoc.defaultFont().family()
|
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.setFamily(self.mainConf.textFont)
|
||||||
theFont.setPointSize(self.mainConf.textSize)
|
theFont.setPointSize(self.mainConf.textSize)
|
||||||
|
|||||||
Reference in New Issue
Block a user