From a60f1bd6e0e03e94039c7c87ccaa3a80da96fd3a Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Tue, 14 Jun 2005 21:49:08 +0000 Subject: [PATCH] Bug 297705 - correct cairo_text_extents() on win32 for general transforms. r=otaylor, r+a=shaver. --- gfx/cairo/README | 4 ++++ gfx/cairo/cairo/src/cairo-win32-font.c | 2 +- gfx/cairo/win32-extents.diff | 0 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 gfx/cairo/win32-extents.diff diff --git a/gfx/cairo/README b/gfx/cairo/README index 55915decf8f..c4a207fe60a 100644 --- a/gfx/cairo/README +++ b/gfx/cairo/README @@ -30,3 +30,7 @@ PATCHES: optimize-opaque-paint.diff - if cairo_paint_with_alpha is called with alpha == 1.0, turn it into cairo_paint + + win32-extents.diff - correct text extents for general tranforms + (upstream patch) + diff --git a/gfx/cairo/cairo/src/cairo-win32-font.c b/gfx/cairo/cairo/src/cairo-win32-font.c index 78b3ca21249..f48280856dc 100644 --- a/gfx/cairo/cairo/src/cairo-win32-font.c +++ b/gfx/cairo/cairo/src/cairo-win32-font.c @@ -714,7 +714,7 @@ _cairo_win32_scaled_font_glyph_extents (void *abstract_font, _cairo_win32_scaled_font_done_unscaled_font (&scaled_font->base); extents->x_bearing = (double)metrics.gmptGlyphOrigin.x / scaled_font->em_square; - extents->y_bearing = (double)metrics.gmptGlyphOrigin.y / scaled_font->em_square; + extents->y_bearing = - (double)metrics.gmptGlyphOrigin.y / scaled_font->em_square; extents->width = (double)metrics.gmBlackBoxX / scaled_font->em_square; extents->height = (double)metrics.gmBlackBoxY / scaled_font->em_square; extents->x_advance = (double)metrics.gmCellIncX / scaled_font->em_square; diff --git a/gfx/cairo/win32-extents.diff b/gfx/cairo/win32-extents.diff new file mode 100644 index 00000000000..e69de29bb2d