From c9a84af3d76ad821fe0583af2510a301c6c8496f Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 29 Nov 2023 11:32:35 +0100 Subject: [PATCH] Attempt at fixinf font width size by enable full font hinting, aka forcing glyphs to be aligned to pixels in order to disable subpixel positioning (source: https://www.mail-archive.com/development@qt-project.org/msg43330.html) --- src/kvirc/ui/KviInputEditor.cpp | 1 + src/kvirc/ui/KviIrcView.cpp | 1 + src/kvirc/ui/KviTopicWidget.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/kvirc/ui/KviInputEditor.cpp b/src/kvirc/ui/KviInputEditor.cpp index 18d764576..f3cab5fe7 100644 --- a/src/kvirc/ui/KviInputEditor.cpp +++ b/src/kvirc/ui/KviInputEditor.cpp @@ -226,6 +226,7 @@ void KviInputEditor::applyOptions(bool bRefreshCachedMetrics) //set the font QFont newFont(KVI_OPTION_FONT(KviOption_fontInput)); newFont.setKerning(false); + newFont.setHintingPreference(QFont::PreferFullHinting); setFont(newFont); //set cursor custom width diff --git a/src/kvirc/ui/KviIrcView.cpp b/src/kvirc/ui/KviIrcView.cpp index 25abfb2fc..571596555 100644 --- a/src/kvirc/ui/KviIrcView.cpp +++ b/src/kvirc/ui/KviIrcView.cpp @@ -409,6 +409,7 @@ void KviIrcView::setFont(const QFont & f) QFont newFont(f); newFont.setKerning(false); + newFont.setHintingPreference(QFont::PreferFullHinting); QWidget::setFont(newFont); update(); } diff --git a/src/kvirc/ui/KviTopicWidget.cpp b/src/kvirc/ui/KviTopicWidget.cpp index 26991cb73..839831da9 100644 --- a/src/kvirc/ui/KviTopicWidget.cpp +++ b/src/kvirc/ui/KviTopicWidget.cpp @@ -218,6 +218,7 @@ void KviTopicWidget::applyOptions() m_pLabel->applyOptions(); QFont newFont(KVI_OPTION_FONT(KviOption_fontLabel)); newFont.setKerning(false); + newFont.setHintingPreference(QFont::PreferFullHinting); setFont(newFont); if(m_pCompletionBox) m_pCompletionBox->setFont(newFont);