Fix sign of delta-y for ExtTextOutW

This commit is contained in:
Jonathan Kew 2025-07-14 14:41:40 +00:00 committed by Emmanuele Bassi
parent b09fe42db5
commit 503505666f

View file

@ -263,7 +263,14 @@ _cairo_win32_surface_emit_glyphs (cairo_win32_surface_t *dst,
next_logical_y = _cairo_lround (next_user_y);
dxy_buf[j] = _cairo_lround (next_logical_x - logical_x);
dxy_buf[j+1] = _cairo_lround (next_logical_y - logical_y);
/* When delta-y values are present in dxy_buf (the ETO_PDY flag is used), these
* represent "displacement along the vertical direction of the font" (per MSDN:
* https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-exttextoutw)
* with positive values being upward (observed behavior, not explicitly documented).
* This is the opposite of the top-to-bottom logical coordinate space used here,
* so the subtraction is reversed compared to what would otherwise be expected.
*/
dxy_buf[j+1] = _cairo_lround (logical_y - next_logical_y);
logical_x = next_logical_x;
logical_y = next_logical_y;