From 2d576f79f748ca4c9bb54634f0fd44fa207a2248 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 29 Jan 2014 17:46:47 +0200 Subject: Make HarBuzz-NG the default shaper on Mac Since we dropped all platform-related shapers during the QPA refactoring, thus making HarfBuzz the only shaper on all platforms, we can not deal with AAT-capable fonts anymore. HarBuzz-NG now supports it's own shaper backend infrastructure, so the decision was to enable HB's CoreText shaper backend on Mac and simply make HB-NG the default shaper there. Task-number: QTBUG-36056 Change-Id: If22e24fd5cc00c25952934332a2f4123f38135a4 Reviewed-by: Lars Knoll Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qharfbuzzng.cpp | 2 +- src/gui/text/qtextengine.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index c5bedecbfe..bf34c74b49 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -698,7 +698,7 @@ _hb_qt_font_create(QFontEngine *fe) const int x_ppem = (fe->fontDef.pixelSize * fe->fontDef.stretch) / 100; hb_font_set_funcs(font, hb_qt_get_font_funcs(), (void *)fe, NULL); - hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value()); + hb_font_set_scale(font, QFixed(x_ppem).value(), QFixed(y_ppem).value()); hb_font_set_ppem(font, x_ppem, y_ppem); return font; diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 79d56df7f2..739935fdd5 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1195,6 +1195,13 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st g.glyphs[i] |= (engineIdx << 24); } +#ifdef Q_OS_MAC + if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) { + for (uint i = 0; i < num_glyphs; ++i) + g.advances[i] = g.advances[i].round(); + } +#endif + glyphs_shaped += num_glyphs; } -- cgit v1.2.3