Why is Batik so much larger than JFreeSVG?

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).
Locked
DavidThi808
Posts: 106
Joined: Fri May 27, 2005 7:44 pm
Location: Boulder, CO
Contact:

Why is Batik so much larger than JFreeSVG?

Post by DavidThi808 » Sun Aug 14, 2016 3:08 pm

Hi all;

This is just curiosity. And I'm definitely not complaining. But why such a gigantic difference in size?

??? - thanks - dave

charlieg
Posts: 1
Joined: Mon Aug 15, 2016 3:08 pm
antibot: No, of course not.

Re: Why is Batik so much larger than JFreeSVG?

Post by charlieg » Mon Aug 15, 2016 3:11 pm

Registering simply to answer this because I found the general web page / information misleading by absence of explanation on the specific and critical difference:

Batik renders SVG. You can feed it an SVG string and it'll draw it for you. That is extremely non-trivial.

JFreeSVG outputs SVG. You feed it Java2D instructions and it produces an SVG string for you. That's... of very limited use, in my opinion.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Why is Batik so much larger than JFreeSVG?

Post by david.gilbert » Tue Aug 16, 2016 10:34 pm

That's correct. JFreeSVG only does SVG generation via Java2D's Graphics2D API. Batik performs that function and, in addition, the much more complex task of interpreting SVG input and rendering it to the screen. That's why Batik is a much larger library - it does more things. For people that just want to generate SVG via the Graphics2D API, you can choose either Batik or JFreeSVG...both will do this job, but JFreeSVG is a smaller dependency and in the tests we've run JFreeSVG is much faster.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked