summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-12-14 12:55:04 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-12-16 15:02:20 +0000
commitae825a48dcb702cef6b9b5dc0cb24c5192fc4b63 (patch)
treed2cba63d8d91f83e0ef472719bb11035d40c7b9f /src
parent1f30434356603109ca8aa5edb720522cb6fceac0 (diff)
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qharfbuzzng.cpp2
1 files changed, 2 insertions, 0 deletions
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;
}