Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output.
Cairo is designed to produce consistent output on all output media while taking advantage of display hardware acceleration when available (e.g., through the X Render Extension).
The Cairo API provides operations similar to the drawing operators of PostScript and PDF. Operations in cairo include stroking and filling cubic Bézier splines, transforming and compositing translucent images, and antialiased text rendering. All drawing operations can be transformed by any affine transformation (scale, rotation, shear, etc.).
Cairo is implemented as a library written in the C programming language, but bindings are available for several different programming languages.
Cairo is free software and is available to be redistributed and/or modified under the terms of either the GNU Lesser General Public License (LGPL) version 2.1 or the Mozilla Public License (MPL) version 1.1 at your option.
Documentation for Cairo is an area that could always be greatly improved. Contributions are very welcome!
Here is a collection of pointers to articles that have been written elsewhere about cairo. Many of these articles might provide good inspiration for generating new primary-source documentation. As we improve the primary documentation to cover the same material that is covered below, we can drop items from the following list (or at least move the links to some other page).
Cairo has several different backends, providing support for a variety of output devices.
The backends currently present in cairo include:
image: Targets an in-memory image buffer. The image buffer can be saved to a file or the data can be provided to some other graphics system that does not have a native backend.
cairo-gl: Draws hardware-accelerated graphics with OpenGL. This backend supports GLX, WGL, and EGL. It supersedes the previous glitz based backend.
ps: Generates a PostScript file, suitable for high-quality print output.
pdf: Generates a vectorized PDF file, suitable for high-quality print output.
xlib: Uses the Xlib interface to the X Window System. This backend can target Windows or Pixmaps. The Render extension is used if available but is not required.
xcb: Provides support similar to the xlib backend but uses the XCB interface rather than Xlib.
quartz: Mac OS/X backend.
win32: Windows GDI backend.
svg: To generate SVG files.
beos: BeOS/Zeta backend.
Other backends that are in progress or have been proposed include: