summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-11-25 13:47:27 +0100
committerKonstantin Ritt <ritt.ks@gmail.com>2015-11-25 19:53:46 +0000
commit50cd0daf29d434b78cc70bbf732ee33b2bc18600 (patch)
treee2683bddf4ed9edb0846a9967c6b6de5f0b6a223 /src/plugins/platforms
parent0325842b9926f87f22beb3b8dda32c20b2f994ec (diff)
Fix kerned advances in QRawFont on OS X and Windows
On Windows, the wrong value was used to calculate the design-to-device scale. The assumption has been that tmHeight in the TEXTMETRIC is the pixel size of the em square, but it is not, it's the height of the font (ascent + descent). The pixel size of the font is defined to be the em square size in pixels. On OS X, the kerning data was never actually read from the font. I've added a lazy initialization for this similar to the one in the FT engine. This was discovered when investigating QTBUG-48546, as it turned out that the kerning information extracted by Qt in this case was different from the one used by Harfbuzz. I've changed testfont.ttf to kern "_2" so that the digit is positioned directly on top of the underscore and constructed a test. [ChangeLog][QRawFont] Fixed kerning on advances in QRawFont for OS X and Windows. Change-Id: Ic9a321ad119ea880cef89b861c75a820ab8d3182 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index ca3e2527e9..b6bc65055f 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -197,7 +197,7 @@ void QWindowsFontEngine::getCMap()
designToDevice = QFixed((int)otm->otmEMSquare)/QFixed::fromReal(fontDef.pixelSize);
unitsPerEm = otm->otmEMSquare;
x_height = (int)otm->otmsXHeight;
- loadKerningPairs(QFixed((int)otm->otmEMSquare)/int(otm->otmTextMetrics.tmHeight));
+ loadKerningPairs(designToDevice);
_faceId.filename = QFile::encodeName(QString::fromWCharArray((wchar_t *)((char *)otm + (quintptr)otm->otmpFullName)));
lineWidth = otm->otmsUnderscoreSize;
fsType = otm->otmfsType;