Hi, is there a way to retrieve the X/Y/width/height coordinates of individual items in an SVG page? E.g. something that will resolve nested transformation matrices, font sizes and kerning and other font metrics, or any other layout aspects of the format. Parsing SVG files directly won't reveal this information unless I do a lot of math, and I was hoping that Inkscape has this available already somewhere.
I guess I'm looking for a renderer with an API where I can query where it's putting things on the page. Does such a thing exist?
API for X/Y/width/height coords of things on page?
Re: API for X/Y/width/height coords of things on page?
Checkout the CLI query options http://tavmjong.free.fr/INKSCAPE/MANUAL ... Query.html
http://inkscape.modevia.com/inkscape-man.html
http://inkscape.modevia.com/inkscape-man.html
just hand over the chocolate and nobody gets hurt
Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download
Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download
Re: API for X/Y/width/height coords of things on page?
That looks very close to what I was after, thanks. It's definitely much better than parsing the file manually and it'll give me an X/Y reference point for my calculations
One remaining issue is that the tspan element can have letter kerning. Eg.
<tspan x="0 1 2 50" y="0" id="tspan34">ABCD</tspan>
(the letter "D" is offset by 50 units)
And parent elements may have their own transformation matrices that distort the position of "D" yet further. Is there a way to get X/Y coordinates of each letter? (even if it means tweaking the SVG slightly)
One remaining issue is that the tspan element can have letter kerning. Eg.
<tspan x="0 1 2 50" y="0" id="tspan34">ABCD</tspan>
(the letter "D" is offset by 50 units)
And parent elements may have their own transformation matrices that distort the position of "D" yet further. Is there a way to get X/Y coordinates of each letter? (even if it means tweaking the SVG slightly)