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

VectorImage: Scaled text elements have bad kerning

    XMLWordPrintable

Details

    • bc89f85a3 (dev), b5bef69c5 (6.9), 914f75fe1 (6.8)

    Description

      In the attached example, the SVG image's size is nominally 25x10 but it is displayed at 250x100.

       

      Code
      text.svg

      <svg viewBox="0 0 25 10" xmlns="http://www.w3.org/2000/svg">
          <text x="5" y="5" font-size="2" font-family="Arial">Some test text!</text>
      </svg>
      

       

      Main.qml

      import QtQuick
      import QtQuick.VectorImage
      
      Window {
          id: root
          width: 400
          height: 300
          visible: true
      
          property real svgWidth: 250
          property real svgHeight: 100
      
          Column {
              Text { text: "Image:" }
              Image {
                  source: "text.svg"
                  sourceSize.width: root.svgWidth
                  sourceSize.height: root.svgHeight
                  width: root.svgWidth
                  height: root.svgHeight
              }
      
              Text { text: "VectorImage:" }
              VectorImage {
                  source: "text.svg"
                  width: root.svgWidth
                  height: root.svgHeight
              }
          }
      }
      

       

      Outcomes
      Image renders the SVG just fine, but VectorImage has terrible kerning:

      Attachments

        For Gerrit Dashboard: QTBUG-133852
        # Subject Branch Project Status CR V

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes