From 35c7e319f8272d7894dbcec0543ab6f6fb14cd80 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 4 Sep 2002 20:52:53 +0000 Subject: Render only valid glyphs. Fix by Florent Duguet. Don't know if this is 2002-09-05 Tor Lillqvist * pango/pangowin32.c (pango_win32_render): Render only valid glyphs. Fix by Florent Duguet. Don't know if this is quite the correct way to fix the problem of default glyphs (ugly boxes) showing up, maybe invalid glyphs never should get this far, but be noticed earlier? --- ChangeLog | 8 ++++++++ ChangeLog.pre-1-10 | 8 ++++++++ ChangeLog.pre-1-2 | 8 ++++++++ ChangeLog.pre-1-4 | 8 ++++++++ ChangeLog.pre-1-6 | 8 ++++++++ ChangeLog.pre-1-8 | 8 ++++++++ pango/pangowin32.c | 15 +++++++++++---- 7 files changed, 59 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d82b165..f7ae1c6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-09-05 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_render): Render only valid + glyphs. Fix by Florent Duguet. Don't know if this is quite the + correct way to fix the problem of default glyphs (ugly boxes) + showing up, maybe invalid glyphs never should get this far, but be + noticed earlier? + 2002-09-04 Tor Lillqvist * pango/pango-utils.c: G_WIN32_DLLMAIN_FOR_DLL_NAME not needed on diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 9d82b165..f7ae1c6e 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,11 @@ +2002-09-05 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_render): Render only valid + glyphs. Fix by Florent Duguet. Don't know if this is quite the + correct way to fix the problem of default glyphs (ugly boxes) + showing up, maybe invalid glyphs never should get this far, but be + noticed earlier? + 2002-09-04 Tor Lillqvist * pango/pango-utils.c: G_WIN32_DLLMAIN_FOR_DLL_NAME not needed on diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 9d82b165..f7ae1c6e 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,11 @@ +2002-09-05 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_render): Render only valid + glyphs. Fix by Florent Duguet. Don't know if this is quite the + correct way to fix the problem of default glyphs (ugly boxes) + showing up, maybe invalid glyphs never should get this far, but be + noticed earlier? + 2002-09-04 Tor Lillqvist * pango/pango-utils.c: G_WIN32_DLLMAIN_FOR_DLL_NAME not needed on diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 9d82b165..f7ae1c6e 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,11 @@ +2002-09-05 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_render): Render only valid + glyphs. Fix by Florent Duguet. Don't know if this is quite the + correct way to fix the problem of default glyphs (ugly boxes) + showing up, maybe invalid glyphs never should get this far, but be + noticed earlier? + 2002-09-04 Tor Lillqvist * pango/pango-utils.c: G_WIN32_DLLMAIN_FOR_DLL_NAME not needed on diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 9d82b165..f7ae1c6e 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,11 @@ +2002-09-05 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_render): Render only valid + glyphs. Fix by Florent Duguet. Don't know if this is quite the + correct way to fix the problem of default glyphs (ugly boxes) + showing up, maybe invalid glyphs never should get this far, but be + noticed earlier? + 2002-09-04 Tor Lillqvist * pango/pango-utils.c: G_WIN32_DLLMAIN_FOR_DLL_NAME not needed on diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 9d82b165..f7ae1c6e 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,11 @@ +2002-09-05 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_render): Render only valid + glyphs. Fix by Florent Duguet. Don't know if this is quite the + correct way to fix the problem of default glyphs (ugly boxes) + showing up, maybe invalid glyphs never should get this far, but be + noticed earlier? + 2002-09-04 Tor Lillqvist * pango/pango-utils.c: G_WIN32_DLLMAIN_FOR_DLL_NAME not needed on diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 1c123655..b355fde2 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -240,7 +240,7 @@ pango_win32_render (HDC hdc, { HFONT old_hfont = NULL; HFONT hfont; - int i; + int i, num_valid_glyphs; guint16 *glyph_indexes; INT *dX; @@ -255,16 +255,23 @@ pango_win32_render (HDC hdc, glyph_indexes = g_new (guint16, glyphs->num_glyphs); dX = g_new (INT, glyphs->num_glyphs); + num_valid_glyphs = 0; for (i = 0; i num_glyphs; i++) { - glyph_indexes[i] = glyphs->glyphs[i].glyph; - dX[i] = glyphs->glyphs[i].geometry.width / PANGO_SCALE; + /* Prevent from displaying squares for nonexistent glyphs */ + if (glyphs->glyphs[i].glyph != 0) + { + /* Glyph is actually handled */ + glyph_indexes[num_valid_glyphs] = glyphs->glyphs[i].glyph; + dX[num_valid_glyphs] = glyphs->glyphs[i].geometry.width / PANGO_SCALE; + num_valid_glyphs++; + } } ExtTextOutW (hdc, x, y, ETO_GLYPH_INDEX, NULL, - glyph_indexes, glyphs->num_glyphs, + glyph_indexes, num_valid_glyphs, dX); SelectObject (hdc, old_hfont); /* restore */ -- cgit v1.2.1