diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -624,6 +624,7 @@ // update preview to reflect text smoothing state fontSelected(profileFont); + preview(Profile::AntiAliasFonts, enable); updateTempProfileProperty(Profile::AntiAliasFonts, enable); } diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -240,10 +240,7 @@ void TerminalDisplay::setVTFont(const QFont& f) { QFont newFont(f); - - // In case the provided font doesn't have some specific characters it should - // fall back to a Monospace fonts. - newFont.setStyleHint(QFont::TypeWriter); + int strategy = 0; QFontMetrics fontMetrics(newFont); @@ -257,38 +254,38 @@ return; } - // hint that text should be drawn without anti-aliasing. + // hint that text should be drawn with- or without anti-aliasing. // depending on the user's font configuration, this may not be respected - if (!_antialiasText) { - newFont.setStyleStrategy(QFont::StyleStrategy(newFont.styleStrategy() | QFont::NoAntialias)); - } - - // experimental optimization. Konsole assumes that the terminal is using a - // mono-spaced font, in which case kerning information should have an effect. - // Disabling kerning saves some computation when rendering text. - newFont.setKerning(false); + strategy |= _antialiasText ? QFont::PreferAntialias : QFont::NoAntialias; // Konsole cannot handle non-integer font metrics - newFont.setStyleStrategy(QFont::StyleStrategy(newFont.styleStrategy() | QFont::ForceIntegerMetrics)); + strategy |= QFont::ForceIntegerMetrics; + + // In case the provided font doesn't have some specific characters it should + // fall back to a Monospace fonts. + newFont.setStyleHint(QFont::TypeWriter, QFont::StyleStrategy(strategy)); // Try to check that a good font has been loaded. // For some fonts, ForceIntegerMetrics causes height() == 0 which // will cause Konsole to crash later. QFontMetrics fontMetrics2(newFont); - if ((fontMetrics2.height() < 1)) { + if (fontMetrics2.height() < 1) { qCDebug(KonsoleDebug)<<"The font "<