Try to force Noto Sans Regular font if present. Stop increasing the checkbox/bullet sizes separately
Some checks are pending
CI / test (push) Waiting to run
Lint / test (push) Waiting to run
Trivy / test (push) Waiting to run

This commit is contained in:
Miguel Jacq 2025-11-22 09:20:11 +11:00
parent ca3c839c7d
commit 3711df0206
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
4 changed files with 13 additions and 3 deletions

View file

@ -41,9 +41,11 @@ class MarkdownEditor(QTextEdit):
self.setAcceptRichText(False)
# Normal text
self.qfont = QFont()
self.qfont = QFont("Noto Sans")
self.qfont.setStyleName("Regular")
self.qfont.setPointSize(11)
self.setFont(self.qfont)
self.document().setDefaultFont(self.qfont)
self._apply_line_spacing() # 1.25× initial spacing

View file

@ -105,13 +105,15 @@ class MarkdownHighlighter(QSyntaxHighlighter):
if base_size <= 0:
base_size = 10.0 # fallback
# Checkboxes: make them a bit bigger so they stand out
fixed = QFont("Noto Sans", 11)
fixed.setStyleName("Regular")
self.checkbox_format = QTextCharFormat()
self.checkbox_format.setFontPointSize(base_size * 1.3)
self.checkbox_format.setFontFamily(fixed.family())
self.checkbox_format.setVerticalAlignment(QTextCharFormat.AlignMiddle)
# Bullets
self.bullet_format = QTextCharFormat()
self.bullet_format.setFontPointSize(base_size * 1.2)
self.checkbox_format.setFontFamily(fixed.family())
# Markdown syntax (the markers themselves) - make invisible
self.syntax_format = QTextCharFormat()