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

Nested <tspan> elements not supported

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7
    • SVG Support
    • None
    • All

    Description

      Some tools, such as Inkscape, create multiple nested <tspan> elements, which causes the SVG parser to show an error: "Could not add child element to parent element because the types are incorrect."

      Example:

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <!-- Created with Inkscape (http://www.inkscape.org/) -->
      
      <svg
         width="210mm"
         height="297mm"
         viewBox="0 0 210 297"
         version="1.1"
         id="svg1"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns="http://www.w3.org/2000/svg"
         xmlns:svg="http://www.w3.org/2000/svg">
        <defs
           id="defs1">
          <linearGradient
             id="linearGradient1">
            <stop
               style="stop-color:#ff0000;stop-opacity:1;"
               offset="0"
               id="stop1" />
            <stop
               style="stop-color:#00ff00;stop-opacity:1;"
               offset="1"
               id="stop2" />
          </linearGradient>
          <rect
             x="150.02508"
             y="181.45326"
             width="412.12424"
             height="148.24613"
             id="rect1" />
          <linearGradient
             xlink:href="#linearGradient1"
             id="linearGradient2"
             x1="159.13997"
             y1="232.67492"
             x2="543.63868"
             y2="232.67492"
             gradientUnits="userSpaceOnUse" />
        </defs>
        <g
           id="layer1">
          <text
             xml:space="preserve"
             transform="scale(0.26458333)"
             id="text1"
             style="font-size:93.3333px;font-family:'Courier New';-inkscape-font-specification:'Courier New';white-space:pre;shape-inside:url(#rect1);display:inline;opacity:0.557377;fill:url(#linearGradient2);stroke-width:1.00157"><tspan
               x="150.02539"
               y="266.60392"
               id="tspan3"><tspan
                 style="font-family:Cali;-inkscape-font-specification:Cali"
                 id="tspan2">FOOBAR</tspan></tspan></text>
        </g>
      </svg>
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes