Commit 350fea88 authored by Carl Worth's avatar Carl Worth
Browse files

Remove pixman from SNAPSHOT_0_1_20

parents 5df303fc 2e891bdd
Carl D. Worth <>
Olivier Andrieu <> PNG backend
Dave Beckett <> Track rename of libpixman, build fixes
Andrew Chant <> Adding const where needed
John Ellson <> First font/glyph extents functions
Richard Henderson <> "slim" macros for better shared libraries
James Henstridge <> Build fixes related to freetype
Graydon Hoare <> Support for non-render X server, first real text support
Thomas Hunger <> Initial version of cairo_in_stroke/fill
Jordi Mas <> Bug fix for cairo_show_text
Keith Packard <> Original concept, polygon tessellation, dashing
Christof Petig <> Build fixes related to freetype
Jamey Sharp <> Surface/font backend virtualization, XCB backend
Bill Spitzak <> Build fix to find Xrender.h without xrender.pc
Sasha Vasko <> Build fix to compile without xlib backend
Carl Worth <> Original library, support for paths, images
Richard D. Worth <> Build fixes for cygwin
(please let us know if we have missed anyone)
Splines are not dashed.
The polygon tessellation routine has problems. It appears that the
following paper has the right answers:
......@@ -9,8 +11,45 @@ following paper has the right answers:
Finite Precision Output, Computation Geometry Theory and
Applications, 13(4), 1999.
Stroking a self-intersecting path generates the wrong answer, (in
mostly subtle ways). The fix is to tessellate a giant polygon for the
entire stroke outline rather than incrementally generating trapezoids.
Cairo is crashing Xnest with the following message:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 72 (X_PutImage)
Serial number of failed request: 28
Current serial number in output stream: 29
confirmed on a quite default install of debian unstable.
cairo_scale_font modifies objects that the user expects to not change. For example:
cairo_font_t *font;
cairo_select_font (cr, "fixed", 0, 0);
font = cairo_current_font (cr);
cairo_scale_font (cr, 10);
cairo_show_text (cr, "all is good");
cairo_set_font (cr, font);
cairo_scale_font (cr, 10);
cairo_show_text (cr, "WAY TOO BIG!!);
We could fix this by not storing the scale in the font object. Or
maybe we could just force the size to its default after set_font. Need
to think about this in more detail.
cairo_show_text is not updating the current point by the string's advance values.
Caps are added only to the last subpath in a complex path.
This diff is collapsed.
Snapshot 0.1.20 (2004-04-06 Carl Worth <>)
New pattern API
David Reveman has contributed a new pattern API which enable linear
and radial gradient patterns in addition to the original surface-based
patterns. The significant new top-level functions are:
Any code using the old cairo_set_pattern, (which accepted a
cairo_surface_t rather than a cairo_pattern_t), will need to be
Update to XCB backend
The XCB backend is now enabled by default, (use ./configure
--disable-xcb to turn it off).
Faster clipping
Graydon Hoare has added optimizations that make cairo_clip much faster
when the path is a pixel-aligned, rectangular region.
Bug fixes.
Snapshot 0.1.19 (2004-02-24 Carl Worth <>)
New PNG backend
Olivier Andrieu contributed a new PNG backend. It builds on the
existing image backend to make it easy to render "directly" to a
.png file. The user never needs to deal with the actual image
buffer. The significant new functions are:
The PNG backend is not enabled by default so that by default there is
not a new dependency on libpng. Use ./configure --enable-png to enable
this backend.
Snapshot 0.1.18 (2004-02-17 Carl Worth <>)
Path query functionality
It's now possible to query the current path. The two new functions
Each function accepts a number of callback functions that will be
called for each element in the path (move_to, line_to, curve_to,
close_path). The cairo_current_path_flat function does not accept a
curve_to callback. Instead, all curved portions of the path will be
converted to line segments, (within the current tolerance value). This
can be handy for doing things like text-on-path without having to
manually interpolate bezier splines.
New XCB backend
Jamey Sharp has contributed a second X backend that uses the new, lean
XCB library rather than Xlib. It cannot currently be compiled at the
same time as the Xlib backend. See ./configure --enable-xcb.
Build fixes for cygwin.
Bug fixes.
Snapshot 0.1.17 (2003-12-16 Carl Worth <>)
Better text support
This snapshot provides much better text support by implementing the
following four functions:
The text/glyph_extents functions can be used to determine the bounding
box (and advance) for text as if drawn by show_text/glyphs.
The text/glyph_path objects functions place text shapes on the current
path, where they can be subsequently manipulated. For example,
following these functions with cairo_stroke allows outline text to be
drawn. Calling cairo_clip allows clipping to a text-shaped region.
Combined dependencies
The cairo core now depends only on the libpixman library. This single
library replaces the three previous libraries libic, libpixregion, and
slim. Thanks to Dave Beckett <> for all of
the heavy lifting with this renaming effort.
Conditional compilation of backends
Cairo now allows optional beckends to be disabled at compile time. The
following options may now be passed to the configure script:
Note that the first option is a change from the old --without-x option
which will no longer have any effect.
OS X supported - several byte-order issues resolved
Cairo has now been successfully compiled under OS X. Testing revealed
that there were some byte-order problems in the PostScript backend and
the PNG generation in the demos. These have now been resolved.
Graydon Hoare <> implemented the first real text
support using Freetype/fontconfig, (previous versions of cairo used
Xft and could only draw text when using an X backend).
Graydon Hoare <> added the first real support for
running cairo with a non-render-aware X server.
Jamey Sharp <> virtualized the backend font and
surface interfaces in September, 2003.
Xr is renamed cairo to avoid confusion since it no longer had a strict
dependence on X.
A new image surface backend is added to Xr. Keith Packard
<> wrote the image compositing code in libic that is
used for the image_surface backend. This code was originally written
as the software fallback for the render extension within the X
Carl Worth <> wrote the first lines of Xr, after Keith
Packard <> proposed the plan for a stateful drawing
library in C providing a PostScript-like rendering model.
Cairo - Multi-platform 2D graphics library
......@@ -25,10 +26,7 @@ Dependencies
Cairo currently requires the following supporting libraries:
......@@ -39,19 +37,19 @@ There's not much documentation yet apart from the cairo.h header
file. We'll be correcting that shortly.
In the meantime, the cairo-demo module in CVS provides a few example
programs using Cairo. These may be helpful to a programmer just
beginning with Cairo. Also, familiarity with the PostScript imaging
model will help in understanding Cairo.
programs using cairo. These may be helpful to a programmer just
beginning with cairo. Also, familiarity with the PostScript imaging
model will help in understanding cairo.
Cairo was developed by Carl Worth <> and Keith Packard
<>. Many thanks are due to Lyle Ramshaw without whose
patient help our ignorance would be much more apparent.
Cairo was originally developed by Carl Worth <> and
Keith Packard <>. Many thanks are due to Lyle Ramshaw
without whose patient help our ignorance would be much more apparent.
Mailing List
If you have trouble with Cairo or you have some ideas for how it could be
If you have trouble with cairo or you have some ideas for how it could be
improved, please feel free to send a message to
Cairo is still under active development and all discussion happens on
So far, cairo hasn't reached an initial release. But we can still form
good habits now by practicing the release process with the current
10 easy steps to creating a new cairo snapshot
1) Commit code with a significant new feature or backwards
Either of these events triggers the need for a new snapshot.
Users of cairo snapshots need to be able to specify snapshot
version numbers in order to get access to a specific set of
2) Verify that the code passes "make distcheck"
Running "make distcheck" should result in no warnings or
errors and end with a message of the form:
cairo-X.Y.Z.tar.gz is ready for distribution
(But the tar file isn't actually ready yet, as we still have
some more steps to follow).
3) Fill out an entry in the NEWS file
Sift through the information in ChangeLog since the last
snapshot. Summarize major changes briefly in a style similar
to other entries in NEWS.
4) Increment CAIRO_VERSION in
Right now, in its pre-release form, we are incrementing
CAIRO_VERSION for each snapshot but we are not changing the
libtool shared library version information. Until now, we've
only incremented the sub-minor version. We'll invent rules for
incrementing major and minor numbers when the time is right.
5) Commit the changes to NEWS and
Don't forget to fill out the ChangeLog just like with any
other commit. It's especially important to mention the new
version number in the ChangeLog.
6) Run "make distcheck" to generate the final tar file with the
correct version number.
7) Copy the resulting tar file to the cairo snapshots distribution
scp cairo-X.Y.Z-tar.gz
8) Tag the entire source tree with a tag of the form SNAPSHOT_X_Y_Z:
cvs tag SNAPSHOT_X_Y_Z
9) Send a message to to announce the
new snapshot.
This is as simple as cutting and pasting the new section of
the NEWS file into the body of the message.
10) Sit back and relax in confidence, (or brace yourself for a flood
of new bug reports). It's up to you!
* Clean up the API in preparation for freezing and release.
* Implement a PDF backend.
* Make a more interesting PS backend, (other than the current
"giant-image for every page" approach).
* Figure out what to do with DPI for image/png backends.
* Change stroke code to go through one giant polygon. This will fix
problems with stroking self-intersecting paths.
......@@ -7,14 +16,39 @@ is done).
* Fix the intersection problem, (see reference to Hobby's paper
mentioned in cairo_traps.c).
* Implement support for programmatic patterns.
* Implement cairo_text_extents, cairo_glyph_extents, cairo_text_path,
cairo_glyph_path, and cairo_stroke_path, cairo_arc_to.
* Investigate what needs to be done so that old X servers aren't
swamped with image transport. This may involve adding one or more of
the following functions:
* Add a new cairo_text_glyphs function (a sort of bridge between the
toy and the real text API):
> void
> cairo_text_glyphs (cairo_t *cr, const unsigned char *utf8,
> cairo_glyph_t *glyphs, int *num_glyphs);
> with num_glyphs as an input-output parameter. The behavior of this
> function would be such that calling:
> cairo_text_glyphs (cr, string, glyphs, &num_glyphs);
> cairo_show_glyphs (cr, glyphs, num_glyphs);
> would be equivalent too:
> cairo_show_text (cr, string);
> as long as the original size of glyphs/num_glyphs was large
> enough.
* Implement dashing for cairo_curve_to.
* Implement support for programmatic patterns, (ie. figure out how to
do gradients the Right Way).
* Implement cairo_arc_to.
* Fix support for old X servers so that it is not swamped with image
transport. The key idea is to assume that nothing external to cairo
will be drawing to the same drawable after it is handed to
cairo. Beyond that, we might actually provide support for cooperating
with external entities by adding one or more of the following
......@@ -32,108 +66,108 @@ A comparison with PostScript
Here's a list of several classes of PostScript operators indicating
which operators have rough equivalents in Cairo and which do not. In
general, the name of a Cairo function corresponding to a PostScript
which operators have rough equivalents in cairo and which do not. In
general, the name of a cairo function corresponding to a PostScript
operator can be obtained by inserting a '_' between each word and
prefixing it with "cairo_". For example, "cairo_move_to" corresponds
to the PostScript "moveto".
In cases where the name of the Cairo function deviates from this
convention, or when the behavior of the Cairo function is
In cases where the name of the cairo function deviates from this
convention, or when the behavior of the cairo function is
significantly different, the change is noted in parentheses below.
This list is not exhaustive, (there are definitely some minor (major?)
semantic deviations that are not noted below). Also, this list is
almost certainly out of date with respect to the current Cairo
almost certainly out of date with respect to the current cairo
implementation. Caveat lector.
Oerators that are not yet in Cairo, but probably should be: arcto,
Operators that are not yet in cairo, but probably should be: arcto,
strokepath, rectclip?, clipsave/restore?, setstrokeadjust?,
currentdash, grestoreall?, initgraphics?, currentgstate?, setgstate?,
erasepage?, setsmoothness?
Painting operators
in Cairo: stroke, fill, eofill (set_fill_rule/fill), image
in cairo: stroke, fill, eofill (set_fill_rule/fill), image
not in Cairo: erasepage, rectstroke, rectfill, shfill, colorimage,
not in cairo: erasepage, rectstroke, rectfill, shfill, colorimage,
Path construction operators
in Cairo: arc, arcn (arc_negative), newpath, moveto, rmoveto
in cairo: arc, arcn (arc_negative), newpath, moveto, rmoveto
(rel_move_to), lineto, rlineto (rel_line_to), curveto, rcurveto
(rel_curve_to), closepath, currentpoint, charpath (text_path)
(rel_curve_to), closepath, currentpoint, charpath (text_path),
pathforall (current_path), flattenpath (current_path_flat)
not in Cairo: arct, arcto, flattenpath, reversepath, strokepath,
clippath, pathbbox, pathforall
not in cairo: arct, arcto, reversepath, strokepath, clippath, pathbbox
in Cairo: clip, eoclip (set_fill_rule/clip)
in cairo: clip, eoclip (set_fill_rule/clip)
not in Cairo: initclip, rectclip, clipsave, cliprestore
not in cairo: initclip, rectclip, clipsave, cliprestore
Graphics state operators
in Cairo: setlinewidth, currentlinewidth, setlinecap, currentlinecap,
in cairo: setlinewidth, currentlinewidth, setlinecap, currentlinecap,
setlinejoin, currentlinejoin, setmiterlimit, currentmiterlimit,
not in Cairo: setstrokeadjust, currentstrokeadjust, currentdash
not in cairo: setstrokeadjust, currentstrokeadjust, currentdash
Color specification operators
in Cairo: setrgbcolor, currentcolor
in cairo: setrgbcolor, currentcolor
not in Cairo: setcolor, setgray, currentgray, currentrgbcolor,
not in cairo: setcolor, setgray, currentgray, currentrgbcolor,
sethsbcolor, currenthsbcolor, setcmykcolor, currentcmykcolor,
setcolorspace, currentcolorspace
Form and pattern operators
in Cairo: setpattern, makepattern (lock_pattern)
in cairo: setpattern, makepattern (lock_pattern)
not in Cairo: execform
not in cairo: execform
Whole-state manipulation
in Cairo: gsave (save), grestore (restore)
in cairo: gsave (save), grestore (restore)
not in Cairo: grestoreall, initgraphics, gstate, currentgstate,
not in cairo: grestoreall, initgraphics, gstate, currentgstate,
Coordinate system and matrix operators
in Cairo: identmatrix (identity_matrix), initmatrix (default_matrix),
in cairo: identmatrix (identity_matrix), initmatrix (default_matrix),
setmatrix, translate, scale, rotate, concatmatrix, currentmatrix,
transform (transform_point), dtransform (transform_distance)
not in Cairo: matrix, defaultmatrix, concat, itransform, idtransform,
not in cairo: matrix, defaultmatrix, concat, itransform, idtransform,
Insideness testing
in Cairo: infill, instroke, ineofill (set_fill_rule/in_fill)
in cairo: infill, instroke, ineofill (set_fill_rule/in_fill)
not in Cairo: inufill, inustroke, inueofill
not in cairo: inufill, inustroke, inueofill
Device setup
in Cairo: showpage, copypage
in cairo: showpage, copypage
not in Cairo: setpagedevice, currentpagedevice, nulldevice
not in cairo: setpagedevice, currentpagedevice, nulldevice
Glyph and font operators
in Cairo: currentfont, definefont (font_create_for_ft_face),
in cairo: currentfont, definefont (font_create_for_ft_face),
undefine_font (font_destroy), findfont (font_create), makefont
(transform_font), setfont, scalefont, selectfont, show (show_text),
stringwidth (x/y in text_extents), xyshow (glyph_show -- but ignoring
current_point and using absolute positions)
not in Cairo, (and likely not needed): composefont, rootfont, ashow,
not in cairo, (and likely not needed): composefont, rootfont, ashow,
widthshow, awidthshow, xshow, xyshow, yshow, glyphshow, cshow, kshow,
FontDirectory, GlobalFontDirectory, StandardEncoding,
ISOLatin1Encoding, findencoding, setcachedevice, setcachedevice2,
......@@ -141,16 +175,16 @@ setcharwidth
Graphics state operators (device-dependent)
in Cairo: setflat (set_tolerance), currentflat (current_tolerance)
in cairo: setflat (set_tolerance), currentflat (current_tolerance)
not in Cairo: sethalftone, currenthalftone, setscreen, currentscreen,
not in cairo: sethalftone, currenthalftone, setscreen, currentscreen,
setcolorscreen, currentcolorscreen, settransfer, currenttransfer,
setcolortransfer, currentcolortransfer, setblackgeneration,
currentblackgeneration, setundercolorremoval,
currentundercolorremoval, setcolorrendering, currentcolorrendering,
setoverprint, currentoverprint, setsmoothness, currentsmoothness
PostScript operators never to be in Cairo
PostScript operators never to be in cairo
Operator Stack Manipulation Operators, Arithmetic and Math Operators,
Array Operators, Packed Array Operators, Dictionary Operators, String
......@@ -7,7 +7,7 @@ Name: cairo
Description: Multi-platform 2D graphics library
Version: @VERSION@
Requires: fontconfig libic slim
Libs: -L${libdir} -lcairo -lm -lz @FREETYPE_LIBS@
Requires: fontconfig libpixman @XRENDER_REQUIRES@ @PNG_REQUIRES@
Libs: -L${libdir} -lcairo -lm @XRENDER_LIBS@ @PS_LIBS@ @FREETYPE_LIBS@
Cflags: -I${includedir} @FREETYPE_CFLAGS@
......@@ -3,7 +3,7 @@ AC_INIT(src/cairo.h)
dnl ===========================================================================
# Package version number, (as distinct from shared library version)
# libtool shared library version
......@@ -36,25 +36,94 @@ AC_STDC_HEADERS
dnl ===========================================================================
[ --disable-xlib Disable cairo's Xlib backend],
[use_xlib=$enableval], [use_xlib=yes])
if test "x$have_x" != "xyes"; then
if test "x$use_xlib" != "xyes"; then
dnl Check for Xrender header files if the Xrender package is not installed:
XRENDER_LIBS="$X_LIBS -lXrender -lXext -lX11 $X_EXTRA_LIBS"],[
AC_MSG_ERROR(Xrender not found perhaps use --disable-xlib?)])])
dnl This is needed for conditional compilation of xlib code in :
dnl XXX: I'd prefer to have only one test of $have_x, would that be easy?
dnl ===========================================================================
[ --disable-xcb Disable cairo's XCB backend],
[use_xcb=$enableval], [use_xcb=no])
if test "x$use_xcb" != "xyes"; then
dnl ===========================================================================
[ --disable-ps Disable cairo's PostScript backend],
[use_ps=$enableval], [use_ps=yes])
if test "x$use_ps" != "xyes"; then
dnl ===========================================================================
[ --enable-png Enable cairo's PNG backend],
[use_png=$enableval], [use_png=no])
if test "x$use_png" != "xyes"; then