summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-09-26 09:09:37 +0000
committerTor Lillqvist <tml@novell.com>2005-09-26 09:09:37 +0000
commit975bfe373057462fcb15d03bd2db4531a0fcff19 (patch)
treeb7b4087389a43a42045cdfe368c5da2e32bc2ac5
parent80b2fae5f13d7eaa5bec7093becc69791ad26d51 (diff)
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.)
-rw-r--r--ChangeLog4
-rw-r--r--src/cairo-win32-font.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d9b5809b..04947e907 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
negative. A negative lfHeight means "em height" which is what we
want, and matches how other toolkits interpret font sizes on
Win32. (Positive lfHeight means "cell height".) (#4593)
+ (_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.)
2005-09-20 T Rowley <tim.rowley@gmail.com>
diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index ff20c1a66..ee24dbfba 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -723,8 +723,10 @@ _cairo_win32_scaled_font_glyph_extents (void *abstract_font,
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 @@ _cairo_win32_scaled_font_glyph_extents (void *abstract_font,
* 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;