mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-11 21:30:25 +01:00
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.
This commit is contained in:
parent
ed452713cf
commit
5050c55f93
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue