views:

79

answers:

1

I am having performance issues with Batik when I try to render SVG files using SWT. It seems like a very bloated library but the only other one I could find was SVGSalamander and it looks like it's Swing only. Is there a way to render the SVGs without converting them to a bitmap form first that's faster? It needs to be cross platform.

A: 

If you just need rendering, I highly recommend using Mozilla (XULRunner) or WebKit (WebKitGTK+), as both can be embedded in an SWT library.

  • Mozilla XULRunner can be used in Windows, Linux and Mac. It can be used in SWT Browser class by passing SWT.Mozilla style flag to the constructor.
  • Safary (which is WebKit) is used by SWT by default on Mac OS X. On Linux, it's default Browser as of SWT 3.7 (which is just in early stages). You can force SWT use WebKit by passing system property org.eclipse.swt.browser.UseWebKitGTK as true if you have SWT 3.6.0+. On Windows, there is a port of WebKitGTK+ by GenuiTec which can be found here.

To conclude, XULRunner's SVG engine is easier to work as it's support is wider. You can create an all-in-one package of your application (bundling XULRunner) for any platform. I personally do not recommend Genuitec's SWT WebKit on Windows, since it's not mature enough.

Mohsen