Hello Thomas,

I did miss the micro parser thing.  Oh well.  I'll look into using those
for future projects.  I had a feeling I was overlooking something.

You're correct, there are many other things missing from the parser.  It
only supports the directives that are immediately translateable to
Java2D lineto, quadto, etc.  I should have noted that it probably will
only work with a very narrow band of SVG exporters.  I HAVE used it
consistently with Inkscape and a few Swift3D files though.

Thanks,
-Leon

-----Original Message-----
From: Thomas DeWeese [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 25, 2004 5:54 PM
To: Batik Users
Cc: Danilo Costa
Subject: Re: SVG to Java2D

Hi Leon,

    Two points,  first you may have missed that Batik includes a
whole set of 'micro parsers' that it uses to parse these basic
attributes, so presumably you could have used them (the dependencies
are fairly light as I recall).

    Second I don't think your path parser is quite con formant.  In
particular it seems to require that the path letter be repeated for
each segment, the spec makes it clear that they can be omitted if
you have a sequence of the same curve type (although most generators
output the extra letters).

Leon Franzen wrote:

> Hardly Batik related, but here's a small SVG path element "d" attrib
> parser that I wrote for a game I'm working on.  I tried to use Batik
at
> first but the project dependencies needed to stay small so I went with
> this.  I'm sure it's not efficient, but it works for me.  I have some
> more code to go with this to parse nested groups, line and fill style
> and associated transforms if you're interested.
> 
> I use Inkscape to draw graphics and then use "convert-to-path" on all
my
> primitives so rectangles, circles, etc are converted to paths.  Mostly
> because I was lazy and didn't want to write parsers for these.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to