From ae825a48dcb702cef6b9b5dc0cb24c5192fc4b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 14 Dec 2018 12:55:04 +0100 Subject: Set point size, not just pixel size, when creating HarfBuzz fonts for shaping Otherwise HarfBuzz will fall back to using default font sizes, e.g. 12.0 in the CoreText backend. hb_coretext_font_create() already does the right thing, but we're not using that function, we create the hb_font_t ourselves in _hb_qt_font_create(). The mismatch didn't matter for vector-based fonts as the metrics (presumably) scale linearly, but for bitmap-based font such as Emojis they don't, and we ended up with advances that were way too large (increasingly so the larger the font point size). Change-Id: I4781dda965c745853732026da91590d8506ec3f5 Reviewed-by: Simon Hausmann --- src/gui/text/qharfbuzzng.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/text') diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index 21f880e7be..2f25aea92b 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -689,6 +689,8 @@ _hb_qt_font_create(QFontEngine *fe) hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value()); hb_font_set_ppem(font, x_ppem, y_ppem); + hb_font_set_ptem(font, fe->fontDef.pointSize); + return font; } -- cgit v1.2.3