[cairo-commit] Branch '1.8' - 9 commits - cairo-version.h NEWS perf/cairo-perf-report.c src/cairo.c src/cairo-ft-font.c src/cairo-pdf-surface.c src/cairo-type1-subset.c

Carl Worth cworth at kemper.freedesktop.org
Fri Feb 19 16:31:58 PST 2010


 NEWS                     |   78 +++++++++++++++++++++++++++++++++++++++++++++++
 cairo-version.h          |    2 -
 perf/cairo-perf-report.c |    7 ++--
 src/cairo-ft-font.c      |    2 -
 src/cairo-pdf-surface.c  |    8 ++--
 src/cairo-type1-subset.c |   28 ++++++++++++----
 src/cairo.c              |    4 +-
 7 files changed, 111 insertions(+), 18 deletions(-)

New commits:
commit 2297f9878629882ff5ba99905bb54f3933e8eead
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Feb 19 16:30:18 2010 -0800

    Increment cairo version to 1.8.11
    
    Following the 1.8.10 release.

diff --git a/cairo-version.h b/cairo-version.h
index cec049c..892c6c5 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 10
+#define CAIRO_VERSION_MICRO 11
 
 #endif
commit dc7eba7564c1cf90cb4d330824e63053a51d3450
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Feb 19 16:24:49 2010 -0800

    Increment cairo version to 1.8.10.
    
    For the 1.8.10 release, of course.

diff --git a/cairo-version.h b/cairo-version.h
index e838e9e..cec049c 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 9
+#define CAIRO_VERSION_MICRO 10
 
 #endif
commit feadfb7c691602baeb156f7b80001d7dc0031ff6
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Feb 19 16:23:23 2010 -0800

    NEWS: Add notes for the 1.8.10 release.
    
    Summarizing all bug fixes (as well as I could).

diff --git a/NEWS b/NEWS
index b59702a..1bfca89 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,81 @@
+Release 1.8.10 (2010-02-19 Carl Worth <cworth at cworth.org>)
+==========================================================
+The cairo community is pleased to announce the 1.8.10 release of the
+cairo graphics library. This is the fifth update to cairo's stable 1.8
+series. This release consists of about a dozen hand-picked fixes
+compared to 1.8.8 (which was released about 8 months ago).
+
+We recommend that everyone using cairo upgrade to 1.8.10.
+
+-Carl
+
+General Bug fixes
+=================
+* Fix path construction for the case of cairo_curve_to immediately
+  after cairo_new_sub_path followed at some point by
+  cairo_close_path. (Previously, the final point for the close_path
+  was computed incorrectly.)
+
+* Fix for cairo_push_group or cairo_pop_group with a non-empty current
+  path. (Previously the path may have been erroneously translated when
+  either of these functions was called.)
+
+* Fix to correctly report an error if
+  cairo_surface_set_fallback_resolution is called with a value of 0
+  (in either axis). Previously, an assertion would occur later rather
+  than an error being properly reported when the original, invalid
+  value was passed.
+
+	Bug 23067: Using clear drawing operator crashes printing
+	http://bugs.freedesktop.org/show_bug.cgi?id=23067
+
+* Fix to handle a cairo_arc of radius 0 as equivalent to a
+  cairo_line_to to the center coordinate, (previously cairo would do
+  nothing for a cairo_arc call with a radius of 0).
+
+Backend-specific bug fixes
+==========================
+cairo-xlib
+----------
+* Fix to correctly copy from a Window source. Previously, cairo was
+  failing to include the contents of any sub-windows when copying from
+  a Window source.
+
+	Bug 12996: Xlib source surface fast-paths do not use
+	IncludeInferiors, while slow paths do
+
+	https://bugs.freedesktop.org/show_bug.cgi?id=12996
+
+cairo-ft
+--------
+* Fix conversion of freetype index to UCS4 value, (which would
+  previously miss the first character and cause the space glyph to map
+  to 0x00A0 instead of 0x0020).
+
+cairo-pdf
+---------
+* Fix Type 1 subsetting to avoid generating corrupt data.
+
+	Launchpad Ubuntu/cups bug 419143: Printing from evince (and
+	perhaps other GTK apps) to PostScript printers is broken
+
+	https://bugs.launchpad.net/ubuntu/+source/cups/+bug/419143
+
+* Fix Type 1 subsetting to correctly identify binary eexec data.
+
+* Fix Type 1 subsetting to include fixed-content portion in the
+  embedded font, (since some fonts may contain additional PostScript
+  code after the cleartomark).
+
+* Fix Type 1 subsetting to append "cleartomark" operator for binary
+  fonts that don't include it.
+
+Build fixes
+===========
+* Fix to compile on OpenBSD, (which has a libpng.pc file but none of
+  libpng10.pc, libpng12.pc, or libpng13.pc which cairo was looking for
+  previously).
+
 Release 1.8.8 (2009-06-16 Chris Wilson <chris at chris-wilson.co.uk>)
 =========================================================
 The cairo community is pleased to announce the 1.8.8 release of the
