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>
This commit is contained in:
Konstantin Ritt 2013-03-25 19:20:48 +02:00 committed by The Qt Project
parent f1d8987b82
commit a2fc37044c

View File

@ -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();
}