SVG rendering in Java using SWT - Batik too slow

I'm having performance issues with Batik when I try to display SVG files using SWT. This seems like a very bloated library, but the only thing I could find was SVGSalamander, and it looks like it's just Swing. Is there a way to visualize SVGs without turning them into a raster form and then faster? It must be a cross platform.

+3
source share
1 answer

If you just need rendering, I highly recommend using Mozilla (XULRunner) or WebKit (WebKitGTK +), as they can be built into the SWT library.

  • Mozilla XULRunner can be used on Windows, Linux, and Mac. It can be used in the SWT class by Browserpassing
  • Safary (which is WebKit) uses SWT by default in Mac OS X. On Linux, it uses the browser from SWT 3.7 by default (which is only in its early stages). You can force SWT to use WebKit by passing the system property org.eclipse.swt.browser.UseWebKitGTKas true if you have SWT 3.6.0+. On Windows, there is a WebKitGTK + port from GenuiTec, which can be found here .

In conclusion, the XULRunner SVG engine is easier to operate because its support is wider. You can create an all-in-one package for your application (XULRunner kit) for any platform. I personally do not recommend Genuteec SWT WebKit for Windows, as it is not mature enough.

+3

Source: https://habr.com/ru/post/1764257/


All Articles