From fce134490974b60d08188228b8e7d7289fd88de0 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sun, 17 Nov 2002 23:49:32 +0000 Subject: [PATCH] (x_draw_glyph_string_foreground) (x_draw_composite_glyph_string_foreground): Implement overstriking. --- src/xterm.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 1e5ee80a110..c5b0a8b00d3 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3222,6 +3222,18 @@ x_draw_glyph_string_foreground (s) XDrawImageString (s->display, s->window, s->gc, x, s->ybase - boff, char1b, s->nchars); } + + if (s->face->overstrike) + { + /* For overstriking (to simulate bold-face), draw the + characters again shifted to the right by one pixel. */ + if (s->two_byte_p) + XDrawString16 (s->display, s->window, s->gc, x + 1, + s->ybase - boff, s->char2b, s->nchars); + else + XDrawString (s->display, s->window, s->gc, x + 1, + s->ybase - boff, char1b, s->nchars); + } } } @@ -3257,10 +3269,17 @@ x_draw_composite_glyph_string_foreground (s) else { for (i = 0; i < s->nchars; i++, ++s->gidx) - XDrawString16 (s->display, s->window, s->gc, - x + s->cmp->offsets[s->gidx * 2], - s->ybase - s->cmp->offsets[s->gidx * 2 + 1], - s->char2b + i, 1); + { + XDrawString16 (s->display, s->window, s->gc, + x + s->cmp->offsets[s->gidx * 2], + s->ybase - s->cmp->offsets[s->gidx * 2 + 1], + s->char2b + i, 1); + if (s->face->overstrike) + XDrawString16 (s->display, s->window, s->gc, + x + s->cmp->offsets[s->gidx * 2] + 1, + s->ybase - s->cmp->offsets[s->gidx * 2 + 1], + s->char2b + i, 1); + } } } -- 2.39.2