From f71a7edf2700d46475cd74f19f809fb7cf986375 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Fri, 22 Apr 2022 23:36:42 +0200 Subject: [PATCH] Restore comments lost in a previous refactor --- src/terminalDisplay/TerminalPainter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/terminalDisplay/TerminalPainter.cpp b/src/terminalDisplay/TerminalPainter.cpp index 8741d7f7..37fb7f04 100644 --- a/src/terminalDisplay/TerminalPainter.cpp +++ b/src/terminalDisplay/TerminalPainter.cpp @@ -580,10 +580,11 @@ void TerminalPainter::drawCharacters(QPainter &painter, return; } - static constexpr int MaxFontWeight = 99; + static constexpr int MaxFontWeight = 99; // https://doc.qt.io/qt-5/qfont.html#Weight-enum const int normalWeight = display->font().weight(); - + // +26 makes "bold" from "normal", "normal" from "light", etc. It is 26 instead of not 25 to prefer + // bolder weight when 25 falls in the middle between two weights. See QFont::Weight const int boldWeight = qMin(normalWeight + 26, MaxFontWeight); const auto isBold = [boldWeight](const QFont &font) {