[Cairo] How to start ?

Carl Worth cworth at east.isi.edu
Mon Aug 18 11:23:11 PDT 2003

On Aug 14, =?ISO-8859-2?Q?Mateusz_=A3oskot?= wrote:
 > I'd like to use Xr (now, called Cairo) in my application to
 > draw some map from my data.

Sounds like a fine idea, (as is turns out, the desire to draw some
nice looking maps myself is what started me down the path to develop
what ended up becoming Cairo).

 > This application use libart but it seems that Cairo would do it better
 > (faster).

I won't make any guarantees about performance today. It may not be any
faster, (though I'd be happy to hear that it is).

However, Cairo does have architectural benefits that make it possible
to move operations from software rendering to hardware acceleration.
So, with some more work, in the future it should definitely be much

 > So, I'd like to know if there is any howto or tutorial which
 > could help me to start development with Cairo ?
 > Could you give me any information what I need to start using Cairo ?

First, you'll need to install Cairo. Currently this means downloading,
compiling and installing (in turn) each of the following modules from

	slim libpixregion libic cairo

It would be nice if this step were simpler. Contributions are welcome.

After that, the best place to start is with the cairo-demo module,
(also from CVS).

I've just updated cairo-demo with several very simple examples that I
wrote for the OLS paper. These are in cairo-demo/png. Each example
contains just a few lines of Cairo code to draw to an in-memory image,
then the image is written out to a PNG file.

With that code in hand, the OLS paper should serve as a fine
introduction to Cairo. It's available from the Cairo website:


(NOTE: All of the code examples in that paper use XrNames rather than
cairo_names, but the rest of the information should still be directly
applicable. The code in cairo-demo/png is equivalent to the code in
the paper, but updated to use the current API).

In the future, it would be nice to have an up-to-date Cairo Tutorial
and Cairo Reference Manual. My current plan is to use DocBook for
those. Again, any contributions would be most appreciated.

I hope that helps.

Have fun.


Carl Worth                                        
USC Information Sciences Institute                      cworth at isi.edu

More information about the cairo mailing list