[cairo-commit] 3 commits - src/cairo-ft-font.c src/cairo-pdf-surface.c src/cairo-scaled-font-subsets.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Mon Sep 12 05:35:08 PDT 2011


 src/cairo-ft-font.c             |    2 +-
 src/cairo-pdf-surface.c         |   10 ++++++++--
 src/cairo-scaled-font-subsets.c |    9 ++++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 7b6586a7385a529d7bfaa463541715f74f4a904d
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Sep 12 21:46:55 2011 +0930

    scaled-subsets: ensure different glyphs with same utf8 mapping are not merged together
    
    If a glyph maps to a latin char that is already assigned in the latin
    subset, put the glyph in a non latin subset.

diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index f24a86a..16e51f2 100644
--- a/src/cairo-scaled-font-subsets.c
+++ b/src/cairo-scaled-font-subsets.c
@@ -87,6 +87,7 @@ typedef struct _cairo_sub_font {
 struct _cairo_scaled_font_subsets {
     cairo_subsets_type_t type;
     cairo_bool_t use_latin_subset;
+    char latin_char_map[256];
 
     int max_glyphs_per_unscaled_subset_used;
     cairo_hash_table_t *unscaled_sub_fonts;
@@ -653,7 +654,10 @@ _cairo_sub_font_map_glyph (cairo_sub_font_t	*sub_font,
 	    if (latin_character > 0 ||
 		(latin_character == 0 && sub_font->num_glyphs_in_latin_subset > 0))
 	    {
-		is_latin = TRUE;
+		if (!sub_font->parent->latin_char_map[latin_character]) {
+		    sub_font->parent->latin_char_map[latin_character] = TRUE;
+		    is_latin = TRUE;
+		}
 	    }
 	}
 
@@ -759,6 +763,7 @@ static cairo_scaled_font_subsets_t *
 _cairo_scaled_font_subsets_create_internal (cairo_subsets_type_t type)
 {
     cairo_scaled_font_subsets_t *subsets;
+    int i;
 
     subsets = malloc (sizeof (cairo_scaled_font_subsets_t));
     if (unlikely (subsets == NULL)) {
@@ -771,6 +776,8 @@ _cairo_scaled_font_subsets_create_internal (cairo_subsets_type_t type)
     subsets->max_glyphs_per_unscaled_subset_used = 0;
     subsets->max_glyphs_per_scaled_subset_used = 0;
     subsets->num_sub_fonts = 0;
+    for (i = 0; i < 256; i++)
+	subsets->latin_char_map[i] = FALSE;
 
     subsets->unscaled_sub_fonts = _cairo_hash_table_create (_cairo_sub_fonts_equal);
     if (! subsets->unscaled_sub_fonts) {
commit 497258a4cf62e526f88e44c177eec6d9adf74ed0
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Sep 12 22:01:09 2011 +0930

    ft: fix warning

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index e0df535..b3c1478 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2493,7 +2493,7 @@ _cairo_index_to_glyph_name (void	         *abstract_font,
      * we fall back to searching the entire array.
      */
 
-    if (glyph_index < num_glyph_names &&
+    if ((long)glyph_index < num_glyph_names &&
 	strcmp (glyph_names[glyph_index], buffer) == 0)
     {
 	*glyph_array_index = glyph_index;
commit b0d9b4ce539477bc14724369c445acde1d1f4bd6
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Sep 12 21:53:59 2011 +0930

    pdf: add status check

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 3f2d047..7336a7d 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -6072,8 +6072,14 @@ _cairo_pdf_surface_mask (void			*abstract_surface,
     assert (_cairo_pdf_surface_operation_supported (surface, op, mask, &extents.bounded));
 
     /* get the accurate extents */
-    _cairo_pattern_get_ink_extents (source, &extents.source);
-    _cairo_pattern_get_ink_extents (mask, &extents.mask);
+    status = _cairo_pattern_get_ink_extents (source, &extents.source);
+    if (unlikely (status))
+	goto cleanup;
+
+    status = _cairo_pattern_get_ink_extents (mask, &extents.mask);
+    if (unlikely (status))
+	goto cleanup;
+
     extents.bounded = extents.source;
     if (! _cairo_rectangle_intersect (&extents.bounded, &extents.mask))
 	return CAIRO_STATUS_SUCCESS;


More information about the cairo-commit mailing list