summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
Diffstat (limited to 'pango')
-rw-r--r--pango/pangowin32.c15
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 */