From a94dc7499bd9bcff0e562bb81eba4e8c74e97163 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 29 Nov 2007 23:18:45 +1030 Subject: [PATCH] PS: Use correct glyphs widths for Type 3 fonts Previously the widths were set to 0. (cherry picked from commit f4b93cceb7fb83de558ed058915f92d4f75c1a6a) --- src/cairo-ps-surface.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index c30ff955e..d70b2547a 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -541,6 +541,7 @@ _cairo_ps_surface_emit_bitmap_glyph_data (cairo_ps_surface_t *surface, cairo_image_surface_t *image; unsigned char *row, *byte; int rows, cols; + double x_advance, y_advance; status = _cairo_scaled_glyph_lookup (scaled_font, glyph_index, @@ -550,6 +551,10 @@ _cairo_ps_surface_emit_bitmap_glyph_data (cairo_ps_surface_t *surface, if (status) return status; + x_advance = scaled_glyph->metrics.x_advance; + y_advance = scaled_glyph->metrics.y_advance; + cairo_matrix_transform_distance (&scaled_font->ctm, &x_advance, &y_advance); + image = scaled_glyph->surface; if (image->format != CAIRO_FORMAT_A1) { image = _cairo_image_surface_clone (image, CAIRO_FORMAT_A1); @@ -558,7 +563,8 @@ _cairo_ps_surface_emit_bitmap_glyph_data (cairo_ps_surface_t *surface, } _cairo_output_stream_printf (surface->final_stream, - "0 0 %f %f %f %f setcachedevice\n", + "%f 0 %f %f %f %f setcachedevice\n", + x_advance, _cairo_fixed_to_double (scaled_glyph->bbox.p1.x), _cairo_fixed_to_double (scaled_glyph->bbox.p2.y), _cairo_fixed_to_double (scaled_glyph->bbox.p2.x),