OSDN Git Service

hint monospaced fonts horizontally and vertically
authorIvailo Monev <xakepa10@gmail.com>
Mon, 18 Apr 2022 08:23:13 +0000 (11:23 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 18 Apr 2022 08:23:13 +0000 (11:23 +0300)
this is more of a workaround, there is a bug lurking somewhere in Konsole
probably since there are plenty of hacks related to fonts there

for reference:
https://github.com/fluxer/katana/issues/29

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/text/qfontdatabase.cpp

index c1ea443..45f83f5 100644 (file)
@@ -252,6 +252,11 @@ QFontDef qt_FcPatternToQFontDef(FcPattern *pattern, const QFontDef &request)
         fontDef.ignorePitch = true;
     }
 
+    // hint monospaced fonts horizontally and vertically
+    if (fontDef.fixedPitch && fontDef.hintingPreference == QFont::PreferVerticalHinting) {
+        fontDef.hintingPreference = QFont::PreferFullHinting;
+    }
+
     return fontDef;
 }