Multiple font sizes in a single QML text element

I'm trying to get an element Textto display text of different sizes using formatted text formatting:

  Text {
    font.pointSize: 30
    text: 'T' +
          '<font size="40px">T</font>' +
          '<font size="10px">T</font>' +
          '<font size="5px">T</font>' +
          '<font size="40pt">T</font>' +
          '<font size="10pt">T</font>' +
          '<font size="5pt">T</font>' +
          '<font size="1">T</font>' +
          '<font size="2">T</font>' +
          '<font size="3">T</font>' +
          '<font size="4">T</font>' +
          '<font size="5">T</font>' +
          '<font size="6">T</font>' +
          '<font size="-1">T</font>' +
          '<font size="-2">T</font>' +
          '<font size="-3">T</font>' +
          '<font size="-4">T</font>' +
          '<font size="-5">T</font>' +
          '<font size="-6">T</font>' +
          '<font size="20%">T</font>' +
          '<font size="60%">T</font>' +
          '<font size="130%">T</font>'
  }

Unfortunately, as can be seen from the final result, it seems that only the size from 1 to 7 and from -1 to -2 works as expected, everything else has zero effect. enter image description here

In particular, I want to say that the text is much less than the set value of 30pts, about 10 or so would be ideal, however I can not get this minimum using any of the few parameters that worked.

: , 7 "" -2 , , , - .

+4
1

Text.RichText, :

Text {
    textFormat: Text.RichText
    text: " <html>
                <div style='font-size: 5px;'>T</div>
                <div style='font-size: 10px;'>T</div>
                <div style='font-size: 20px;'>T</div>
                <div style='font-size: 30px;'>T</div>
            </html>"
}

, HTML- Text.StyledText, HTML 3.2. font-size HTML:

<font color="color_name" size="1-7"></font>

Text.RichText HTML 4, HTML.

HTML 4 CSS :

[ | | | x-large | xx-large] | pt | px

+5

Source: https://habr.com/ru/post/1695136/


All Articles