Hi,
I'm a casual Inkscape user. I just use Inkscape to create simple drawings that are read and displayed with a different software package. I've encountered the following issue and want to know if the problem is within Inkscape or in the package that should display the svg file:
When I create simple lines in Inkscape they are not displayed with the other package and I found out that Inkscape saves e.g. two point lines as:
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 75.714286,99.505039 648.57143,865.21933"
id="path3772"
inkscape:connector-curvature="0" />
where the d attribute starts with an 'M' but does not have any following character. In the SVG documentation I can see that there should be e.g. an 'L' for line or some other character identifying the path type after the first coordinate like:
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 75.714286,99.505039 L 648.57143,865.21933"
id="path3772"
inkscape:connector-curvature="0" />
If I add such an L into the attribute both Inkscape and the used package display the line correctly. I have to admit that e.g. Firefox displays the line also without needing an 'L'.
I have been able to make Inkscape to write such a line that the other package displays the line if I use the Path->Simplify command. But unlike the documentation says this command does not, at least in this case, remove unnecessary points rather than it makes the line a (Bezier?) curve and adds two points.
Questions:
1. Does Inkscape write paths (two point straight lines) correctly?
2. Does the Path->Simplify command work correctly (as specified and documented)?
TK
Questions on paths/lines
Re: Questions on paths/lines
Hi.
I don't know what you mean with "package" here. Is that another svg complicant software?
Have you tried to save files as "plain svg" ?
I don't know what you mean with "package" here. Is that another svg complicant software?
Have you tried to save files as "plain svg" ?

Re: Questions on paths/lines
I don't know what you mean with "package" here. Is that another svg complicant software?
It is wxsvg (http://sourceforge.net/projects/wxsvg/)
Have you tried to save files as "plain svg" ?
I just tried it, but it is even worse. It even removes such an 'L' that I manually added to the path, which was retained in a normal save operation...
TK
Re: Questions on paths/lines
No surprise: Inkscape's optimized path data is valid and in accordance with the SVG specifications ('L' or 'l' is implicit after a 'M' / 'm'):tstk wrote:If I add such an L into the attribute both Inkscape and the used package display the line correctly. I have to admit that e.g. Firefox displays the line also without needing an 'L'.
SVG 1.1 > Paths > 8.3.2 The "moveto" commands wrote:Start a new sub-path at the given (x,y) coordinate. M (uppercase) indicates that absolute coordinates will follow; m (lowercase) indicates that relative coordinates will follow. If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Hence, implicit lineto commands will be relative if the moveto is relative, and absolute if the moveto is absolute. If a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates. In this case, subsequent pairs of coordinates are treated as relative even though the initial moveto is interpreted as an absolute moveto.
What you can try as workaround to adjust to the limited SVG capabilities of that "other package": change Inkscape's preferences for 'SVG Output > Path data:' to
- [ ] Allow relative coordinates
- [x] Force repeat commands