diff src/changesetitem.cpp @ 682:751b21af6b6f

Work around font mis-hinting when scaled on Windows
author Chris Cannam
date Fri, 07 Dec 2018 14:29:23 +0000
parents ce29dc775650
children 759b81c38bb1
line wrap: on
line diff
--- a/src/changesetitem.cpp	Fri Dec 07 13:43:08 2018 +0000
+++ b/src/changesetitem.cpp	Fri Dec 07 14:29:23 2018 +0000
@@ -309,6 +309,12 @@
     QTransform t = paint->worldTransform();
     float scale = std::min(t.m11(), t.m22());
 
+    if (scale > 1.0) {
+#ifdef Q_OS_WIN32
+        f.setHintingPreference(QFont::PreferNoHinting);
+#endif
+    }
+
     bool showText = (scale >= 0.2);
     bool showProperLines = (scale >= 0.1);
 
@@ -504,13 +510,15 @@
     userColour.setAlpha(alpha);
 
     QFont f(m_font);
-
     QTransform t = paint->worldTransform();
     float scale = std::min(t.m11(), t.m22());
     if (scale > 1.0) {
 	int ps = int((f.pixelSize() / scale) + 0.5);
 	if (ps < 8) ps = 8;
 	f.setPixelSize(ps);
+#ifdef Q_OS_WIN32
+        f.setHintingPreference(QFont::PreferNoHinting);
+#endif
     }
 
     bool showProperLines = (scale >= 0.1);