DirectWrite: Fix calculating bounding box of glyphs

We don't support vertical text layouts in Qt, so the vertical
advance should always be 0 (like it is in other engines).
Since we were setting this, we would calculate the bounding
box of strings in the DirectWrite engine as if the layouts
were diagonal, adding up both the horizontal and vertical advances.

[ChangeLog][QtGui][Windows] Fixed height of text bounding box when
using no or vertical hinting preference, or when the device pixel
ratio is different from 1.

Task-number: QTBUG-51024
Change-Id: I329917eb8da71fdfdffe9651ca8f0f48d26b6a60
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2016-08-17 13:03:59 +02:00 committed by Konstantin Ritt
parent 4531ae8d69
commit b8c1efcb88

View File

@ -436,7 +436,7 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(glyph_t g)
width,
height,
advanceWidth,
advanceHeight);
0);
} else {
qErrnoWarning("%s: GetDesignGlyphMetrics failed", __FUNCTION__);
}