src/gui/text/qfontengine_mac.mm
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/src/gui/text/qfontengine_mac.mm	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/text/qfontengine_mac.mm	Tue Feb 02 00:43:10 2010 +0200
@@ -404,7 +404,9 @@
 }
 QFixed QCoreTextFontEngine::descent() const
 {
-    return QFixed::fromReal(CTFontGetDescent(ctfont)).ceil();
+    // subtract a pixel to even out the historical +1 in QFontMetrics::height().
+    // Fix in Qt 5.
+    return QFixed::fromReal(CTFontGetDescent(ctfont)).ceil() - 1;
 }
 QFixed QCoreTextFontEngine::leading() const
 {
@@ -546,7 +548,7 @@
     cgMatrix = CGAffineTransformScale(cgMatrix, 1, -1);
 
     if (synthesisFlags & QFontEngine::SynthesizedItalic)
-        cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, tanf(14 * acosf(0) / 90), 1, 0, 0));
+        cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0));
 
 
     for (int i = 0; i < nGlyphs; ++i) {
@@ -1406,7 +1408,9 @@
 
 QFixed QFontEngineMac::descent() const
 {
-    return m_descent;
+    // subtract a pixel to even out the historical +1 in QFontMetrics::height().
+    // Fix in Qt 5.
+    return m_descent - 1;
 }
 
 QFixed QFontEngineMac::leading() const