From 610da573e91810c53305b6bfe02eb7b714e3d08e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 10 Jun 2009 12:59:36 +0100 Subject: [win32-font] Non-fatal error from GetGlyphOutlineW(GGO_METRICS) If GetGlyphOutlineW(GGO_METRICS) fails to retreive the metrics for the specified glyph it returns GDI_ERROR. Like ft, do not interpret this as a fatal error but just mark the glyph as empty. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=20255 Bug 20255 -- cairo_scaled_font_glyph_extents breaks with invalid glyph id --- src/cairo-win32-font.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c index d99c2613..e62e8816 100644 --- a/src/cairo-win32-font.c +++ b/src/cairo-win32-font.c @@ -977,12 +977,9 @@ _cairo_win32_scaled_font_init_glyph_metrics (cairo_win32_scaled_font_t *scaled_f if (GetGlyphOutlineW (hdc, _cairo_scaled_glyph_index (scaled_glyph), GGO_METRICS | GGO_GLYPH_INDEX, &metrics, 0, NULL, &matrix) == GDI_ERROR) { - status = _cairo_win32_print_gdi_error ("_cairo_win32_scaled_font_init_glyph_metrics:GetGlyphOutlineW"); - memset (&metrics, 0, sizeof (GLYPHMETRICS)); + memset (&metrics, 0, sizeof (GLYPHMETRICS)); } cairo_win32_scaled_font_done_font (&scaled_font->base); - if (status) - return status; if (scaled_font->swap_axes) { extents.x_bearing = - metrics.gmptGlyphOrigin.y / scaled_font->y_scale; @@ -1021,12 +1018,9 @@ _cairo_win32_scaled_font_init_glyph_metrics (cairo_win32_scaled_font_t *scaled_f if (GetGlyphOutlineW (hdc, _cairo_scaled_glyph_index (scaled_glyph), GGO_METRICS | GGO_GLYPH_INDEX, &metrics, 0, NULL, &matrix) == GDI_ERROR) { - status = _cairo_win32_print_gdi_error ("_cairo_win32_scaled_font_init_glyph_metrics:GetGlyphOutlineW"); - memset (&metrics, 0, sizeof (GLYPHMETRICS)); + memset (&metrics, 0, sizeof (GLYPHMETRICS)); } _cairo_win32_scaled_font_done_unscaled_font (&scaled_font->base); - if (status) - return status; extents.x_bearing = (double)metrics.gmptGlyphOrigin.x / scaled_font->em_square; extents.y_bearing = - (double)metrics.gmptGlyphOrigin.y / scaled_font->em_square; -- cgit v1.2.3