diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2014-01-29 17:46:47 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-31 12:07:59 +0100 |
commit | 2d576f79f748ca4c9bb54634f0fd44fa207a2248 (patch) | |
tree | 79d77a79281452d20253616ddb43059fce84e5eb /src/gui | |
parent | 8c9a587ed335dc88d30631bf7d2e11f777b274ed (diff) |
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 <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qharfbuzzng.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
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; } |