[cairo-commit] 6 commits - cairo-version.h doc/public NEWS README.win32 src/cairo.c src/cairo-gstate.c src/cairo.h src/cairoint.h test/Makefile.am

Carl Worth cworth at kemper.freedesktop.org
Thu Sep 25 16:06:51 PDT 2008


 NEWS                            |  170 +++++++++++++++++++++++++++++++++++++++-
 README.win32                    |   10 --
 cairo-version.h                 |    4 
 doc/public/cairo-sections.txt   |    1 
 doc/public/tmpl/cairo-text.sgml |    9 --
 src/cairo-gstate.c              |    8 -
 src/cairo.c                     |   36 +-------
 src/cairo.h                     |    3 
 src/cairoint.h                  |    4 
 test/Makefile.am                |    9 ++
 10 files changed, 183 insertions(+), 71 deletions(-)

New commits:
commit dd7e2461ce748403e121a5de5e4e4c8890e39236
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Sep 25 16:06:19 2008 -0700

    Increment cairo version to 1.8.1 after the 1.8.0 release.

diff --git a/cairo-version.h b/cairo-version.h
index c3674c4..873f653 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
 
 #define CAIRO_VERSION_MAJOR 1
 #define CAIRO_VERSION_MINOR 8
-#define CAIRO_VERSION_MICRO 0
+#define CAIRO_VERSION_MICRO 1
 
 #endif
commit 6b3aa86b1c5b2fce3e56b43142c4ec2664a37032
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Sep 25 15:48:14 2008 -0700

    Increment cairo version to 1.8.0.

diff --git a/cairo-version.h b/cairo-version.h
index 0fd67a7..c3674c4 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -2,7 +2,7 @@
 #define CAIRO_VERSION_H
 
 #define CAIRO_VERSION_MAJOR 1
-#define CAIRO_VERSION_MINOR 7
-#define CAIRO_VERSION_MICRO 7
+#define CAIRO_VERSION_MINOR 8
+#define CAIRO_VERSION_MICRO 0
 
 #endif
commit e1560eceab109a051926d04d9aa578c3c991fe88
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Sep 25 15:27:08 2008 -0700

    NEWS: Add notes for the 1.8.0 release.
    
    Heavily cribbed from 1.7.x snapshot NEWS of course.

