Closed leonbohmann closed 2 years ago
the <tspan>
tag is not yet supported only basic <text>
tags
In your svg you have <tspan />
which is not supported currently, only simple text inside <text />
tags like <text x="20" y="35">My</text>
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tspan
<text
xml:space="preserve"
style="font-size:18.062500px;font-style:normal;font-variant:normal;font-weight:400;font-stretch:Normal;line-height:125.000000%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;text-align:start;text-anchor:start;"
transform="matrix(1.000000,-0.000000,0.000000,1.000000,92.736000,38.208000)"
x="0.000000"
y="0.000000"
id="text211"><tspan
sodipodi:role="line"
x="0.000000"
y="0.000000"
id="tspan209"><tspan
dx="0.000000"
dy="0.000000"
style="fill:#000000;font-size:18.062500px;font-style:normal;font-variant:normal;font-weight:400;font-stretch:Normal;font-family:Arial;"
id="tspan207">V</tspan></tspan></text>
Do you know of a way in which I convert that svg to a compatible one?
I'm facing the same issue too
When exporting the svg from Illustrator or InkScape you need to convert text to paths. Another possibility is to use a XAML Converter (that is what I did) like this one.
Unlucky our scenario is different. From one side we have a chart library that export a chart in SVG and from the other side we render it on a PDF with QuestPDF and SKIA. I think, at the moment, the only way to workaround the problem for us, is to export the chart as PNG instead of SVG. It will be nice if tspan support will be available in future.
I know there are some libraries which can export svgs. Maybe load them in that library (cant remember the name) and export using the text->path conversion?
I know there are some libraries which can export svgs. Maybe load them in that library (cant remember the name) and export using the text->path conversion?
I will look into it, thanks
Chrome:
Hello! I have a svg-Image containing some text. The rendering of lines and areas works fine but the text does not render.
I already tried converting the text to contours but without success.
Original Image
Rendering
Source (I truncated a lot of the tags to make it shorter)