Closed mkroening closed 7 months ago
It's not a "bug", unfortunately.
draw.io
and similar tools are sadly known to be a source of trouble for SVG output (see also https://github.com/typst/typst/issues/1421). The reason being that they don't really create a "pure" SVG, but instead they rely on the foreignObject
feature to embed HTML fragments into the SVG. As a result of this, you basically would need to have a full-blown browser engine to render their SVG, which we don't. And it's unlikely to ever be supported (because we rely on an upstream crate which is very unlikely to ever implement this, as it's not really part of the SVG specification).
Your SVG is basically saying "try to render this HTML fragment, and if this is not possible embed the image instead". For some reason, the two images have a different y position, which is also why they appear on a different height. That's not a bug from our side though, you can try opening the SVG in Inkscape (which doesn't support HTML either) and the result is exactly the same.
So I'm afraid there is not much we can do here. :( Other than blame draw.io
for not producing proper SVG files.
Ah, that makes sense. Thank you so much for the explanation! I opened an issue over at drawio-desktop: https://github.com/jgraph/drawio/issues/4473
Creating two simple text boxes next to each other in draw.io, exporting to SVG and converting to PDF with svg2pdf works fine. It does not work fine as soon as I select “Embed Fonts” when exporting to PDF, though. Apart from the text being rasterized (which might not be avoidable), the text is rendered at different heights.
example.drawio
:example.svg
(with embedded fonts):example.pdf
Thanks for your help! :)