Skip to content

Multiple tspan not rendering correctly #938

Open
@TommyN

Description

@TommyN

Description

A SVG with multiple tspan elements below a text-node doesn't render correctly when converted to PNG.
Below is a simple reproduction SVG using text-anchor "middle", <none> and "end" each with two child tspan elements.

Example data

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1080" height="1080">

  <g transform="translate(200 400)">
      <rect x="-150" y ="-50" width="300" height="100" rx="15" />
      <text text-anchor="middle" fill="#ffffff" font-size="26" font-family="Rubik-Regular, Rubik" letter-spacing="0em">
        <tspan style="font-weight: bold;fill: #ff0000">15</tspan>
        <tspan>Apples</tspan>
      </text>
  </g>

  <g transform="translate(200 600)">
      <rect x="-150" y ="-50" width="300" height="100" rx="15" />
      <text fill="#ffffff" font-size="26" font-family="Rubik-Regular, Rubik" letter-spacing="0em">
        <tspan style="font-weight: bold;fill: #ff0000">15</tspan>
        <tspan>Apples</tspan>
      </text>
  </g>

  <g transform="translate(200 800)">
      <rect x="-150" y ="-50" width="300" height="100" rx="15" />
      <text text-anchor="end" fill="#ffffff" font-size="26" font-family="Rubik-Regular, Rubik" letter-spacing="0em">
        <tspan style="font-weight: bold;fill: #ff0000">15</tspan>
        <tspan>Apples</tspan>
      </text>
  </g>

</svg>

image

It seems @Stoffelche found an issue that he commented on here: #769 (comment)

Related issue:

Used Versions

Svg 3.3.0
.NET Framework 4.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions