[cairo-commit] src/cairo-win32-font.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jun 10 05:04:01 PDT 2009


 src/cairo-win32-font.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 610da573e91810c53305b6bfe02eb7b714e3d08e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 10 12:59:36 2009 +0100

    [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

diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index d99c261..e62e881 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;


More information about the cairo-commit mailing list