Hi,
I am using an XML parser to create Box2D bodies from XML files. The parser doesnt support the "m" tag for paths, just "M". In Inkscape 0.48, just moving paths around changes the original upper case M to an m and so breaks the parsing. Also, creating new beziers, always creates a lowercase m and not the uppercase M which my parser supports. I cant change the lowercase m to an M, Inkscape defaults it back.
Can I ask, has anything changed in terms of the way paths are defined? Whats the difference between the lower and upper case "m"?
For example, this was working fine
M -145,465 769,-6 -18,-878 -810,7 59,877 z
but now just moving it around it becomes
m -145,465 769,-6 -18,-878 -810,7 59,877 z
and the parser breaks.
Regards
i
Path XML - M changed to m in the definition?
Re: Path XML - M changed to m in the definition?
indy2005 wrote:Can I ask, has anything changed in terms of the way paths are defined? Whats the difference between the lower and upper case "m"?
There was a change in Inkscape 0.47 to default to writing optimized path data if possible:
Release notes 0.47 > Optimized path data
More details about the difference between absolute and relative commands:
SVG 1.1 Specification > Paths > Path data
You can change the settings (to pre-0.47 behavior) in
Inkscape Preferences > SVG Output > Path data:
- [ ] Allow relative coordinates
[x] Force repeat commands
Re: Path XML - M changed to m in the definition?
Thanks, really helpful.
Can I ask, if things have reverted back to relative, and then you change the references - do all existing paths change, or do you need to redefine them once the option to force repeats has been set?
Regards
i
Can I ask, if things have reverted back to relative, and then you change the references - do all existing paths change, or do you need to redefine them once the option to force repeats has been set?
Regards
i
Re: Path XML - M changed to m in the definition?
indy2005 wrote:Can I ask, if things have reverted back to relative, and then you change the references - do all existing paths change, or do you need to redefine them once the option to force repeats has been set?
After changing the preferences, you have to trigger Inkscape to rewrite the path data e.g. by selecting the objects and moving them with the cursor keys - one tick up and one back down. IIRC this works on groups as well, but you better verify yourself (you can see the changes live-updating in 'Edit > XML Editor…') - else enter the group with a double-click, select all (Ctrl+A) and move the selection a step up and back down again.
Example:
Code: Select all
m 300,100 c -100,50 -100,50 -200,0 100,-50 100,-50 200,0 z
Code: Select all
M 300,100 C 200,150 200,150 100,100 200,50 200,50 300,100 z
Code: Select all
M 300,100 C 200,150 200,150 100,100 C 200,50 200,50 300,100 z
Re: Path XML - M changed to m in the definition?
Thanks for the very quick response