summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-10 12:59:36 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-10 13:05:18 +0100
commitc21a9eecb0e1d383c0f4c8e554fbfac1daf0518b (patch)
treecf062b2259c7621f9de7da5e1f3a67df3b1e00e0
parent2fd0beab2a7a2945ccf9641594414893266e649d (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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index 67ddf68dd..a9a935382 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -984,12 +984,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;
@@ -1028,12 +1025,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;