From ff085e2591e8257c373db1c52475b9b54c3da56b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 3 Jul 2017 11:53:44 +0200 Subject: Add property to disable shaping on fonts Major performance improvements can be gained if you know for sure your text does not require any shaping features. This patch adds Qt Quick support for the QFont::PreferNoShaping flag (though as a boolean property to work better with property bindings). [ChangeLog][QtQuick][Text] Added "font.preferShaping" property to Text, TextEdit and TextInput. This makes it possible to improve performance at the expense of some cosmetic font features. Task-number: QTBUG-56728 Change-Id: Ib4e23d5b21b9d4929562df521347285b2586a62e Reviewed-by: Simon Hausmann --- src/quick/items/qquicktext.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/quick/items/qquicktext.cpp') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 07cc1ff76e..5f58f0cdde 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -1515,6 +1515,23 @@ QQuickText::~QQuickText() Text { text: "OATS FLAVOUR WAY"; font.kerning: false } \endqml */ + +/*! + \qmlproperty bool QtQuick::Text::font.preferShaping + \since 5.10 + + Sometimes, a font will apply complex rules to a set of characters in order to + display them correctly. In some writing systems, such as Brahmic scripts, this is + required in order for the text to be legible, but in e.g. Latin script, it is merely + a cosmetic feature. Setting the \c preferShaping property to false will disable all + such features when they are not required, which will improve performance in most cases. + + The default value is true. + + \qml + Text { text: "Some text"; font.preferShaping: false } + \endqml +*/ QFont QQuickText::font() const { Q_D(const QQuickText); -- cgit v1.2.3