From e8161969828a67584fa3ab1cdb2bd79eb447c1da Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 8 Aug 2017 09:23:45 +0200 Subject: Fix hardcoding font family before the font is loaded When you hardcoded the font family of an application font before the font was actually loaded, the QTextLayout would cache the glyph indexes from the fallback font, and these would later be applied to the proper font in the render thread, causing corrupted text and warnings. It is easy enough to work around this by binding the font.family property to the name property of the FontLoader, but to handle the error case more gracefully, we now check during the polish phase whether the actual font assignment has changed, and redo the QTextLayout when we have to. [ChangeLog][QtQuick][Text] Fixed an issue when the family of an application font was hardcoded and applied to text before the font itself was loaded. Task-number: QTBUG-61984 Change-Id: Ib0e80a78f3b6fe4a3b0188c69516a20d0bf4cb45 Reviewed-by: Lars Knoll --- src/quick/items/qquicktext_p_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick/items/qquicktext_p_p.h') diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index 957641ec0a..87f5162384 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -154,6 +154,8 @@ public: QQuickText::RenderType renderType; UpdateType updateType; + QString assignedFont; + bool maximumLineCountValid:1; bool updateOnComponentComplete:1; bool richText:1; -- cgit v1.2.3