Debian Codegraph @

tests/manual/scenegraph_lancelot/data/text/text_advance_hebrew.qml

raw
1 import QtQuick 2.10
2
3 Item {
4 width: 320
5 height: 480
6
7 property string firstWord: "תורת רב־לשוני אנא "
8 property string secondWord: "של"
9
10 Text {
11 id: referenceText
12 text: firstWord + secondWord
13 anchors.centerIn: parent
14 font.italic: true
15 font.pixelSize: 30
16 }
17
18 Text {
19 id: firstWordItem
20 anchors.right: referenceText.right
21 anchors.top: referenceText.bottom
22 text: firstWord
23 font: referenceText.font
24 }
25
26 Text {
27 id: secondWordItem
28 anchors.right: firstWordItem.left
29 anchors.baseline: firstWordItem.baseline
30 anchors.baselineOffset: firstWordItem.advance.height
31 text: secondWord
32 font: referenceText.font
33 }
34
35 Text {
36 id: firstWordItemRichText
37 anchors.right: referenceText.right
38 anchors.top: secondWordItem.bottom
39 text: firstWord
40 font: referenceText.font
41 textFormat: Text.RichText
42 }
43
44 Text {
45 id: secondWordItemRichText
46 anchors.right: firstWordItemRichText.left
47 anchors.baseline: firstWordItemRichText.baseline
48 anchors.baselineOffset: firstWordItemRichText.advance.height
49 text: secondWord
50 font: referenceText.font
51 textFormat: Text.RichText
52 }
53
54 }