summaryrefslogtreecommitdiff
path: root/src/cairo-type1-fallback.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2008-03-13 21:35:12 +1030
committerAdrian Johnson <ajohnson@redneon.com>2008-03-13 21:37:32 +1030
commit5050c55f93afef9b0d0651a78f2c99e06e19b55a (patch)
treefb01d34c805cd5d79cad84488bbc946cf71ec204 /src/cairo-type1-fallback.c
parented452713cfa16e5facca8f918ef4ee4fe2ec41c3 (diff)
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.
Diffstat (limited to 'src/cairo-type1-fallback.c')
-rw-r--r--src/cairo-type1-fallback.c8
1 files 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;