commit 6a46fabf7cba2cb61e89005e575d114766c780f6
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Feb 19 15:59:06 2010 -0800

    Fix "make distcheck" to avoid complaints about duplicate getline definition
    
    The _GNU_SOURCE macro needs to be defined first, (so that now included
    file includes any C library header (such as stdio.h) without this
    definition in place. Without this fix, "make check" in the perf
    directory would fail.

diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c
index 79e2f92..13277de 100644
--- a/perf/cairo-perf-report.c
+++ b/perf/cairo-perf-report.c
@@ -25,13 +25,14 @@
  * Authors: Carl Worth <cworth at cworth.org>
  */
 
-#include "cairo-perf.h"
-#include "cairo-stats.h"
-
 /* We use _GNU_SOURCE for getline and strndup if available. */
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE
 #endif
+
+#include "cairo-perf.h"
+#include "cairo-stats.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
commit e5552dda22af1969c72772c843d89af6160bde07
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Jan 15 07:47:30 2010 +1030

    Fix bug in _cairo_ft_index_to_ucs4
    
    Previously it would miss the first character causing the space glyph to
    return 0x00A0 instead of 0x0020.
    (cherry picked from commit f3b3a5c43f247f3e9019fa6c1fd2abb3b00dd9ea)

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 0b1e624..2172266 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2200,11 +2200,11 @@ _cairo_ft_index_to_ucs4(void	        *abstract_font,
     *ucs4 = (uint32_t) -1;
     charcode = FT_Get_First_Char(face, &gindex);
     while (gindex != 0) {
-	charcode = FT_Get_Next_Char (face, charcode, &gindex);
 	if (gindex == index) {
 	    *ucs4 = charcode;
 	    break;
 	}
+	charcode = FT_Get_Next_Char (face, charcode, &gindex);
     }
 
     _cairo_ft_unscaled_font_unlock_face (unscaled);
commit af10ae114b005c5a5ed92e2130371bed2bfba210
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Dec 30 16:21:50 2009 +0000

    arc: Just emit a line-to if radius is zero.
    
    In order to be consistent with the semantics of cairo_arc() using a
    radius of 0 should simply degenerate into a line-to.
    
    Reported-by: Benjamin Berg
    (cherry picked from commit a0ea0b63fdd38a73d6696da5cd4800d9a7289240)

diff --git a/src/cairo.c b/src/cairo.c
index 63d2693..ceaf3a8 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -1572,8 +1572,10 @@ cairo_arc (cairo_t *cr,
 	return;
 
     /* Do nothing, successfully, if radius is <= 0 */
-    if (radius <= 0.0)
+    if (radius <= 0.0) {
+	cairo_line_to (cr, xc, yc);
 	return;
+    }
 
     while (angle2 < angle1)
 	angle2 += 2 * M_PI;
commit 546edda52190ceaf8024113e6685e5f8fb275f19
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Nov 8 21:52:06 2009 +1030

    Type1-subset: Append "cleartomark" operator for binary fonts that don't include it
    
    Type 1 fonts embedded in PDF may omit the fixed-content portion of the
    font that contains the "cleartomark" operator.
    (cherry picked from commit cee3a6169bdf7f64c126c487b443dcb7a9f0586a)

diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index d8b0421..1317b29 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -1118,19 +1118,27 @@ cairo_type1_font_subset_write_trailer(cairo_type1_font_subset_t *font)
     static const char zeros[65] =
 	"0000000000000000000000000000000000000000000000000000000000000000\n";
 
-    /* Some fonts have conditional save/restore around the entire font
-     * dict, so we need to retain whatever postscript code that may
-     * come after 'cleartomark'. */
 
     for (i = 0; i < 8; i++)
 	_cairo_output_stream_write (font->output, zeros, sizeof zeros);
 
     cleartomark_token = find_token (font->type1_data, font->type1_end, "cleartomark");
-    if (cleartomark_token == NULL)
+    if (cleartomark_token) {
+	/* Some fonts have conditional save/restore around the entire
+	 * font dict, so we need to retain whatever postscript code
+	 * that may come after 'cleartomark'. */
+
+	_cairo_output_stream_write (font->output, cleartomark_token,
+				    font->type1_end - cleartomark_token);
+    } else if (!font->eexec_segment_is_ascii) {
+	/* Fonts embedded in PDF may omit the fixed-content portion
+	 * that includes the 'cleartomark' operator. Type 1 in PDF is
+	 * always binary. */
+
+	_cairo_output_stream_printf (font->output, "cleartomark");
+    } else {
 	return CAIRO_INT_STATUS_UNSUPPORTED;
-
-    _cairo_output_stream_write (font->output, cleartomark_token,
-				font->type1_end - cleartomark_token);
+    }
 
     /* some fonts do not have a newline at the end of the last line */
     _cairo_output_stream_printf (font->output, "\n");
commit af5f90df1d9f351e1189d96679979133e1a34379
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Nov 8 21:46:16 2009 +1030

    PDF: Include Type 1 fixed-content portion in the embedded font
    
    Some fonts may contain additional PostScript code after the
    cleartomark.
    (cherry picked from commit d962d6bae2681ea1f3c9533a83c8902d76e81c6a)

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 44f0ed8..7632aea 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -3174,16 +3174,16 @@ _cairo_pdf_surface_emit_type1_font (cairo_pdf_surface_t		*surface,
     if (subset_resource.id == 0)
 	return CAIRO_STATUS_SUCCESS;
 
-    /* We ignore the zero-trailer and set Length3 to 0. */
-    length = subset->header_length + subset->data_length;
+    length = subset->header_length + subset->data_length + subset->trailer_length;
     status = _cairo_pdf_surface_open_stream (surface,
 					     NULL,
 					     TRUE,
 					     "   /Length1 %lu\n"
 					     "   /Length2 %lu\n"
-					     "   /Length3 0\n",
+					     "   /Length3 %lu\n",
 					     subset->header_length,
-					     subset->data_length);
+					     subset->data_length,
+					     subset->trailer_length);
     if (status)
 	return status;
 
commit 7169e1f694dd068b3eae0dce4696c0e8199842ff
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Nov 8 21:38:58 2009 +1030

    Type1-subset: Check for binary eexec data
    
    Type 1 fonts embedded in PDF have the the encrypted portion in binary
    but the existing check for binary only works for Type 1 fonts in PFB
    format.
    
    Add an additional check based on the first 4 characters of eexec data.
    The Type 1 specification gurantees that at least one of the first 4
    bytes of ciphertext is not an ASCII Hex character.
    (cherry picked from commit ac59c7580894fc5fd424f7f6f8c1532d15048566)

diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index a0616e3..d8b0421 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -235,7 +235,7 @@ cairo_type1_font_subset_find_segments (cairo_type1_font_subset_t *font)
 {
     unsigned char *p;
     const char *eexec_token;
-    int size;
+    int size, i;
 
     p = (unsigned char *) font->type1_data;
     font->type1_end = font->type1_data + font->type1_length;
@@ -266,6 +266,10 @@ cairo_type1_font_subset_find_segments (cairo_type1_font_subset_t *font)
 	font->eexec_segment_size = font->type1_length - font->header_segment_size;
 	font->eexec_segment = (char *) p + font->header_segment_size;
 	font->eexec_segment_is_ascii = TRUE;
+	for (i = 0; i < 4; i++) {
+	    if (!isxdigit(font->eexec_segment[i]))
+		font->eexec_segment_is_ascii = FALSE;
+	}
     }
 
     return CAIRO_STATUS_SUCCESS;


More information about the cairo-commit mailing list