From 7880ddd101e7a6f3f19d0d395c5881b188c11e49 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 16 Sep 2008 10:04:34 +0930 Subject: [PATCH] Fix scaling of glyphs in type3 subset glyphs --- src/cairo-type3-glyph-surface.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index a7476a378..2124400cc 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,