posted by Eugenia Loli on Fri 4th Feb 2005 06:38 UTC
IconGTK+ is now the first major toolkit to depend on the Cairo vector graphics library which is designed to provide high-quality display and print output. Cairo will add 3 more dependencies to GTK: itself, glitz and libpixman (after atk, Pango, Glib, FontConfig and the standard X libs). The addition is now part of the HEAD of GTK's CVS. Some might argue that Cairo should have been integrated to X instead (as an extension or as part of the core), so all toolkits would get the benefits, transparently (if enough engineering was to go into this). I sent an email to selected GTK+ developers last May about this, and here is what Owen Taylor, GTK's project leader, replied: Update: GTK+ 2.6.2 released.

[...]
The work that Carl [Worth] has been doing at creating a really high quality vector graphics library is only a portion of the solution, yes, but it is a very important part. By adopting this into GTK+, Qt, Mozilla, OpenOffice, etc, we'll share more code and everybody will render better.

In some cases this adoption will be under the surface and the user will just see better rendering. In other cases (and we plan to do this in GTK+) the Cairo programming interface will be exposed directly, so that we don't just get more uniform rendering, we'll also have a more uniform programmer interface.

You ask why Cairo can't just be integrated into X at a low level and make everything look good. This doesn't work because Cairo contains all sorts of concepts that just aren't in the X currently. While the X API can say "Draw a rectangle", Cairo can say "Draw a Bezier curve with 50 percent alpha and a radial gradient". New and very different API is required to take advantage of these capabilities.

You ask why we need all these different backends, all these dependencies, all these different modules. While they may seem to make things worse for someone trying to get stuff built and playing around with it they actually will make a big difference getting this stuff deployed quickly:

- - Because Cairo supports multiple backends, I can use Cairo in GTK+ which needs to work on Windows and other platforms as well.

- - Because Cairo can be used with an unmodified X server, I can use Cairo in GTK+ as soon as Cairo is released, instead of waiting for all our users to get a new X server.

- - Because development is being done in a modular fashion, it can proceed in a much faster way; a Cairo release can be made without waiting for an entire new release of the X window system.

Yes, there is some temporary pain (which build scripts like jhbuild [gnome-building script] can make a lot easier), but in the long run, these packages will get incorporated into operating system distributions and users won't have to worry about the number of individual packages someone building from source would have to download.

Regards,
Owen

e p (0)    72 Comment(s)

Technology White Papers

See More