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 --- .../data/text/text_bengali_noshaping.qml | 15 +++++++++++++++ .../data/text/text_latin_noshaping.qml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/manual/scenegraph_lancelot/data/text/text_bengali_noshaping.qml create mode 100644 tests/manual/scenegraph_lancelot/data/text/text_latin_noshaping.qml (limited to 'tests/manual/scenegraph_lancelot') diff --git a/tests/manual/scenegraph_lancelot/data/text/text_bengali_noshaping.qml b/tests/manual/scenegraph_lancelot/data/text/text_bengali_noshaping.qml new file mode 100644 index 0000000000..343d5768e4 --- /dev/null +++ b/tests/manual/scenegraph_lancelot/data/text/text_bengali_noshaping.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + Text { + anchors.fill: parent + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + font.family: "Arial" // Should use Lohit Bengali + font.pixelSize: 20 + font.preferShaping: false + text: "ধারা ১: সমস্ত মানুষ স্বাধীনভাবে সমান মর্যাদা এবং অধিকার নিয়ে জন্মগ্রহণ করে। তাঁদের বিবেক এবং বুদ্ধি আছে; সুতরাং সকলেরই একে অপরের প্রতি ভ্রাতৃত্বসুলভ মনোভাব নিয়ে আচরণ করা উচিৎ।" + } +} diff --git a/tests/manual/scenegraph_lancelot/data/text/text_latin_noshaping.qml b/tests/manual/scenegraph_lancelot/data/text/text_latin_noshaping.qml new file mode 100644 index 0000000000..6dc6c2f3d6 --- /dev/null +++ b/tests/manual/scenegraph_lancelot/data/text/text_latin_noshaping.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + Text { + anchors.fill: parent + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + font.family: "Arial" + font.pixelSize: 20 + font.preferShaping: false + text: "Are griffins birds or mammals?" + } +} -- cgit v1.2.3