Add a font matcher for text fonts (#2118)

This commit is contained in:
Veronica Berglyd Olsen
2024-11-26 02:03:09 +01:00
parent 8463188336
commit ff470028be
3 changed files with 28 additions and 6 deletions
+4 -3
View File
@@ -53,7 +53,7 @@ from PyQt5.QtWidgets import (
)
from novelwriter import CONFIG, SHARED
from novelwriter.common import decodeMimeHandles, minmax, qtLambda, transferCase
from novelwriter.common import decodeMimeHandles, fontMatcher, minmax, qtLambda, transferCase
from novelwriter.constants import nwConst, nwKeyWords, nwShortcode, nwUnicode
from novelwriter.core.document import NWDocument
from novelwriter.enum import (
@@ -348,8 +348,9 @@ class GuiDocEditor(QPlainTextEdit):
SHARED.updateSpellCheckLanguage()
# Set the font. See issues #1862 and #1875.
self.setFont(CONFIG.textFont)
self._qDocument.setDefaultFont(CONFIG.textFont)
font = fontMatcher(CONFIG.textFont)
self.setFont(font)
self._qDocument.setDefaultFont(font)
self.docHeader.updateFont()
self.docFooter.updateFont()
self.docSearch.updateFont()