From 0c2f7388a89a9d8ae24379cdbee11a9f85304d19 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Date: Tue, 11 Nov 2014 10:25:14 +0100
Subject: [PATCH] Windows: Remove font size hack

This hack was reintroduced in a4478b28966c5f630ba3d93b97bc91a3cec2fdbe,
and hides scaling artifacts in fonts where there is heavy hinting,
such as Arial, but introduces new bugs in other fonts, such as
Vijaya. The bottom line is that we shouldn't arbitrarily override
the pixel size of the font with the character height that we get
from GDI. Due to hinting, there will be some artifacts when printing
with screen resolution on Windows. The only way to make this look
correct is to use high resolution printing, like the documentation
says, or perhaps to force design metrics on the text layout.

Task-number: QTBUG-40770
Change-Id: Id151eb0ede5f73efb2a401924ce379d4414ca2b1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
---
 src/gui/painting/qpdf.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 1da0c6b65fe..9082f98205f 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2524,10 +2524,6 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti)
 
     qreal size = ti.fontEngine->fontDef.pixelSize;
 
-#if defined(Q_OS_WIN)
-    size = (ti.fontEngine->ascent() + ti.fontEngine->descent()).toReal();
-#endif
-
     QVarLengthArray<glyph_t> glyphs;
     QVarLengthArray<QFixedPoint> positions;
     QTransform m = QTransform::fromTranslate(p.x(), p.y());
-- 
GitLab