[cairo-commit] src/cairo-type3-glyph-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Mon Sep 15 17:36:05 PDT 2008


 src/cairo-type3-glyph-surface.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 7880ddd101e7a6f3f19d0d395c5881b188c11e49
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Tue Sep 16 10:04:34 2008 +0930

    Fix scaling of glyphs in type3 subset glyphs

diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c
index a7476a3..2124400 100644
--- a/src/cairo-type3-glyph-surface.c
+++ b/src/cairo-type3-glyph-surface.c
@@ -268,16 +268,22 @@ _cairo_type3_glyph_surface_show_glyphs (void		     *abstract_surface,
     cairo_type3_glyph_surface_t *surface = abstract_surface;
     cairo_int_status_t status;
     cairo_scaled_font_t *font;
-    cairo_matrix_t ctm;
+    cairo_matrix_t new_ctm, ctm_inverse;
     int i;
 
     for (i = 0; i < num_glyphs; i++)
 	cairo_matrix_transform_point (&surface->cairo_to_pdf, &glyphs[i].x, &glyphs[i].y);
 
-    cairo_matrix_multiply (&ctm, &scaled_font->ctm, &scaled_font->scale_inverse);
+    /* We require the matrix to be invertable. */
+    ctm_inverse = scaled_font->ctm;
+    status = cairo_matrix_invert (&ctm_inverse);
+    if (status)
+	return CAIRO_INT_STATUS_IMAGE_FALLBACK;
+
+    cairo_matrix_multiply (&new_ctm, &scaled_font->ctm, &ctm_inverse);
     font = cairo_scaled_font_create (scaled_font->font_face,
 				     &scaled_font->font_matrix,
-				     &ctm,
+				     &new_ctm,
 				     &scaled_font->options);
 
     status = _cairo_pdf_operators_show_text_glyphs (&surface->pdf_operators,


More information about the cairo-commit mailing list