Closed magistere closed 7 months ago
That's what I get:
The font looks right to me, you probably just don't have it installed correctly or for some reason svg2pdf
just can't find it. See also #44, font handling is definitely something that should be improved.
As for the dotted lines, something indeed seems to be going wrong here, I will try to investigate it in the next few days.
MRP:
<?xml version="1.0" encoding="utf-8" ?>
<svg height="200"
width="200" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<g transform="translate(80.5,0.5)">
<path d="m 0,0 0,150" id="gmark_0_0" style="stroke:#888;stroke-width:30;stroke-dasharray:1,3"/>
</g>
</g>
</svg>
Output:
The bug only seems to appear in Chrome and Adobe Acrobat.
So it boils down to this example:
<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<path d="M 100,25 L 100,175" fill="blue" stroke-opacity="0" stroke="green" />
</svg>
For some reason, Chrome and Acrobat will apply a fill to a line even though it's just a line...
Thanks, Laurenz! The font issue is resolved, Helvetica is set as font-family in that SVG, and it seems that browsers just handle it as sans-serif on Windows for better compatibility. Yes, dotted-lines issue depends on the PDF viewer. In Firefox the rendering is perfect, but in more popular Chrome and Acrobat it is not.
Yeah, I'll think about how we can circumvent this.
Happy to say that I managed to fix it, but it will be some time before I can open a PR because we need a new release of resvg
(which has just been updated, so might probably be a while before that happens).
Great! Thank you!
Hello, I'm trying to use svg2pdf to convert SVG files of Wavedrom diagrams generated by https://github.com/wallento/wavedrompy, but the rendering of text and dotted lines is different from SVG rendering in the browser and seems wrong. Input SVG:
PDF from svg2pdf: