From 77ee65fd03d06064be023f022d565c5038fe26df Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 30 Mar 2009 14:45:48 -0400 Subject: [PATCH] [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 --- src/cairo-win32-font.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c index e9abfda01..e0ece5b7a 100644 --- a/src/cairo-win32-font.c +++ b/src/cairo-win32-font.c @@ -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; }