--- a/eric7/QScintilla/QsciScintillaCompat.py Tue May 18 19:25:53 2021 +0200 +++ b/eric7/QScintilla/QsciScintillaCompat.py Wed May 19 17:36:34 2021 +0200 @@ -50,6 +50,19 @@ IndicatorStyleMax = QsciScintilla.INDIC_GRADIENTCENTRE + # Maps PyQt6.QFont.Weight to the weights used by QScintilla + QFontWeightMapping = { + 100: 0, + 200: 12, + 300: 25, + 400: 50, + 500: 57, + 600: 63, + 700: 75, + 800: 81, + 900: 87, + } + def __init__(self, parent=None): """ Constructor @@ -145,7 +158,7 @@ f = font.family().encode("utf-8") ps = font.pointSize() - weight = -font.weight() + weight = -QsciScintillaCompat.QFontWeightMapping[font.weight()] italic = font.italic() underline = font.underline() bold = font.bold()