Skip to content

Commit b98a132

Browse files
committed
Use generic sans serif font as preview font
During the settings initialization, a QApplication is not yet constructed, and QFont() just returns the first font in list instead of the right one. (cherry picked from commit 3e43d45)
1 parent 7ca76da commit b98a132

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ReText/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ def __setattr__(self, option, value):
162162
def __getattribute__(self, option):
163163
value = object.__getattribute__(self, option)
164164
# Choose a font just-in-time, because when the settings are
165-
# loaded it is too early to work on Windows
165+
# loaded it is too early to work.
166+
if option == 'font' and not value.family():
167+
value = QFont()
166168
if option == 'editorFont' and not value.family():
167169
value = chooseMonospaceFont()
168170
return value

0 commit comments

Comments
 (0)