diff --git a/NEWS b/NEWS
index 12eb708..22c0774 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,165 @@
+Snapshot 1.8.0 (2008-09-25 Carl Worth <cworth at cworth.org>)
+==========================================================
+The cairo community is happy (and relieved) to announce the 1.8.0
+release of the cairo graphics library. This is a major update to
+cairo, with new features and enhanced functionality which maintains
+compatibility for applications written using any previous major cairo
+release, (1.6, 1.4, 1.2, or 1.0). We recommend that anybody using a
+previous version of cairo upgrade to cairo 1.8.0.
+
+The dominant theme of this release is improvements to cairo's ability
+to handle text. The highlights include a new "user fonts" feature as
+well as a new cairo_show_text_glyphs API which allows glyphs to be
+embedded in PDF output along with their original text, (for searching,
+selection, and copy-and-paste). Another major feature is a revamp of
+cairo's build system making it much easier to build cairo on various
+platforms.
+
+See below for more details.
+
+User fonts
+----------
+This new API allows the user of cairo API to provide drawings for
+glyphs in a font. A common use for this is implementing fonts in
+non-standard formats, like SVG fonts and Flash fonts. This API can
+also be used by applications to provide custom glyph shapes for fonts
+while still getting access to cairo's glyph caches. See
+test/user-font.c and test/user-font-proxy.c for usage examples. This
+is based on early work by Kristian Høgsberg. Thanks Kristian!
+
+This new API consists of the following functions (and corresponding
+_get functions):
+
+	cairo_user_font_face_create
+
+	cairo_user_font_face_set_init_func
+	cairo_user_font_face_set_render_glyph_func
+	cairo_user_font_face_set_text_to_glyphs_func
+	cairo_user_font_face_set_unicode_to_glyph_func
+
+An additional, new API is
+
+	cairo_scaled_font_text_to_glyphs
+
+We were previously reluctant to provide this function as
+text-to-glyphs support in cairo was limited to "toy" font
+functionality, not really interesting for real-world text
+processing. However, with user fonts landing, this API is needed to
+expose full access to how user fonts convert text to glyphs. This is
+expected to be used by text toolkits like Pango, as well as "proxy"
+user-font implementations.
+
+cairo_show_text_glyphs
+----------------------
+This new API allows the caller of cairo to provide text data
+corresponding to glyphs being drawn. The PDF backend implements this
+new API so that complex text can be copied out of cairo's PDF output
+correctly and reliably, (assuming the user of cairo calls
+cairo_show_text_glyphs). The cairo_show_text_glyphs API is definitely
+the most daunting API to debut in cairo. It is anticipated that pango
+(and similar high-level text libraries) will be the primary users of
+this API. In fact, pango 1.22 already uses cairo_show_text_glyphs.
+Behdad was the architect and implementor of this effort. Thanks,
+Behdad!
+
+The cairo_show_text_glyphs API includes the following new functions:
+
+	cairo_show_text_glyphs
+
+	cairo_glyph_allocate
+	cairo_glyph_free
+
+	cairo_text_cluster_allocate
+	cairo_text_cluster_free
+
+	cairo_surface_has_show_text_glyphs
+
+Build system revamp
+-------------------
+The primary goal of the revamp is to make the build system less
+fragile, (particularly for non-Linux platforms). For example, now
+people building on win32 will no longer need to maintain a
+platform-specific list of files to be built. See the new README.win32
+for details. Also, the .so file will now be installed with a different
+naming scheme, (for example, 1.7.6 will install with a .10800
+suffix). Many thanks to Behdad and his small army of helpers!
+
+Assorted API additions
+----------------------
+For API completeness, several missing "getter" functions were added:
+
+	cairo_scaled_font_get_scale_matrix
+
+	cairo_surface_get_fallback_resolution
+
+	cairo_toy_font_face_create
+	cairo_toy_font_face_get_family
+	cairo_toy_font_face_get_slant
+	cairo_toy_font_face_get_weight
+
+The new cairo_toy_font_face functions provide access to functionality
+and settings provided by cairo_select_font_face(). Thanks Behdad!
+
+cairo-ps/cairo-pdf: More efficient output
+-----------------------------------------
+Adrian Johnson has been busy fixing all kinds of bugs in PS and PDF
+backends, as well making them generate much more compact output by
+avoiding things like re-emitting the color or linestyle on every
+drawing operation. Thanks Adrian!
+
+cairo-xlib: dithering
+---------------------
+Dithering: Cairo now does simple dithering when rendering to legacy X
+servers. This is most visible with 8-bit visuals. Thanks Behdad!
+
+cairo-xlib: Avoid rendering glyphs out of surface bounds
+--------------------------------------------------------
+This seemingly harmless optimization exposed a bug in OpenOffice.org 3
+versions where OO.o was passing bogus surface extents to cairo,
+resulting in no text rendered in OO.o. Please contact your
+distribution's OO.o maintainers if you see this bug and point them to
+the following URL:
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=16209
+
+cairo-xlib: Improved performance with X server without Render
+-------------------------------------------------------------
+Cairo now performs better on remote X servers that lack the Render
+extension by being smarter about using X core protocol facilities
+instead of falling back to doing all rendering on the client side.
+
+cairo-ft: respecting FC_FT_FACE
+-------------------------------
+Previously it was impossible to instruct cairo to do emboldening on a
+font face object created from an FT_Face. Cairo now respects and uses
+the FC_FT_FACE fontconfig pattern element, so emboldening can be
+achieved by using cairo_ft_font_face_create_for_pattern() and a
+carefully crafted pattern using FC_FT_FACE and FC_EMBOLDEN. Thanks
+Behdad!
+
+cairo-directfb: backend improvements
+------------------------------------
+The directfb backend, though still unsupported, has seen a good deal
+of improvements. Thanks Vlad!
+
+Bug fixing and optimizations
+----------------------------
+xlib: Faster bookkeeping (Karl Tomlinson)
+	https://bugzilla.mozilla.org/show_bug.cgi?id=453199#c5
+
+PS: Fix gradients with non-constant alpha (Chris Wilson)
+
+Fix deadlock in user-font code (Richard Hughes and Behdad Esfahbod)
+	http://bugs.freedesktop.org/show_bug.cgi?id=16819
+
+Countless other bugs have been fixed and optimizations made, many of
+them thanks to Chris Wilson. Thanks Chris and others!
+
+Note also that the code that had been in cairo 1.7.x calling into
+freetype's optional lcd_filter function was removed from cairo before
+the 1.8.0 release. We do expect this code to come back in some form in
+the future.
+
 Snapshot 1.7.6 (2008-09-17 Carl Worth <cworth at cworth.org>)
 ==========================================================
 The cairo community is happy to announce the 1.7.6 snapshot of the
