Slick Forums

Discuss the Slick 2D Library
It is currently Sat May 25, 2013 8:57 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Sep 18, 2011 5:53 am 
Offline

Joined: Wed Sep 14, 2011 2:03 pm
Posts: 7
Hello,

according to the svg specification

the path data does allow upper and lower case characters for commands (e.g. m/M for move) whereas the lowercase means the following coordinates are relative, and uppercase means they are absolute.

InkscapeReader does only support 'M' for example, but inkscape does write out both. Here is a example from a normal inkscape file, which throws a exception:

Code:
<path
       style="fill:#0000ff;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.37037036000000001"
       d="m 758.92857,485.5 -342.85714,-141.42857 3.57143,-18.92857 347.5,141.42857 z"
       id="path3790"
       inkscape:connector-curvature="0"
       transform="translate(0,284.36218)" />
    <path
       style="fill:#0000ff;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.37037036"
       d="M 326.78571,705.5 673.92857,524.78571 673.21429,545.85714 326.42857,722.28571 z"
       id="path3800"
       inkscape:connector-curvature="0"
       transform="translate(0,284.36218)" />


The exception:

Code:
Caused by: org.newdawn.slick.svg.ParsingException: (path3790) Invalid token in points list
   at org.newdawn.slick.svg.inkscape.PolygonProcessor.processPoly(PolygonProcessor.java:70)
   at org.newdawn.slick.svg.inkscape.PolygonProcessor.process(PolygonProcessor.java:93)
...
Caused by: java.lang.NumberFormatException: For input string: "m"
   at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
   at java.lang.Float.parseFloat(Unknown Source)
   at org.newdawn.slick.svg.inkscape.PolygonProcessor.processPoly(PolygonProcessor.java:64)


Please also support relative coordinates.
Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 18, 2011 6:13 am 
Offline

Joined: Wed Sep 14, 2011 2:03 pm
Posts: 7
Workaround for people who run into the same problem: i have noticed, that it has something to do on how you draw your stuff, if you end up with a relative path (you can see the object id in the exception ParsingException: (objectid)), restart inkscape, delete the object in question and redraw. In my case it ended up in a absolute path, which can be read by current InkscapeReader


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group