Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-133284

letter spacing + inline images + StyledText = bad spacing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.2
    • None

    Description

      Looks ok with Text.RichText. Looks incorrect with Text.StyledText.

      Test app:

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      
      Window {
         //color: "#41CD52"
          id:root
          visible: true
          width: 800
          height: 480
      
              property int letterSpacing: 0
      
              Slider {
                  id: spacingSlider
                  width: root.width * 0.8
                  anchors.horizontalCenter: parent.horizontalCenter
                  anchors.top: parent.top
                  anchors.topMargin: 20
                  from: -40
                  to: 40
                  value: 0
                  onValueChanged: {
                      root.letterSpacing = value
                  }
              }
      
              Text {
                  id: englishText
                  text: "Sample <img src=\"images/qtlogo.png\"> Text in English"
                  font.pixelSize: 24
                  textFormat: Text.StyledText
                  font.letterSpacing: root.letterSpacing
                 // anchors.horizontalCenter: parent.horizontalCenter
                  y: spacingSlider.height + spacingSlider.y + 20 // Position below the slider with some spacing
              }
      
              Text {
                  id: arabicText
                  text: "نص عربي للمثال"
                  font.pixelSize: 24
                  font.letterSpacing: root.letterSpacing
                 // anchors.horizontalCenter: parent.horizontalCenter
                  y: englishText.height + englishText.y + 20 // Position below the English text with some spacing
              }
      }
      

      Attachments

        1. letterspacing_rich.png
          21 kB
          Gatis Paeglis
        2. letterspacing-styled.png
          19 kB
          Gatis Paeglis
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            paeglis Gatis Paeglis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes