diff options
author | Tor Lillqvist <tml@iki.fi> | 2002-09-04 20:56:03 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2002-09-04 20:56:03 +0000 |
commit | 3767fe8946460aa77e559b24265a5367e8049083 (patch) | |
tree | 2ce9d8a9d61110526d45e25acb8c4fa4be497e65 /pango | |
parent | d29a3e5bc932f3083c307b3ee9d8ef96028191da (diff) | |
download | pango-3767fe8946460aa77e559b24265a5367e8049083.tar.gz |
Render only valid glyphs. Fix by Florent Duguet. Don't know if this is
2002-09-05 Tor Lillqvist <tml@iki.fi>
* 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?
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pangowin32.c | 15 |
1 files changed, 11 insertions, 4 deletions
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 <glyphs->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 */ |