Skip to content

Whitespace only tspan not rendered, impacting spacing of containing text. [version 1.8.5] #307

Description

@Quantick

When using the DrawingGroup SharpVectors.Converters.FileSvgReader.Read(string svgFileName) method, I face the following issue:
When a <text> element contains a <tspan> with a single space as its innerText, the later is totally ignored, leading to spacing issues in the rendered text.
Failing SVG snippet:

        <text x="13.914" y="13.484" stroke="none" fill="#000000ff" font-family="'Arial'" font-size="3.174">
            <tspan fill="green">Failing</tspan>
            <tspan> </tspan>
            <tspan fill="red">test!</tspan>
        </text>

Here is a screenshot demonstrating the issue. Top is the MS Edge rendering, bottom is the WPF rendering of the resulting DrawingGroup - spacing between words was expected.

Image

The SVG file is: failing_tspan.svg. First line is a sentence in a single <text> element, second line is the <tspan> elements version.

Best regards.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions