Bug 771 : Add support style attribute for path tag to Candy SVG
Last modified: 2008-10-21 14:12




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
enhancement

 

Reporter:
chazmatazz
Assigned To:
fry

Attachment Type Created Size Actions
Patch to support some style patch 2008-05-22 11:08 11.84 KB
Test case for the style attribute image/svg+xml 2008-05-22 11:09 115.25 KB
PMatrix.java that adds skewX and skewY text/x-java 2008-05-31 17:48 19.19 KB
SVG.java adds better support for transform, fill-opacity, stroke-opacity, opacity and style text/x-java 2008-05-31 17:51 66.80 KB
Test case for the transform support image/svg+xml 2008-05-31 17:52 1.26 KB
New PShapeSVG.java that correctly parses style properties, this should make it more compatible with Inkscape text/x-java 2008-10-21 12:49 49.62 KB
Testing sketch that I used. application/zip 2008-10-21 12:50 12.04 KB

Description:   Opened: 2008-05-16 10:02
My inkscape output mostly works, but it puts stroke and fill information into a style attribute of
the path tag, like so <path style="fill:#FFFFFF; stroke:#00FF00" ... />. It's very similar to the
html style tag.

This is an enhancement, I am using Processing 0135.
Additional Comment #1 From chazmatazz 2008-05-19 10:27
Y'know, I had second thoughts about this. I see that it's not part of SVG 1.1 Tiny. It sounds like
this should be part of the larger future enhancement of Candy SVG that you're talking about.
Additional Comment #2 From fry 2008-05-21 07:30
i think ricard is looking into it; we'll have to see how complicated it is
to support. but you're correct that not being in svg tiny is a strike
against it.
Additional Comment #3 From Ricard 2008-05-22 11:08
edit]
Patch to support some style

This is a patch that tries to add some support of the svg style attribute. I
haven't been able to try this patch since my processing from svn does not work
properly, I will try to fix this and try it. Maybe someone can give it a try
and let me know if it works.

This patch does not implement the fill-opacity and stroke-opacity yet. Will
have to make a bit more of changes to support those.
Additional Comment #4 From Ricard 2008-05-22 11:09
edit]
Test case for the style attribute
Additional Comment #5 From fry 2008-05-27 11:10
(In reply to comment #3)
> This is a patch that tries to add some support of the svg style attribute. I
> haven't been able to try this patch since my processing from svn does not
work
> properly, I will try to fix this and try it. Maybe someone can give it a try
> and let me know if it works.

honest, svn should be working just fine (bug #772). there's nothing in my
local repository that has not been checked in. perhaps try doing a fresh
checkout of the source and see if that fixes things.
Additional Comment #6 From fry 2008-05-28 11:14
can you post a .java file? eclipse is choking on the patch (i've probably
changed too much since you made this).
Additional Comment #7 From Ricard 2008-05-31 17:48
edit]
PMatrix.java that adds skewX and skewY

Addition of skewX and skewY to PMatrix that will help SVG support.
Additional Comment #8 From Ricard 2008-05-31 17:51
edit]
SVG.java adds better support for transform, fill-opacity, stroke-opacity,
opacity and style

Here is an updated SVG.java that adds better support to the following
attributes:
* transform
* fill-opacity
* stroke-opacity
* opacity
* style
Additional Comment #9 From Ricard 2008-05-31 17:52
edit]
Test case for the transform support
Additional Comment #10 From Ricard 2008-05-31 17:58
Sorry for the delay, I was in Budapest a bit disconnected due to project
meetings for my PhD, and work goes first.

I attached the .java files (for revision 4027) and another test case. The
old patch was incorrect.

I'm glad my Processing is now working! However I would be happy if you
test this to see if it works as expected (in my computer it does) but a lot
has changed, and I only have a few test SVGs.

Let me know if any further changes are needed.
Additional Comment #11 From fry 2008-10-15 07:13
re-assigning the bug to myself so that i get the updates about it.
Additional Comment #12 From fry 2008-10-21 11:33
If someone can please update this code for more recent releases of
Processing (0149+), I'd love to add this patch to PShapeSVG.
Additional Comment #13 From Ricard 2008-10-21 12:49
edit]
New PShapeSVG.java that correctly parses style properties, this should make it
more compatible with Inkscape
Additional Comment #14 From Ricard 2008-10-21 12:50
edit]
Testing sketch that I used.
Additional Comment #15 From Ricard 2008-10-21 12:54
I ported the code that I had prepared for SVG.java to PShapeSVG.java. I
attached the new PShapeSVG.java version and a test sketch.

Let me know if you have any problems with this.
Additional Comment #16 From fry 2008-10-21 14:12
Great! Thanks for the update. I've added the changes for 0154.