Dia - Cairo

Dia already supports a bunch of export formats. This page is about a recently added new rendering facility - and it's comparsion to already exisiting ones.

For some this may look like just the third PNG and also the third Postscript exporter. For others - especially those believing in Cairo finally reaching it's goals - this may become Dia's first second PDF exporter.

Update

But something has changed in regard to PDF creation, see below ...

Test and Comparsion

My ususal test file for new Dia renderer implemenations is render-test.dia. The PNG output of the Cairo renderer follows - it now even has a transparent background (if you can't see it, that's not a problem of Dia or Cairo but with your browser).

Rendered with Cairo

It shows some problems compared to the ouput produced with Dia's standard antialiased PNG export facility (namely libart). These are known limitations in Cairo itself :

The source code of the DiaCairo renderer is in gnome cvs. A patch to make Cairo compile with the msvc toolchain is here. It also includes the native win32 backend useable from the Dia Cairo plug-in.

Rendered with Libart

When exporting from Dia to Portable Network Graphics (*.png) you are using libart_lgpl as the rendering backend. Depending on the platform and build text is produced by Pango/Win32 or Pango/FT2.

The images are only sampled with nearest neighbor, but everything else properly antialiased.

Rendered with Libart

Rendered with GdkPixbuf

The following result is produced by the GdkPixbuf(GdkWin32/PangoWin32) rendering. It is interpolating images with an algorithm better than nearest (GDK_INTERP_TILES) and also supports line styles for everything (at least if not run on win9x, where the line style rendering of gdk is limited to vertical and horizontal lines ;). The output is not antialiased.

Rendered with GdkPixbuf

Cairo, Dia and PDF

Recently a PDF backend arrived in Cairo cvs. But outside of Cairo the world does not stand still either. So if you are just interested in cross platform PDF creation you may want to take a look at gnome-print. Beside some issue with page boundaries (probably completely on Dia's gprint site) the output created via gnome-print looks quite usable (although too huge, 1.2 MB) .

The same input file rendered through Dia's wmf plug-in and processed by Adobe PDF (printer driver) is just 42K.

While at PDF - though just related by format - here's the output of my native Cairo/win32 backend. The windoze meta file used here was more than 2MB (partly due to glyphs still rendered as bitmaps, the resulting file is 213K thanks to Word printing through Adobe PDF.

Oh and the here is also the output of Cairo's built-in PDF (just no text and alpha rendering yet).

Conclusion

Every renderer presented here has some glitches. With a SVG capable browser you can see how the image is supposed to look like or some more defects ;-)

But if you know how to improve any of the renderers: patches accepted, it is all open source ...


[Gimp] [PDB] [Dia] [Gtk+] [Ports] [HOME]