Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are options for writing an SVG-based desktop application?

Say, I want to write a desktop application that will heavily use SVG. What are my choices of rendering engines, GUI toolkits, libraries, etc.?

I would like it to:

  1. run smoothly on Linux/Unix/Mac (everywhere with antialiasing)
  2. be open source
  3. be compatible with standard SVG (e.g. opacity, embedded raster graphics)
  4. accessible with modern dynamic language (Python, Ruby, Lisp, etc)
    • e.g. C-based solution would be perfect in that sense

So, what are my options?

like image 253
Vladimir Keleshev Avatar asked Nov 21 '11 12:11

Vladimir Keleshev


4 Answers

I would suggest cairo, Cairo is a 2D graphics library with support for SVG file output.

The cairo API provides operations similar to the drawing operators of PostScript and PDF. Operations in cairo including stroking and filling cubic Bézier splines, transforming and compositing translucent images, and antialiased text rendering. All drawing operations can be transformed by any affine transformation (scale, rotation, shear, etc.)

Cairo is implemented as a library written in the C programming language, but bindings are available for several different programming languages. Which include Perl, Python, Ruby and so much more.

It also has several Toolkit Bindings. GTK+ 2.8+ has full support for cairo for example.

Also has and experimental backends with OpenGL. Which benefits include Easily integrate features like PS-, PDF-, SVG-support to your OpenGL-application (may need additional libraries).

Cairo is free software and is available to be redistributed and/or modified under the terms of either the GNU Lesser General Public License (LGPL) version 2.1 or the Mozilla Public License (MPL) version 1.1 at your option.

like image 65
John Riselvato Avatar answered Nov 17 '22 23:11

John Riselvato


Considering the Safari Browser, which runs smoothly on a Mac. You could write your application using the Raphael library.

This database shows the Raphael language the page itself is pure vector graphics.

Just throwing this your way to see if it fits inside your constraints...

http://www.irunmywebsite.com/raphael/additionalhelp.php?v=2

like image 32
Chasbeen Avatar answered Nov 17 '22 21:11

Chasbeen


Appcelarator Titanium Desktop seems like your best bet. You can write a Ruby, Python, or JavaScript app and use HTML and CSS as the GUI. There's also Adobe AIR but it's not open source.

As for SVG the best library I've found is d3.js. At first glance you might get the impression it's visualization library but it can be used for any type of SVG work. Some have mentioned Rapheal.js, its strength is that it's cross browser, however it leaves some SVG features out like group <g> tags due to it having to use VML with most versions of IE.

like image 2
kreek Avatar answered Nov 17 '22 21:11

kreek


I would suggest to go for Apache's Batik. Batik is Java-based SVG toolkit that can render, generate, manipulate and transcode SVG across all platforms wherever Java exists; from Desktops, applets and even handheld devices. It leverages the power of platform independence of Java. It is an ideal choice for Desktop applications. It supports full interactivity, linking, scripting and animations too.

Apache Cocoon, Oracle JDeveloper 10i, The JFreeChart project, ILOG Dicovery and Jviews - The advanced visual data analysis tools, Volity and Gamut Gaming projects, GLIPS Graffiti SVG Editor, eDoc Studio project, Apache FOP project etc. are some of the projects which use Batik.

like image 2
Drona Avatar answered Nov 17 '22 22:11

Drona