From 039ec299a6c3e73ca6bbb40bb2223fcac7508f89 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 12 Apr 2024 20:43:47 +0800 Subject: [PATCH] revert: turn off font hinting --- NEWS.md | 1 - RedPandaIDE/editor.cpp | 2 -- RedPandaIDE/mainwindow.cpp | 2 -- RedPandaIDE/widgets/cpudialog.cpp | 2 -- libs/qsynedit/qsynedit/qsynedit.cpp | 1 - 5 files changed, 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index 24e452e1..5ed6addd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -138,7 +138,6 @@ Red Panda C++ Version 2.27 - enhancement: Auto hide Project menu if no project openning. - fix: Toggle breakpoint by shortcut may use wrong line. - fix: Size of the icons in problem and problem set panel are not correct. - - change: Turn off font hinting. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index fe77d53c..ab73f887 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -5346,7 +5346,6 @@ void Editor::applySettings() f.setFamilies(pSettings->editor().fontFamiliesWithControlFont()); f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); f.setStyleStrategy(QFont::PreferAntialias); - f.setHintingPreference(QFont::PreferNoHinting); setFont(f); // QFont f=QFont(pSettings->editor().fontName()); @@ -5372,7 +5371,6 @@ void Editor::applySettings() f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); } f.setStyleStrategy(QFont::PreferAntialias); - f.setHintingPreference(QFont::PreferNoHinting); gutter().setFont(f); gutter().setDigitCount(pSettings->editor().gutterDigitsCount()); gutter().setVisible(pSettings->editor().gutterVisible()); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 98435af9..ea15177f 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1031,7 +1031,6 @@ void MainWindow::applySettings() QFont font(pSettings->environment().interfaceFont()); font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize())); font.setStyleStrategy(QFont::PreferAntialias); - font.setHintingPreference(QFont::PreferNoHinting); qApp->setFont(font); this->setFont(font); for (QWidget* p:findChildren()) { @@ -1053,7 +1052,6 @@ void MainWindow::applySettings() QFont caseEditorFont(pSettings->executor().caseEditorFontName()); caseEditorFont.setPixelSize(pointToPixel(pSettings->executor().caseEditorFontSize())); font.setStyleStrategy(QFont::PreferAntialias); - font.setHintingPreference(QFont::PreferNoHinting); ui->txtProblemCaseInput->setFont(caseEditorFont); ui->lblProblemCaseInput->setFont(caseEditorFont); ui->txtProblemCaseOutput->setFont(caseEditorFont); diff --git a/RedPandaIDE/widgets/cpudialog.cpp b/RedPandaIDE/widgets/cpudialog.cpp index c583560b..42ada22c 100644 --- a/RedPandaIDE/widgets/cpudialog.cpp +++ b/RedPandaIDE/widgets/cpudialog.cpp @@ -104,7 +104,6 @@ void CPUDialog::updateDPI(float dpi) QFont font(pSettings->environment().interfaceFont()); font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize(),dpi)); font.setStyleStrategy(QFont::PreferAntialias); - font.setHintingPreference(QFont::PreferNoHinting); setFont(font); for (QWidget* p:findChildren()) { if (p!=ui->txtCode) @@ -152,7 +151,6 @@ void CPUDialog::resetEditorFont(float dpi) f.setFamilies(pSettings->editor().fontFamiliesWithControlFont()); f.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi)); f.setStyleStrategy(QFont::PreferAntialias); - f.setHintingPreference(QFont::PreferNoHinting); ui->txtCode->setFont(f); } diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index d3363133..b1cda448 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -61,7 +61,6 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent), mPaintLock = 0; mFontDummy = QFont("monospace",14); mFontDummy.setStyleStrategy(QFont::PreferAntialias); - mFontDummy.setHintingPreference(QFont::PreferNoHinting); mDocument = std::make_shared(mFontDummy, this); mMouseMoved = false;