@@ -43,7 +205,7 @@ series:
 	convenience function on the cairo_t is not obviously
 	necessary. An application can easily call:
 
-	cairo_surface_has_show_glyphs (cairo_get_target (cr));
+	cairo_surface_has_show_glyphs (cairo_get_target (Sr));
 
 	as needed.
 
@@ -85,12 +247,12 @@ cairo-user-font-private.h in the distribution.
 Snapshot 1.7.2 (2008-08-11 Behdad Esfahbod <behdad at behdad.org>)
 ===============================================================
 The cairo community is finally ready to announce availability of the 1.7.2
-snapshot of the cairo graphics library.  This is embarrissingly the first
+snapshot of the cairo graphics library.  This is embarrassingly the first
 snapshot in the 1.7 unstable series of cairo, leading to the eventual release
 of cairo 1.8, currently planned for late September.
 
 This snapshot comes four months after the 1.6.4 release.  We have done a
-really bad job on getting development stapshots out this cycle, but
+really bad job on getting development snapshots out this cycle, but
 hopefully all the API changes for 1.8 are now finished and the remaining
 weeks will be spent on bug-fixing.  There is more than 400 commits worth
 of changes in this snapshot, and those can use some testing.  Read on!
@@ -5399,4 +5561,4 @@ Carl Worth <cworth at isi.edu> wrote the first lines of Xr, after Keith
 Packard <keithp at keithp.com> proposed the plan for a stateful drawing
 library in C providing a PostScript-like rendering model.
 
- LocalWords:  mutex BeOS extraordinaire
+ LocalWords:  mutex BeOS extraordinaire distro's URL lcd bool tarball
commit 9a210ab228a3afa9d19b699b772893ea3303f38f
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Sep 25 15:53:44 2008 -0700

    Add missing reference images REFERENCE_IMAGES list.
    
    The standard ritual before being able to release.

diff --git a/test/Makefile.am b/test/Makefile.am
index f934677..a0247fe 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -390,6 +390,8 @@ REFERENCE_IMAGES = \
 	degenerate-path-quartz-ref.png	\
 	degenerate-path-quartz-rgb24-ref.png	\
 	device-offset-fractional-ref.png	\
+	device-offset-fractional-pdf-ref.png	\
+	device-offset-fractional-ps-ref.png	\
 	device-offset-positive-ref.png	\
 	device-offset-positive-rgb24-ref.png	\
 	device-offset-ref.png	\
@@ -404,6 +406,8 @@ REFERENCE_IMAGES = \
 	extend-repeat-similar-ref.png	\
 	fill-alpha-ref.png	\
 	fill-alpha-pattern-ref.png	\
+	fill-alpha-pattern-pdf-argb32-ref.png	\
+	fill-alpha-pattern-pdf-rgb24-ref.png	\
 	fill-alpha-pattern-ps-ref.png	\
 	fill-and-stroke-alpha-add-quartz-ref.png	\
 	fill-and-stroke-alpha-add-ref.png	\
@@ -467,6 +471,8 @@ REFERENCE_IMAGES = \
 	gradient-alpha-ps-rgb24-ref.png	\
 	gradient-alpha-ref.png	\
 	gradient-alpha-rgb24-ref.png	\
+	gradient-constant-alpha-pdf-argb32-ref.png	\
+	gradient-constant-alpha-pdf-rgb24-ref.png	\
 	gradient-constant-alpha-ps-ref.png		\
 	gradient-constant-alpha-ps-rgb24-ref.png	\
 	gradient-constant-alpha-ref.png	\
@@ -526,6 +532,8 @@ REFERENCE_IMAGES = \
 	mask-svg-argb32-ref.png	\
 	mask-transformed-image-ref.png	\
 	mask-transformed-similar-ref.png	\
+	mask-transformed-similar-pdf-ref.png	\
+	mask-transformed-similar-svg-ref.png	\
 	meta-surface-pattern-ref.png		\
 	meta-surface-pattern-rgb24-ref.png	\
 	meta-surface-pattern-pdf-ref.png	\
@@ -753,6 +761,7 @@ REFERENCE_IMAGES = \
 	user-font-proxy-svg-ref.png	\
 	user-font-rescale-ref.png	\
 	user-font-rescale-ps-ref.png	\
