[win32] Fix horizontal glyph positioning bug

The _cairo_win32_scaled_font_backend version of show_glyphs collects
glyph runs to hand to ExtTextOutW until the y-offset changes, then flushes the
glyphs buffered so far. As each glyph is buffered, it also calculates and
buffers the dx value for the preceding glyph.

However, when it sees a change in dy and decides to flush, it should *not*
append an entry to the dx buffer, as this would be the "dx" of the previous
glyph, and instead the new start_x value will be used for the new glyph run
that's being collected. This bug means that after any vertically-offset glyph,
the remaining glyphs in the run will get incorrect dx values (horizontal
escapement).

Mozilla bug #475092
This commit is contained in:
Jonathan Kew 2009-03-30 14:45:48 -04:00 committed by Jeff Muizelaar
parent aee71e2063
commit 77ee65fd03

View file

@ -1180,12 +1180,12 @@ _add_glyph (cairo_glyph_state_t *state,
if (status)
return status;
state->start_x = logical_x;
} else {
dx = logical_x - state->last_x;
status = _cairo_array_append (&state->dx, &dx);
if (status)
return status;
}
dx = logical_x - state->last_x;
status = _cairo_array_append (&state->dx, &dx);
if (status)
return status;
} else {
state->start_x = logical_x;
}