diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2008-09-16 10:04:34 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2008-09-16 10:04:34 +0930 |
commit | 7880ddd101e7a6f3f19d0d395c5881b188c11e49 (patch) | |
tree | f6bcb169230d4f8fdb5080bfb02fe99072df7314 /src/cairo-type3-glyph-surface.c | |
parent | e31462d399dfad3b798efc56020cd9bb54c75dd9 (diff) |
Fix scaling of glyphs in type3 subset glyphs
Diffstat (limited to 'src/cairo-type3-glyph-surface.c')
-rw-r--r-- | src/cairo-type3-glyph-surface.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index a7476a37..2124400c 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, |