diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2008-09-26 20:26:55 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2008-09-26 20:26:55 +0930 |
commit | 907f550a1b13b0a388f9ff22663911d4aabbe2d8 (patch) | |
tree | 04c5c84ab15c5b5271ded1a078e2d1860f6ee320 /src/cairo-type3-glyph-surface.c | |
parent | f8542dc9dd4dd0685f68381f21fa72dbddd8d682 (diff) |
Fix bitmap-font XFAIL
Images in PDF are scaled to a unit square. In PS we set the
ImageMatrix to do the same. When the image is painted we scale the
graphics state to paint the image at the right size. In the case of
Type 3 fonts consisting of bitmap images we want to paint the images
at their original size so we scale the graphics state by the image
width and height.
The bug was that we were scaling by the width/height in the glyph
metrics. For non rotated fonts this worked. However for rotated fonts
the width/height of the glyph images may be larger than the
width/height in the glyph metrics. This resulted in a Type 3 font
where the glyph images were scaled slightly smaller than they should
have been.
Diffstat (limited to 'src/cairo-type3-glyph-surface.c')
-rw-r--r-- | src/cairo-type3-glyph-surface.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index 2124400c..13827432 100644 --- a/src/cairo-type3-glyph-surface.c +++ b/src/cairo-type3-glyph-surface.c @@ -345,7 +345,7 @@ _cairo_type3_glyph_surface_emit_fallback_image (cairo_type3_glyph_surface_t *sur cairo_status_t status; cairo_image_surface_t *image; cairo_matrix_t mat; - double width, height, x, y; + double x, y; status = _cairo_scaled_glyph_lookup (surface->scaled_font, glyph_index, @@ -361,14 +361,10 @@ _cairo_type3_glyph_surface_emit_fallback_image (cairo_type3_glyph_surface_t *sur x = _cairo_fixed_to_double (scaled_glyph->bbox.p1.x); y = _cairo_fixed_to_double (scaled_glyph->bbox.p2.y); - width = _cairo_fixed_to_double (scaled_glyph->bbox.p2.x) - - _cairo_fixed_to_double (scaled_glyph->bbox.p1.x); - height = _cairo_fixed_to_double (scaled_glyph->bbox.p2.y) - - _cairo_fixed_to_double (scaled_glyph->bbox.p1.y); - mat.xx = width; + mat.xx = image->width; mat.xy = 0; mat.yx = 0; - mat.yy = height; + mat.yy = image->height; mat.x0 = x; mat.y0 = y; cairo_matrix_multiply (&mat, &mat, &surface->scaled_font->scale_inverse); |