Here's an SVG that I generated myself, rendered in a browser (browser.png). Here's the same SVG open in Inkscape (inkscape_TRGjuMi.png). I've attached the SVG as well ( example_XiP4pMZ.svg)
Inkscape can't read the foreignObject, that's fine, and it's not a party to the staying information found in the html that applies to the SVG, which is also fine. But if you look at the two images, you can see the Inkscape shows the left of the text to be significantly further right than how it shows in the browser. Is there a reason for that? Should I generate the HTML file differently?
The browser does have the file from the stylesheet, where Inkscape doesn't - but I expected (hoped?) that the actual offset wouldn't be affected (where as width obviously will be). I will investigate the validation errors
well, I discovered the problem: text-anchor. The browsers are defaulting to text-anchor = middle (and as far as I can see, ignoring anything else if I try to set anything else). but Inkscape defaults to text-anchor=start, and does read and pay attention to the setting.
Here's an SVG that I generated myself, rendered in a browser (browser.png). Here's the same SVG open in Inkscape (inkscape_TRGjuMi.png). I've attached the SVG as well ( example_XiP4pMZ.svg)
Inkscape can't read the foreignObject, that's fine, and it's not a party to the staying information found in the html that applies to the SVG, which is also fine. But if you look at the two images, you can see the Inkscape shows the left of the text to be significantly further right than how it shows in the browser. Is there a reason for that? Should I generate the HTML file differently?
Could be that the font is undeclared, so both Inkscape and browsers are substituting their default font which are different..
Also, the SVG validator shows errors in the file. https://validator.w3.org/check
The browser does have the file from the stylesheet, where Inkscape doesn't - but I expected (hoped?) that the actual offset wouldn't be affected (where as width obviously will be). I will investigate the validation errors
ok, so I fixed up all the errors in the generated SVG, and I figured out how to install the font for Inkscape, but the metrics error still remains:
Browser:
Inkscape:
Fixed source attached.
Sorry for the delay reply. I gotta pretend to work now.
I'll punt you over to the devs on the chat: https://chat.inkscape.org/channel/inkscape_user
well, I discovered the problem: text-anchor. The browsers are defaulting to text-anchor = middle (and as far as I can see, ignoring anything else if I try to set anything else). but Inkscape defaults to text-anchor=start, and does read and pay attention to the setting.