|
Packit |
324a5c |
Cairo - Multi-platform 2D graphics library
|
|
Packit |
324a5c |
http://cairographics.org
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
What is cairo
|
|
Packit |
324a5c |
=============
|
|
Packit |
324a5c |
Cairo is a 2D graphics library with support for multiple output
|
|
Packit |
324a5c |
devices. Currently supported output targets include the X Window
|
|
Packit |
324a5c |
System (via both Xlib and XCB), quartz, win32, and image buffers,
|
|
Packit |
324a5c |
as well as PDF, PostScript, and SVG file output. Experimental backends
|
|
Packit |
324a5c |
include OpenGL, BeOS, OS/2, and DirectFB.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Cairo is designed to produce consistent output on all output media
|
|
Packit |
324a5c |
while taking advantage of display hardware acceleration when available
|
|
Packit |
324a5c |
(for example, through the X Render Extension).
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
The cairo API provides operations similar to the drawing operators of
|
|
Packit |
324a5c |
PostScript and PDF. Operations in cairo include stroking and filling
|
|
Packit |
324a5c |
cubic Bézier splines, transforming and compositing translucent images,
|
|
Packit |
324a5c |
and antialiased text rendering. All drawing operations can be
|
|
Packit |
324a5c |
transformed by any affine transformation (scale, rotation, shear,
|
|
Packit |
324a5c |
etc.).
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Cairo has been designed to let you draw anything you want in a modern
|
|
Packit |
324a5c |
2D graphical user interface. At the same time, the cairo API has been
|
|
Packit |
324a5c |
designed to be as fun and easy to learn as possible. If you're not
|
|
Packit |
324a5c |
having fun while programming with cairo, then we have failed
|
|
Packit |
324a5c |
somewhere---let us know and we'll try to fix it next time around.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Cairo is free software and is available to be redistributed and/or
|
|
Packit |
324a5c |
modified under the terms of either the GNU Lesser General Public
|
|
Packit |
324a5c |
License (LGPL) version 2.1 or the Mozilla Public License (MPL) version
|
|
Packit |
324a5c |
1.1.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Where to get more information about cairo
|
|
Packit |
324a5c |
=========================================
|
|
Packit |
324a5c |
The primary source of information about cairo is:
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
http://cairographics.org/
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
The latest versions of cairo can always be found at:
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
http://cairographics.org/download
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Documentation on using cairo and frequently-asked questions:
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
http://cairographics.org/documentation
|
|
Packit |
324a5c |
http://cairographics.org/FAQ
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Mailing lists for contacting cairo users and developers:
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
http://cairographics.org/lists
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Roadmap and unscheduled things to do, (please feel free to help out):
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
http://cairographics.org/roadmap
|
|
Packit |
324a5c |
http://cairographics.org/todo
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Dependencies
|
|
Packit |
324a5c |
============
|
|
Packit |
324a5c |
The set of libraries needed to compile cairo depends on which backends
|
|
Packit |
324a5c |
are enabled when cairo is configured. So look at the list below to
|
|
Packit |
324a5c |
determine which dependencies are needed for the backends of interest.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
For the surface backends, we have both "supported" and "experimental"
|
|
Packit |
324a5c |
backends. Further, the supported backends can be divided into the
|
|
Packit |
324a5c |
"standard" backends which can be easily built on any platform, and the
|
|
Packit |
324a5c |
"platform" backends which depend on some underlying platform-specific
|
|
Packit |
324a5c |
system, (such as the X Window System or some other window system).
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
As an example, for a standard Linux build similar to what's shipped by
|
|
Packit |
324a5c |
your distro, (with image, png, pdf, PostScript, svg, and xlib surface
|
|
Packit |
324a5c |
backends, and the freetype font backend), the following sample commands
|
|
Packit |
324a5c |
will install necessary dependencies:
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Debian (and similar):
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
apt-get build-dep cairo
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Fedora (and similar):
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
yum install libpng-devel zlib-devel libXrender-devel fontconfig-devel
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Technically you probably don't need pixman from the distribution since
|
|
Packit |
324a5c |
if you're manually compiling Cairo you probably want an updated pixman
|
|
Packit |
324a5c |
as well. However, if you follow the default settings and install pixman
|
|
Packit |
324a5c |
to /usr/local, your Cairo build should properly use it in preference to
|
|
Packit |
324a5c |
the system pixman.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Supported, "standard" surface backends
|
|
Packit |
324a5c |
------------------------------------
|
|
Packit |
324a5c |
image backend (required)
|
|
Packit |
324a5c |
------------------------
|
|
Packit |
324a5c |
pixman >= 0.30.0 http://cairographics.org/releases
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
png support (can be left out if desired, but many
|
|
Packit |
324a5c |
----------- applications expect it to be present)
|
|
Packit |
324a5c |
libpng http://www.libpng.org/pub/png/libpng.html
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
pdf backend
|
|
Packit |
324a5c |
-----------
|
|
Packit |
324a5c |
zlib http://www.gzip.org/zlib
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
postscript backend
|
|
Packit |
324a5c |
------------------
|
|
Packit |
324a5c |
zlib http://www.gzip.org/zlib
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
svg backend
|
|
Packit |
324a5c |
-----------
|
|
Packit |
324a5c |
[none]
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Supported, "platform" surface backends
|
|
Packit |
324a5c |
-----------------------------------
|
|
Packit |
324a5c |
xlib backend
|
|
Packit |
324a5c |
------------
|
|
Packit |
324a5c |
X11 http://freedesktop.org/Software/xlibs
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
xlib-xrender backend
|
|
Packit |
324a5c |
--------------------
|
|
Packit |
324a5c |
Xrender >= 0.6 http://freedesktop.org/Software/xlibs
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
quartz backend
|
|
Packit |
324a5c |
--------------
|
|
Packit |
324a5c |
MacOS X >= 10.5 with Xcode >= 3.0
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
win32 backend
|
|
Packit |
324a5c |
-------------
|
|
Packit |
324a5c |
Microsoft Windows 2000 or newer[*].
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
xcb backend
|
|
Packit |
324a5c |
-----------
|
|
Packit |
324a5c |
XCB http://xcb.freedesktop.org
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Font backends (required to have at least one)
|
|
Packit |
324a5c |
---------------------------------------------
|
|
Packit |
324a5c |
freetype font backend
|
|
Packit |
324a5c |
---------------------
|
|
Packit |
324a5c |
freetype >= 2.1.9 http://freetype.org
|
|
Packit |
324a5c |
fontconfig http://fontconfig.org
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
quartz-font backend
|
|
Packit |
324a5c |
-------------------
|
|
Packit |
324a5c |
MacOS X >= 10.4 with Xcode >= 2.4
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
win32 font backend
|
|
Packit |
324a5c |
------------------
|
|
Packit |
324a5c |
Microsoft Windows 2000 or newer[*].
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
[*] The Win32 backend should work on Windows 2000 and newer
|
|
Packit |
324a5c |
(excluding Windows Me.) Most testing has been done on
|
|
Packit |
324a5c |
Windows XP. While some portions of the code have been
|
|
Packit |
324a5c |
adapted to work on older versions of Windows, considerable
|
|
Packit |
324a5c |
work still needs to be done to get cairo running in those
|
|
Packit |
324a5c |
environments.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Cairo can be compiled on Windows with either the gcc
|
|
Packit |
324a5c |
toolchain (see http://www.mingw.org) or with Microsoft
|
|
Packit |
324a5c |
Visual C++. If the gcc toolchain is used, the standard
|
|
Packit |
324a5c |
build instructions using configure apply, (see INSTALL).
|
|
Packit |
324a5c |
If Visual C++ is desired, GNU make is required and
|
|
Packit |
324a5c |
Makefile.win32 can be used via 'make -f Makefile.win32'.
|
|
Packit |
324a5c |
The compiler, include paths, and library paths must be set
|
|
Packit |
324a5c |
up correctly in the environment.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
MSVC versions earlier than 7.1 are known to miscompile
|
|
Packit |
324a5c |
parts of cairo and pixman, and so should be avoided. MSVC
|
|
Packit |
324a5c |
7.1 or later, including the free Microsoft Visual Studio
|
|
Packit |
324a5c |
Express editions, produce correct code.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Experimental surface backends
|
|
Packit |
324a5c |
-----------------------------
|
|
Packit |
324a5c |
beos backend
|
|
Packit |
324a5c |
------------
|
|
Packit |
324a5c |
No dependencies in itself other than an installed BeOS system, but cairo
|
|
Packit |
324a5c |
requires a font backend. See the freetype dependency list.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
os2 backend
|
|
Packit |
324a5c |
-----------
|
|
Packit |
324a5c |
Cairo should run on any recent version of OS/2 or eComStation, but it
|
|
Packit |
324a5c |
requires a font backend. See the freetype dependency list. Ready to use
|
|
Packit |
324a5c |
packages and developer dependencies are available at Netlabs:
|
|
Packit |
324a5c |
ftp://ftp.netlabs.org/pub/cairo
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
skia backend
|
|
Packit |
324a5c |
------------
|
|
Packit |
324a5c |
Requires the skia library as of June 2014. Since skia is not
|
|
Packit |
324a5c |
API stable, building against newer (or older) versions of skia
|
|
Packit |
324a5c |
will probably fail.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Compiling
|
|
Packit |
324a5c |
=========
|
|
Packit |
324a5c |
See the INSTALL document for build instructions.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
History
|
|
Packit |
324a5c |
=======
|
|
Packit |
324a5c |
Cairo was originally developed by Carl Worth <cworth@cworth.org> and
|
|
Packit |
324a5c |
Keith Packard <keithp@keithp.com>. Many thanks are due to Lyle Ramshaw
|
|
Packit |
324a5c |
without whose patient help our ignorance would be much more apparent.
|
|
Packit |
324a5c |
|
|
Packit |
324a5c |
Since the original development, many more people have contributed to
|
|
Packit |
324a5c |
cairo. See the AUTHORS files for as complete a list as we've been able
|
|
Packit |
324a5c |
to compile so far.
|