Skip to content

Commit

Permalink
Load system monospace font from font db, instead of hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kaofelix committed Oct 4, 2024
1 parent 32ba5ef commit 194e683
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions qtcodeedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from qtpy.QtGui import (
QColor,
QFont,
QFontDatabase,
QKeyEvent,
QPainter,
QPalette,
Expand All @@ -34,10 +35,8 @@ def __init__(self):
super().__init__()
self._indentation_mode = self.Indent.WithSpaces

font = QFont()
font.setFamily("Menlo")
font = QFontDatabase.systemFont(QFontDatabase.SystemFont.FixedFont)
font.setPointSize(14)
font.setFixedPitch(True)
self.setFont(font)

self.highlighter = PygmentsSyntaxHighlighter(self.document())
Expand Down

0 comments on commit 194e683

Please sign in to comment.