summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2013-03-25 19:20:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-26 19:14:16 +0100
commita2fc37044ce3e7a51317a6528d121df632df5d68 (patch)
tree2129c79cddf913f603740b5226a5535c69cad293
parentf1d8987b82ce6b0a852b715a8713608bfd72aabf (diff)
Fix font stretching issue
We're treating fontDef.pixelSize as a box height everywhere but in harfbuzzFont initialization code the logic was opposite. Change-Id: I4eecf7861a6084c7f2dbe1df85a71f2e251da845 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r--src/gui/text/qfontengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 7654b56d75..47c59fb826 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -264,8 +264,8 @@ void *QFontEngine::harfbuzzFont() const
HB_FontRec *hbFont = (HB_FontRec *)font_;
if (!hbFont->x_ppem) {
QFixed emSquare = emSquareSize();
- hbFont->x_ppem = fontDef.pixelSize;
- hbFont->y_ppem = fontDef.pixelSize * fontDef.stretch / 100;
+ hbFont->y_ppem = fontDef.pixelSize;
+ hbFont->x_ppem = fontDef.pixelSize * fontDef.stretch / 100;
hbFont->x_scale = (QFixed(hbFont->x_ppem * (1 << 16)) / emSquare).value();
hbFont->y_scale = (QFixed(hbFont->y_ppem * (1 << 16)) / emSquare).value();
}