- change: Turn off font hinting.

This commit is contained in:
Roy Qu 2024-04-12 20:18:06 +08:00
parent a86e872281
commit 308cbb3ee8
6 changed files with 9 additions and 1 deletions

View File

@ -138,6 +138,7 @@ Red Panda C++ Version 2.27
- enhancement: Auto hide Project menu if no project openning. - enhancement: Auto hide Project menu if no project openning.
- fix: Toggle breakpoint by shortcut may use wrong line. - fix: Toggle breakpoint by shortcut may use wrong line.
- fix: Size of the icons in problem and problem set panel are not correct. - 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 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -5346,6 +5346,7 @@ void Editor::applySettings()
f.setFamilies(pSettings->editor().fontFamiliesWithControlFont()); f.setFamilies(pSettings->editor().fontFamiliesWithControlFont());
f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); f.setPixelSize(pointToPixel(pSettings->editor().fontSize()));
f.setStyleStrategy(QFont::PreferAntialias); f.setStyleStrategy(QFont::PreferAntialias);
f.setHintingPreference(QFont::PreferNoHinting);
setFont(f); setFont(f);
// QFont f=QFont(pSettings->editor().fontName()); // QFont f=QFont(pSettings->editor().fontName());
@ -5371,6 +5372,7 @@ void Editor::applySettings()
f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); f.setPixelSize(pointToPixel(pSettings->editor().fontSize()));
} }
f.setStyleStrategy(QFont::PreferAntialias); f.setStyleStrategy(QFont::PreferAntialias);
f.setHintingPreference(QFont::PreferNoHinting);
gutter().setFont(f); gutter().setFont(f);
gutter().setDigitCount(pSettings->editor().gutterDigitsCount()); gutter().setDigitCount(pSettings->editor().gutterDigitsCount());
gutter().setVisible(pSettings->editor().gutterVisible()); gutter().setVisible(pSettings->editor().gutterVisible());

View File

@ -1031,6 +1031,7 @@ void MainWindow::applySettings()
QFont font(pSettings->environment().interfaceFont()); QFont font(pSettings->environment().interfaceFont());
font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize())); font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize()));
font.setStyleStrategy(QFont::PreferAntialias); font.setStyleStrategy(QFont::PreferAntialias);
font.setHintingPreference(QFont::PreferNoHinting);
qApp->setFont(font); qApp->setFont(font);
this->setFont(font); this->setFont(font);
for (QWidget* p:findChildren<QWidget*>()) { for (QWidget* p:findChildren<QWidget*>()) {
@ -1052,6 +1053,7 @@ void MainWindow::applySettings()
QFont caseEditorFont(pSettings->executor().caseEditorFontName()); QFont caseEditorFont(pSettings->executor().caseEditorFontName());
caseEditorFont.setPixelSize(pointToPixel(pSettings->executor().caseEditorFontSize())); caseEditorFont.setPixelSize(pointToPixel(pSettings->executor().caseEditorFontSize()));
font.setStyleStrategy(QFont::PreferAntialias); font.setStyleStrategy(QFont::PreferAntialias);
font.setHintingPreference(QFont::PreferNoHinting);
ui->txtProblemCaseInput->setFont(caseEditorFont); ui->txtProblemCaseInput->setFont(caseEditorFont);
ui->lblProblemCaseInput->setFont(caseEditorFont); ui->lblProblemCaseInput->setFont(caseEditorFont);
ui->txtProblemCaseOutput->setFont(caseEditorFont); ui->txtProblemCaseOutput->setFont(caseEditorFont);

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>955</width> <width>936</width>
<height>619</height> <height>619</height>
</rect> </rect>
</property> </property>

View File

@ -104,6 +104,7 @@ void CPUDialog::updateDPI(float dpi)
QFont font(pSettings->environment().interfaceFont()); QFont font(pSettings->environment().interfaceFont());
font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize(),dpi)); font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize(),dpi));
font.setStyleStrategy(QFont::PreferAntialias); font.setStyleStrategy(QFont::PreferAntialias);
font.setHintingPreference(QFont::PreferNoHinting);
setFont(font); setFont(font);
for (QWidget* p:findChildren<QWidget*>()) { for (QWidget* p:findChildren<QWidget*>()) {
if (p!=ui->txtCode) if (p!=ui->txtCode)
@ -151,6 +152,7 @@ void CPUDialog::resetEditorFont(float dpi)
f.setFamilies(pSettings->editor().fontFamiliesWithControlFont()); f.setFamilies(pSettings->editor().fontFamiliesWithControlFont());
f.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi)); f.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi));
f.setStyleStrategy(QFont::PreferAntialias); f.setStyleStrategy(QFont::PreferAntialias);
f.setHintingPreference(QFont::PreferNoHinting);
ui->txtCode->setFont(f); ui->txtCode->setFont(f);
} }

View File

@ -61,6 +61,7 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
mPaintLock = 0; mPaintLock = 0;
mFontDummy = QFont("monospace",14); mFontDummy = QFont("monospace",14);
mFontDummy.setStyleStrategy(QFont::PreferAntialias); mFontDummy.setStyleStrategy(QFont::PreferAntialias);
mFontDummy.setHintingPreference(QFont::PreferNoHinting);
mDocument = std::make_shared<Document>(mFontDummy, this); mDocument = std::make_shared<Document>(mFontDummy, this);
mMouseMoved = false; mMouseMoved = false;