diff --git a/share/qtcreator/qml-type-descriptions/builtins.qmltypes b/share/qtcreator/qml-type-descriptions/builtins.qmltypes index 811ad87c1e8..ec31791827f 100644 --- a/share/qtcreator/qml-type-descriptions/builtins.qmltypes +++ b/share/qtcreator/qml-type-descriptions/builtins.qmltypes @@ -673,6 +673,8 @@ Module { Property { name: "capitalization"; type: "Capitalization" } Property { name: "letterSpacing"; type: "qreal" } Property { name: "wordSpacing"; type: "qreal" } + Property { name: "kerning"; type: "bool" } + Property { name: "preferShaping"; type: "bool" } } Component { name: "QDeclarativeGradient" diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml index 2af88020c6d..de97df46b80 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml @@ -191,11 +191,13 @@ Section { width: 42 } SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 - decimals: 0 + maximumValue: 500 + minimumValue: -500 + decimals: 2 backendValue: backendValues.font_wordSpacing Layout.fillWidth: true + Layout.minimumWidth: 60 + stepSize: 0.1 } Item { width: 4 @@ -208,11 +210,39 @@ Section { width: 42 } SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 - decimals: 0 + maximumValue: 500 + minimumValue: -500 + decimals: 2 backendValue: backendValues.font_letterSpacing Layout.fillWidth: true + Layout.minimumWidth: 60 + stepSize: 0.1 + } + } + + Label { + visible: minorQtQuickVersion > 9 + text: qsTr("Performance") + } + + SecondColumnLayout { + visible: minorQtQuickVersion > 9 + + CheckBox { + text: qsTr("Kerning") + Layout.fillWidth: true + backendValue: (backendValues.font_kerning === undefined) ? dummyBackendValue : backendValues.font_kerning + tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. This may " + + "improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.") + } + + CheckBox { + text: qsTr("Prefer Shaping") + Layout.fillWidth: true + backendValue: (backendValues.font_preferShaping === undefined) ? dummyBackendValue : backendValues.font_preferShaping + tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" + + "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,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.") } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml index 5fb4d612fb2..152d17eb0bc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml @@ -128,5 +128,21 @@ Section { backendValue: backendValues.fontSizeMode Layout.fillWidth: true } + + + Label { + text: qsTr("Line Height") + tooltip: qsTr("Sets the line height for the text.") + } + + SpinBox { + Layout.fillWidth: true + backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight + maximumValue: 500 + minimumValue: 0 + decimals: 2 + stepSize: 0.1 + } + } } diff --git a/src/libs/qmljs/qmljsvalueowner.cpp b/src/libs/qmljs/qmljsvalueowner.cpp index fe55d6f36b2..bc58f614909 100644 --- a/src/libs/qmljs/qmljsvalueowner.cpp +++ b/src/libs/qmljs/qmljsvalueowner.cpp @@ -493,6 +493,8 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind) _qmlFontObject->setMember(QLatin1String("letterSpacing"), realValue()); _qmlFontObject->setMember(QLatin1String("wordSpacing"), realValue()); _qmlFontObject->setMember(QLatin1String("hintingPreference"), unknownValue()); + _qmlFontObject->setMember(QLatin1String("kerning"), booleanValue()); + _qmlFontObject->setMember(QLatin1String("preferShaping"), booleanValue()); _qmlPointObject = newObject(/*prototype =*/ 0); _qmlPointObject->setClassName(QLatin1String("Point"));