In this short article I want to explain why Scribus should switch to a cairo based rendering as soon as possible. There are many reasons for doing this despite some drawbacks. But I hope these drawbacks will soon disappear. Let us first look at the benefits of libart:

  • It’s fast
  • Libart has been around for a long time, well tested and stable
  • Can be found in about every distribution and is cross-platform

And now the drawbacks:

  • it seems that it isn’t maintained actively now
  • Sometimes hard to use/find advanced features as the documentation is weak or non-existant.
  • It is missing some advanced features like blendmodes, clipping paths etc..

Cairo is instead a modern, completely developed from scratch rendering library. It’s still under heavy development and has a very active community. Furthermore, the developers are very cooperative in terms of suggestions and feature requests. For Scribus, it would be a very good thing to switch completely to cairo. With the current 1.1.6 version of cairo there is no more excuse not to use it as cairo is now available on all major operating systems. It would greatly ease coding, no more #ifdef HAVE_CAIRO in the code. Second, the code would be much more readable, as the cairo library has a very clean API, which is very close to the Postscript syntax.Instead of boring you with more rants, I’ll show you some differences with a few pictures… a picture says a thousand words….

Rendering Gradients
Both images show a gradient starting with 50% black and ending with 50% black (yes, that’s not really a gradient but should produce an even gray rectangle).
On the left side is the libart one, on the right side the cairo one.
Libart Gradient Cairo Gradient Sample

You see that cairo does exactly what you expect for a gradient like this. libart instead seems to have a bug here, and we do not expect that this will be fixed ever.

Another cool feature that has been added to cairo in their current development snapshot is the push_group and pop_group feature. This does give us the possibility to add real professional transparency features to Scribus. In particular it enables us to add “Layer Transparency” and “Group Transparency”. And if the cairo developers would add more blendmodes we can get very close to the features other proprietary page layout applications.

Normal Transparency Layer transparency
Normal transparency,
2 Objects with 50%
Same objects on a layer
with 50% transparency

This layer transparency feature can also be used to implement an “Overprint preview” mode, i already have the needed maths for this special blendmode. BTW: The current CVS version of Scribus contains already a basic preview mode when build with cairo support.

Final Thoughts

I can’t wait to get hands on the final 1.2 version of cairo. When this release is out we should definitely switch…no more libart woes.

Franz