changeset 82916:b63eed64a25b

(x_draw_composite_glyph_string_foreground): Draw rectangle for nonexistent or zero-width glyph in composition glyph.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Mon, 27 Aug 2007 08:31:07 +0000
parents 4d757c831393
children 45f6b5d80e8e
files src/macterm.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Mon Aug 27 08:30:37 2007 +0000
+++ b/src/macterm.c	Mon Aug 27 08:31:07 2007 +0000
@@ -3056,10 +3056,17 @@
   else
     {
       for (i = 0; i < s->nchars; i++, ++s->gidx)
-	mac_draw_image_string_16 (s->f, s->gc,
-				  x + s->cmp->offsets[s->gidx * 2],
-				  s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
-				  s->char2b + i, 1, 0, s->face->overstrike);
+	if (mac_per_char_metric (GC_FONT (s->gc), s->char2b + i, 0) == NULL)
+	  /* This is a nonexistent or zero-width glyph such as a
+	     combining diacritic.  Draw a rectangle.  */
+	  mac_draw_rectangle (s->f, s->gc,
+			      x + s->cmp->offsets[s->gidx * 2], s->y,
+			      FONT_WIDTH (GC_FONT (s->gc)) - 1, s->height - 1);
+	else
+	  mac_draw_image_string_16 (s->f, s->gc,
+				    x + s->cmp->offsets[s->gidx * 2],
+				    s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
+				    s->char2b + i, 1, 0, s->face->overstrike);
     }
 }