[cairo-commit] src/cairo-type1-fallback.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Thu Mar 13 04:15:29 PDT 2008


 src/cairo-type1-fallback.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5050c55f93afef9b0d0651a78f2c99e06e19b55a
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Thu Mar 13 21:35:12 2008 +1030

    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.

diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c
index b465a13..a0fe5da 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;


More information about the cairo-commit mailing list