+	user-font-rescale-svg-ref.png	\
 	unbounded-operator-quartz-ref.png	\
 	unbounded-operator-quartz-rgb24-ref.png	\
 	xlib-expose-event-ref.png \
commit 1d896aa9d89ff79239b3754da617201968072ea1
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Sep 25 15:40:28 2008 -0700

    Actually remove cairo_has_show_text_glyphs
    
    The release notes for 1.7.6 say that we had dropped this
    function, but apparently we had only planned to do that
    and didn't actually get around to it until now.
    
    Thanks to the RELEASING insctructions which gave a diff
    command that pointed out this problem.

diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
index fba1683..d3b7319 100644
--- a/doc/public/cairo-sections.txt
+++ b/doc/public/cairo-sections.txt
@@ -408,7 +408,6 @@ cairo_set_scaled_font
 cairo_get_scaled_font
 cairo_show_text
 cairo_show_glyphs
-cairo_has_show_text_glyphs
 cairo_show_text_glyphs
 cairo_font_extents
 cairo_text_extents
diff --git a/doc/public/tmpl/cairo-text.sgml b/doc/public/tmpl/cairo-text.sgml
index 64c63da..24e264b 100644
--- a/doc/public/tmpl/cairo-text.sgml
+++ b/doc/public/tmpl/cairo-text.sgml
@@ -197,15 +197,6 @@ Cairo has two sets of text rendering capabilities:
 @num_glyphs: 
 
 
-<!-- ##### FUNCTION cairo_has_show_text_glyphs ##### -->
-<para>
-
-</para>
-
- at cr: 
- at Returns: 
-
-
 <!-- ##### FUNCTION cairo_show_text_glyphs ##### -->
 <para>
 
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index b4fb5a4..1034d42 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -1536,12 +1536,6 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
     return cairo_scaled_font_status (gstate->scaled_font);
 }
 
