summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-11-07 09:54:46 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-11-13 20:43:13 +0000
commitc1da13f6db756a9b23c46193304156c5e10f3bc1 (patch)
treeffc12b46f652d4cd2b957ac1efdb52b78bead001 /src/gui
parent50af66293de8bd5dd9fd9141a45d9415b5c688aa (diff)
QTextEngine: Apply CoreText specific post-processing for QFE::Mac only
These tricks has no meaning to other font engines (i.e. to FreeType). Change-Id: I0410693d4d159367d760433062506691dc7c4610 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextengine.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 530871f65b..50a242d81e 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1267,19 +1267,20 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
g.glyphs[i] |= (engineIdx << 24);
}
-#ifdef Q_OS_MAC
- // CTRunGetPosition has a bug which applies matrix on 10.6, so we disable
- // scaling the advances for this particular version
- if (actualFontEngine->fontDef.stretch != 100
- && QSysInfo::MacintoshVersion != QSysInfo::MV_10_6) {
- QFixed stretch = QFixed(int(actualFontEngine->fontDef.stretch)) / QFixed(100);
- for (uint i = 0; i < num_glyphs; ++i)
- g.advances[i] *= stretch;
- }
-
- if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
- for (uint i = 0; i < num_glyphs; ++i)
- g.advances[i] = g.advances[i].round();
+#ifdef Q_OS_DARWIN
+ if (actualFontEngine->type() == QFontEngine::Mac) {
+ // CTRunGetPosition has a bug which applies matrix on 10.6, so we disable
+ // scaling the advances for this particular version
+ if (QSysInfo::MacintoshVersion != QSysInfo::MV_10_6 && actualFontEngine->fontDef.stretch != 100) {
+ QFixed stretch = QFixed(int(actualFontEngine->fontDef.stretch)) / QFixed(100);
+ for (uint i = 0; i < num_glyphs; ++i)
+ g.advances[i] *= stretch;
+ }
+
+ if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ for (uint i = 0; i < num_glyphs; ++i)
+ g.advances[i] = g.advances[i].round();
+ }
}
#endif