b=431391; printing pages with type1 fonts on win32 prints garbage; patch from upstream; r+a=me
authorvladimir@pobox.com
Wed, 30 Apr 2008 09:45:24 -0700
changeset 14807 c932b1bac6f5e7157d1e2028c8cf7fea5b0c34c9
parent 14806 1ed43118449f65cd64e8723a5c8b055325807990
child 14808 10eff0355c67f66ce2514e1b14046c601679e4e4
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs431391
milestone1.9pre
b=431391; printing pages with type1 fonts on win32 prints garbage; patch from upstream; r+a=me
gfx/cairo/README
gfx/cairo/cairo/src/cairo-win32-font.c
gfx/cairo/cairo/src/cairo-win32-printing-surface.c
gfx/cairo/cairo/src/cairo-win32-private.h
--- a/gfx/cairo/README
+++ b/gfx/cairo/README
@@ -17,16 +17,19 @@ VC6 is not supported.  Please upgrade to
 
 ==== Patches ====
 
 Some specific things:
 
 cairo git commit ea6dbfd36f2182fda16cb82bca92007e0f7b8d77 - 
   [cairo-meta-surface] Save and restore the original clip.
 
+cairo git commit d96fdd58abf8d6c8692dbb08ec54cdd80accba79 -
+  win32: Fix broken printing of type1 fonts
+
 max-font-size.patch: Clamp freetype font size to 1000 to avoid overflow issues
 
 win32-logical-font-scale.patch: set CAIRO_WIN32_LOGICAL_FONT_SCALE to 1
 
 nonfatal-assertions.patch: Make assertions non-fatal
 
 buggy-repeat.patch: Unconditionally turn on buggy-repeat handling to bandaid bug 413583.
 
--- a/gfx/cairo/cairo/src/cairo-win32-font.c
+++ b/gfx/cairo/cairo/src/cairo-win32-font.c
@@ -485,16 +485,26 @@ static cairo_status_t
 	return status;
     }
 
     SetMapMode (hdc, MM_TEXT);
 
     return CAIRO_STATUS_SUCCESS;
 }
 
+cairo_bool_t
+_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font)
+{
+    cairo_win32_scaled_font_t *win32_scaled_font;
+
+    win32_scaled_font = (cairo_win32_scaled_font_t *) scaled_font;
+
+    return win32_scaled_font->is_type1;
+}
+
 static void
 _cairo_win32_scaled_font_done_unscaled_font (cairo_scaled_font_t *scaled_font)
 {
 }
 
 /* implement the font backend interface */
 
 static cairo_status_t
--- a/gfx/cairo/cairo/src/cairo-win32-printing-surface.c
+++ b/gfx/cairo/cairo/src/cairo-win32-printing-surface.c
@@ -1336,16 +1336,17 @@ static cairo_int_status_t
 					   GetGValue (color) / 255.0,
 					   GetBValue (color) / 255.0);
 	if (opaque->status)
 	    return opaque->status;
 	source = opaque;
     }
 
     if (cairo_scaled_font_get_type (scaled_font) == CAIRO_FONT_TYPE_WIN32 &&
+	! _cairo_win32_scaled_font_is_type1 (scaled_font) &&
 	source->type == CAIRO_PATTERN_TYPE_SOLID)
     {
 	cairo_matrix_t ctm;
 
 	if (surface->has_ctm) {
 	    for (i = 0; i < num_glyphs; i++)
 		cairo_matrix_transform_point (&surface->ctm, &glyphs[i].x, &glyphs[i].y);
 	    cairo_matrix_multiply (&ctm, &scaled_font->ctm, &surface->ctm);
--- a/gfx/cairo/cairo/src/cairo-win32-private.h
+++ b/gfx/cairo/cairo/src/cairo-win32-private.h
@@ -176,9 +176,12 @@ cairo_int_status_t
 _cairo_win32_save_initial_clip (HDC dc, cairo_win32_surface_t *surface);
 
 cairo_int_status_t
 _cairo_win32_restore_initial_clip (cairo_win32_surface_t *surface);
 
 void
 _cairo_win32_debug_dump_hrgn (HRGN rgn, char *header);
 
+cairo_bool_t
+_cairo_win32_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font);
+
 #endif /* CAIRO_WIN32_PRIVATE_H */