[cairo-commit] cairo/src cairo-win32-font.c,1.39.2.1,1.39.2.2

Tor Lillqvist commit at pdx.freedesktop.org
Mon Sep 26 09:09:40 PDT 2005


Committed by: tml

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv9813/src

Modified Files:
      Tag: BRANCH_1_0
	cairo-win32-font.c 
Log Message:
2005-09-26  Tor Lillqvist  <tml at novell.com>

	* src/cairo-win32-font.c (_cairo_win32_scaled_font_init_glyph_metrics):
	If GetGlyphOutlineW() fails, set metrics to zero. (#3927, Hans
	Breuer) (Don't print error message, as this might occur frequently
	with a misconfigured Pango 1.10.0.)



Index: cairo-win32-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-win32-font.c,v
retrieving revision 1.39.2.1
retrieving revision 1.39.2.2
diff -u -d -r1.39.2.1 -r1.39.2.2
--- cairo-win32-font.c	26 Sep 2005 16:05:14 -0000	1.39.2.1
+++ cairo-win32-font.c	26 Sep 2005 16:09:38 -0000	1.39.2.2
@@ -723,8 +723,10 @@
 	status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
 	if (status)
 	    return status;
-	GetGlyphOutlineW (hdc, glyphs[0].index, GGO_METRICS | GGO_GLYPH_INDEX,
-			  &metrics, 0, NULL, &matrix);
+	if (GetGlyphOutlineW (hdc, glyphs[0].index, GGO_METRICS | GGO_GLYPH_INDEX,
+			      &metrics, 0, NULL, &matrix) == GDI_ERROR) {
+	  memset (&metrics, 0, sizeof (GLYPHMETRICS));
+	}
 	cairo_win32_scaled_font_done_font (&scaled_font->base);
 
 	if (scaled_font->swap_axes) {
@@ -758,8 +760,10 @@
 	 * of the font.
 	 */
 	status = _cairo_win32_scaled_font_select_unscaled_font (&scaled_font->base, hdc);
-	GetGlyphOutlineW (hdc, glyphs[0].index, GGO_METRICS | GGO_GLYPH_INDEX,
-			  &metrics, 0, NULL, &matrix);
+	if (GetGlyphOutlineW (hdc, glyphs[0].index, GGO_METRICS | GGO_GLYPH_INDEX,
+			      &metrics, 0, NULL, &matrix) == GDI_ERROR) {
+	  memset (&metrics, 0, sizeof (GLYPHMETRICS));
+	}
 	_cairo_win32_scaled_font_done_unscaled_font (&scaled_font->base);
 
 	extents->x_bearing = (double)metrics.gmptGlyphOrigin.x / scaled_font->em_square;



More information about the cairo-commit mailing list