diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-10 12:59:36 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-10 13:02:43 +0100 |
commit | 610da573e91810c53305b6bfe02eb7b714e3d08e (patch) | |
tree | 6e61624d681d8c732161da75a4dafe008bdc9fcb | |
parent | 81b5dc42b0e754d602506a8ccd231df9afd71593 (diff) |
[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
-rw-r--r-- | src/cairo-win32-font.c | 10 |
1 files 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; |