From 5050c55f93afef9b0d0651a78f2c99e06e19b55a Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 13 Mar 2008 21:35:12 +1030 Subject: [PATCH] Use the correct glyph metrics in Type1 fallback Now that the PS backend is using PDF operators, it uses the glyph metrics in the font to position each glyph in a string. This exposed a bug in Type 1 fallback where the glyph width and height was used in the charstrings instead of x_advance/y_advance. This was causing strings to print diagonally due to the no zero y_advance. --- src/cairo-type1-fallback.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c index b465a13e7..a0fe5da6c 100644 --- a/src/cairo-type1-fallback.c +++ b/src/cairo-type1-fallback.c @@ -347,9 +347,9 @@ create_notdef_charstring (cairo_array_t *data, cairo_charstring_type_t type) charstring_encode_integer (data, 0, type); charstring_encode_integer (data, 0, type); - /* The width and height is arbitrary. */ - charstring_encode_integer (data, 500, type); + /* The width is arbitrary. */ charstring_encode_integer (data, 500, type); + charstring_encode_integer (data, 0, type); charstring_encode_command (data, CHARSTRING_sbw); } @@ -404,8 +404,8 @@ cairo_type1_font_create_charstring (cairo_type1_font_t *font, if (type == CAIRO_CHARSTRING_TYPE1) { charstring_encode_integer (data, (int) scaled_glyph->metrics.x_bearing, type); charstring_encode_integer (data, (int) scaled_glyph->metrics.y_bearing, type); - charstring_encode_integer (data, (int) scaled_glyph->metrics.width, type); - charstring_encode_integer (data, (int) scaled_glyph->metrics.height, type); + charstring_encode_integer (data, (int) scaled_glyph->metrics.x_advance, type); + charstring_encode_integer (data, (int) scaled_glyph->metrics.y_advance, type); charstring_encode_command (data, CHARSTRING_sbw); path_info.current_x = (int) scaled_glyph->metrics.x_bearing;