jinhu / svg-android

Automatically exported from code.google.com/p/svg-android
0 stars 0 forks source link

Implicity Line commands in Paths aren't handled #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. http://www.w3.org/TR/SVGTiny12/paths.html (8.3.2) says "If a 'moveto' is 
followed by multiple pairs of coordinates, the subsequent pairs shall be 
treated as implicit 'lineto' commands."

2. using the test case:
<?xml version="1.0"?>
<svg width="400" height="400" viewBox="0 0 400 400" 
xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny">
  <path d="M 100,100 300,100 200,300 z"
        fill="#ff0000" stroke="#0000ff" stroke-width="3" />
</svg>

What is the expected output? What do you see instead?
Expect to see a red triangle with a blue border, but instead there is no image 
at all.

What version of the product are you using? On what operating system?
latest from svn

Please provide any additional information below.
I'm using Inkscape, converting to SVG tiny, and its output doesn't match the 
format of Illustrator (although it creates valid Paths).

Original issue reported on code.google.com by jamie.mc...@gmail.com on 16 May 2011 at 6:19

GoogleCodeExporter commented 9 years ago
I've prepared a patch (attached) against the latest SVNParser.java (r44 from 
the trunk).  It adds support for implicit commands in paths (see the example 
above), and also support for multiple sub-paths (i.e. <path d="m[sub path]z 
m[sub path]z m[sub path]z" />

Both these things are needed by files created by Inkscape.

Original comment by jamie.mc...@gmail.com on 18 May 2011 at 9:30

Attachments:

GoogleCodeExporter commented 9 years ago
I forgot to attach some test cases for use with the patch attached above.  
t.svg and b.svg both render their respective letters of the alphabet (as paths, 
not via font-support), and make use of both implicit commands and multiple 
subpaths.

Original comment by jamie.mc...@gmail.com on 18 May 2011 at 9:39

Attachments:

GoogleCodeExporter commented 9 years ago
Late to the party and under-experienced so forgive my silly question... how do 
I apply the patch?

Original comment by Marcamillian on 14 May 2012 at 12:50