From ca36198251147d2df0b07beef1f824e07e369d07 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 18 Sep 2014 14:47:35 +0200 Subject: QPaintBuffer paints drawGlyphRun with wrong font If QRawFont and and drawGlyphRun is used on a QPaintBuffer it will lose the QRawFont and end up painting with primary font at the time. With this patch, QStaticTextItem can now indicate that they must be drawn using the supplied font-engine and that the font information is not enough. Change-Id: Id6bd376d797d2bfb457e7de55c48bdcf9f20ae38 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qstatictext_p.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gui/text') diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h index 4451f27b27..fd920aaa52 100644 --- a/src/gui/text/qstatictext_p.h +++ b/src/gui/text/qstatictext_p.h @@ -79,7 +79,8 @@ class Q_GUI_EXPORT QStaticTextItem { public: QStaticTextItem() : chars(0), numChars(0), useBackendOptimizations(false), - userDataNeedsUpdate(0), m_fontEngine(0), m_userData(0) {} + userDataNeedsUpdate(0), usesRawFont(0), + m_fontEngine(0), m_userData(0) {} QStaticTextItem(const QStaticTextItem &other) { @@ -97,6 +98,7 @@ public: color = other.color; useBackendOptimizations = other.useBackendOptimizations; userDataNeedsUpdate = other.userDataNeedsUpdate; + usesRawFont = other.usesRawFont; m_fontEngine = 0; m_userData = 0; @@ -145,6 +147,7 @@ public: QColor color; // 10 bytes per item char useBackendOptimizations : 1; // 1 byte per item char userDataNeedsUpdate : 1; // + char usesRawFont : 1; // // ================ // 51 bytes per item -- cgit v1.2.3