From 3711df02063dd943730dcf0efc895fbe31c79980 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 22 Nov 2025 09:20:11 +1100 Subject: [PATCH] Try to force Noto Sans Regular font if present. Stop increasing the checkbox/bullet sizes separately --- CHANGELOG.md | 4 ++++ README.md | 2 ++ bouquin/markdown_editor.py | 4 +++- bouquin/markdown_highlighter.py | 6 ++++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee5b362..298a451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.3 + + * Favour Noto Sans font which seems to work better for unicode symbols on Fedora + # 0.4.2 * Improve Statistics widget height diff --git a/README.md b/README.md index 9e3e466..103a944 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ report from within the app. Make sure you have `libxcb-cursor0` installed (it may be called something else on non-Debian distributions). +It's also recommended that you have Noto Sans fonts installed, but it's up to you. It just can impact the display of unicode symbols such as checkboxes. + If downloading from my Forgejo's Releases page, you may wish to verify the GPG signatures with my [GPG key](https://mig5.net/static/mig5.asc). ### From PyPi/pip diff --git a/bouquin/markdown_editor.py b/bouquin/markdown_editor.py index 95b099d..31dfc82 100644 --- a/bouquin/markdown_editor.py +++ b/bouquin/markdown_editor.py @@ -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 diff --git a/bouquin/markdown_highlighter.py b/bouquin/markdown_highlighter.py index 9fcbcc3..35b8991 100644 --- a/bouquin/markdown_highlighter.py +++ b/bouquin/markdown_highlighter.py @@ -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()