GNUstep currently uses Cairo as its primary back-end on non-Windows systems.
GTK+ has not only full support for Cairo, but starting in 2005 with version 2.8, uses Cairo to render the majority of its graphical control elements, and since 3.0 all rendering is done through Cairo.
The Cairo development team maintains up-to-date instructions for rendering surfaces to SDL.
The Cairo drawing model relies on a three layer model. Any drawing process takes place in three steps:
First a mask is created, which includes one or more vector primitives or forms, i.e., circles, squares, TrueType fonts, Bézier curves, etc.
Then source must be defined, which may be a color, a color gradient, a bitmap or some vector graphics, and from the painted parts of this source a die cut is made with the help of the above defined mask.
Finally the result is transferred to the destination or surface, which is provided by the back-end for the output.
This constitutes a fundamentally different approach from Scalable Vector Graphics, which directly specifies the color of shapes with Cascading Style Sheets. Whereas Cairo would create a mask of a shape, then make a source for it, and then transfer them onto the surface, an SVG file would simply specify the shape with a style attribute. That said, the models are not incompatible; many SVG renderers use Cairo for heavy lifting.
Example
Quite complex "Hello world" graphics can be drawn with the help of Cairo with only a few lines of source code:
include
include
int main
Notable usage
Cairo is popular in the open source community for providing cross-platform support for advanced 2D drawing.
GTK+, starting in 2005 with version 2.8, uses Cairo to render the majority of its graphical control elements. Since GTK+ version 3, all the rendering is done using Cairo.
* A program called found in Debian allows for taking vector screenshots of GTK+ 3 applications.
The Mono Project, including Moonlight, has been using Cairo since very early in conception to power the back-ends of its GDI+ and System.Drawing namespaces.
The WebKit framework uses Cairo for all rendering in the GTK+ and EFL ports. Support has also been added for SVG and
The Poppler library uses Cairo to render PDF documents. Cairo enables the drawing of antialiased vector graphics and transparent objects.
The vector graphics application Inkscape uses the Cairo library for its outline mode display, as well as for PDF and PostScript export since release 0.46.
MorphOS 2.5 features a shared library implementation of Cairo, which was available as stand-alone release for earlier MorphOS versions.
AmigaOS 4.1 supports a shared object library of Cairo in its default installation.
FontForge enabled Cairo by default for rendering in mid-October 2008.
R can output plots in PDF, PostScript and SVG formats using Cairo if available.
Gnuplot 4.4 now uses Cairo for rendering PDF and PNG output.
The Konfabulator/Yahoo widget engine uses Cairo for identical output to both Win32 and Quartz on Mac OS/X.
History
and Carl Worth founded the Cairo project for use in the X Window System. It was originally called Xr or Xr/Xc. The name was changed to emphasize the idea of a cross-platform library to access display server, not tied to the X Window System. The name Cairo derives from the original name Xr, interpreted as the Greek letters chi and rho.