-cairo_bool_t
-_cairo_gstate_has_show_text_glyphs (cairo_gstate_t *gstate)
-{
-    return cairo_surface_has_show_text_glyphs (gstate->target);
-}
-
 cairo_status_t
 _cairo_gstate_show_text_glyphs (cairo_gstate_t		   *gstate,
 				const char		   *utf8,
@@ -1600,7 +1594,7 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t		   *gstate,
      * fast rasterizer in cairo, we may want to readjust this.
      *
      * Needless to say, do this only if show_text_glyphs is not available. */
-    if (_cairo_gstate_has_show_text_glyphs (gstate) ||
+    if (cairo_surface_has_show_text_glyphs (gstate->target) ||
 	_cairo_scaled_font_get_max_scale (gstate->scaled_font) <= 10240) {
 	status = _cairo_surface_show_text_glyphs (gstate->target,
 						  gstate->op,
diff --git a/src/cairo.c b/src/cairo.c
index cdfefa0..9bb2b66 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -3079,6 +3079,7 @@ cairo_show_text (cairo_t *cr, const char *utf8)
     int utf8_len, num_glyphs, num_clusters;
     cairo_text_cluster_flags_t cluster_flags;
     double x, y;
+    cairo_bool_t has_show_text_glyphs;
 
     if (cr->status)
 	return;
@@ -3090,11 +3091,14 @@ cairo_show_text (cairo_t *cr, const char *utf8)
 
     utf8_len = strlen (utf8);
 
+    has_show_text_glyphs =
+	cairo_surface_has_show_text_glyphs (cairo_get_target (cr));
+
     status = _cairo_gstate_text_to_glyphs (cr->gstate,
 					   x, y,
 					   utf8, utf8_len,
 					   &glyphs, &num_glyphs,
-					   cairo_has_show_text_glyphs (cr) ? &clusters : NULL, &num_clusters,
+					   has_show_text_glyphs ? &clusters : NULL, &num_clusters,
 					   &cluster_flags);
     if (status)
 	goto BAIL;
@@ -3170,36 +3174,6 @@ cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
 }
 
 /**
- * cairo_has_show_text_glyphs:
- * @cr: a cairo context
- *
- * Returns whether the target surface of a cairo context supports
- * sophisticated cairo_show_text_glyphs() operations.  That is,
- * whether it actually uses the provided text and cluster data
- * to a cairo_show_text_glyphs() call.
- *
- * Note: Even if this function returns %FALSE, a
- * cairo_show_text_glyphs() operation will still succeed.  It just will
- * act like a cairo_show_glyphs() operation.  Users can use this
- * function to avoid computing UTF-8 text and cluster mapping if the
- * target surface does not use it.
- *
- * This is a convenience function that simply calls
- * cairo_surface_has_show_text_glyphs() on @cr's target.
- *
- * Return value: %TRUE if the target surface of @cr supports
- *               cairo_show_text_glyphs(), %FALSE otherwise
- *
- * Since: 1.8
- **/
-cairo_bool_t
-cairo_has_show_text_glyphs (cairo_t			   *cr)
-{
-    return _cairo_gstate_has_show_text_glyphs (cr->gstate);
-}
-slim_hidden_def (cairo_has_show_text_glyphs);
-
-/**
  * cairo_show_text_glyphs:
  * @cr: a cairo context
  * @utf8: a string of text encoded in UTF-8
diff --git a/src/cairo.h b/src/cairo.h
index 8abf359..8b5044a 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -1209,9 +1209,6 @@ cairo_show_text (cairo_t *cr, const char *utf8);
 cairo_public void
 cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs);
 
-cairo_public cairo_bool_t
-cairo_has_show_text_glyphs (cairo_t *cr);
-
 cairo_public void
 cairo_show_text_glyphs (cairo_t			   *cr,
 			const char		   *utf8,
diff --git a/src/cairoint.h b/src/cairoint.h
index 85aa47c..51d4674 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1238,9 +1238,6 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
 			     int num_glyphs,
 			     cairo_text_extents_t *extents);
 
-cairo_private cairo_bool_t
-_cairo_gstate_has_show_text_glyphs (cairo_gstate_t *gstate);
-
 cairo_private cairo_status_t
 _cairo_gstate_show_text_glyphs (cairo_gstate_t		   *gstate,
 				const char		   *utf8,
@@ -2389,7 +2386,6 @@ slim_hidden_proto (cairo_get_current_point);
 slim_hidden_proto (cairo_get_matrix);
 slim_hidden_proto (cairo_get_target);
 slim_hidden_proto (cairo_get_tolerance);
-slim_hidden_proto (cairo_has_show_text_glyphs);
 slim_hidden_proto (cairo_glyph_allocate);
 slim_hidden_proto (cairo_glyph_free);
 slim_hidden_proto (cairo_image_surface_create);
commit 483ab915c0fd891dffc0390ba4a1c96c1f06e30f
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Sep 25 15:25:54 2008 -0700

    Remove excessive whitespace.
    
    It looks sloppy (and wastes space) to have two blank lines
    where one will do.

diff --git a/README.win32 b/README.win32
index 8507fdd..cb3f3b6 100644
--- a/README.win32
+++ b/README.win32
@@ -1,6 +1,5 @@
 Building Cairo on Windows
 =========================
-
 There are two primary ways to build Cairo on Windows.  You can use a
 UN*X-like setup, such as Cygwin, with the conventional configure
 script shipped with Cairo releases.  In this configuration, you will
@@ -12,20 +11,16 @@ The second way is to use a GNU-compatible make, but build using
 Microsoft's Visual C++ compiler to produce native libraries.  This is
 the setup this README is written for.
 
-
 Tools required
 ==============
-
 You will need GNU make, version 3.80 or later.  Earlier versions or
 other modern make implementations may work, but are not guaranteed to.
 
 You will also need Microsoft Visual C++.  Version 7 has been most
 heavily tested, but other versions are likely to work fine.
 
-
 Libraries required
 ==================
-
 Cairo requires a compatible version of the pixman library.  Full build
 instructions are beyond the scope of this document; however, using the
 same tools, it should be possible to build pixman simply by entering
@@ -33,13 +28,10 @@ the pixman/src directory and typing:
 
     make -f Makefile.win32 CFG=release
 
-
 Depending on your feature set, you may also need zlib and libpng.
 
-
 Building
 ========
-
 There are a few files that you will need to edit.  First, you must
 determine which features will be built.  Edit
 build/Makefile.win32.features and set the features as desired.  Note
@@ -60,7 +52,6 @@ Finally, from the top Cairo directory, type:
 
     make -f Makefile.win32 CFG=release
 
-
 If this command succeeds, you will end up with src/release/cairo.dll.
 To successfully use Cairo from your own programs, you will probably
 want to move this file to some central location.  You will also
@@ -68,4 +59,3 @@ probably want to copy the Cairo header files.  These should be placed
 in a cairo subdirectory (for instance, c:/code/common/include/cairo).
 The exact set to copy depends on your features and is reported to you
 at the end of the build.
-


More information about the cairo-commit mailing list