summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-02-25 01:44:26 +0000
committerKenichi Handa <handa@m17n.org>2008-02-25 01:44:26 +0000
commit8bb7e440929d7ec322a4a1e85cef3df9cbde8ad5 (patch)
tree92f1e405df19da2176d6ba3b3471faa743cf1325
parent36a85b057ff8237475898cc847528f13c19aeb0d (diff)
downloademacs-8bb7e440929d7ec322a4a1e85cef3df9cbde8ad5.tar.gz
(xfont_draw): Pay attention to s->padding_p.
-rw-r--r--src/xfont.c46
1 files changed, 37 insertions, 9 deletions
diff --git a/src/xfont.c b/src/xfont.c
index edf15f940fc..f13f3e5e36c 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -775,6 +775,7 @@ xfont_draw (s, from, to, x, y, with_background)
XFontStruct *xfont = s->face->font;
int len = to - from;
GC gc = s->gc;
+ int i;
if (gc != s->face->gc)
{
@@ -791,7 +792,6 @@ xfont_draw (s, from, to, x, y, with_background)
if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0)
{
char *str;
- int i;
USE_SAFE_ALLOCA;
SAFE_ALLOCA (str, char *, len);
@@ -799,11 +799,25 @@ xfont_draw (s, from, to, x, y, with_background)
str[i] = XCHAR2B_BYTE2 (s->char2b + from + i);
BLOCK_INPUT;
if (with_background > 0)
- XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
- gc, x, y, str, len);
+ {
+ if (s->padding_p)
+ for (i = 0; i < len; i++)
+ XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x + i, y, str + i, 1);
+ else
+ XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, str, len);
+ }
else
- XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
- gc, x, y, str, len);
+ {
+ if (s->padding_p)
+ for (i = 0; i < len; i++)
+ XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x + i, y, str + i, 1);
+ else
+ XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, str, len);
+ }
UNBLOCK_INPUT;
SAFE_FREE ();
return s->nchars;
@@ -811,11 +825,25 @@ xfont_draw (s, from, to, x, y, with_background)
BLOCK_INPUT;
if (with_background > 0)
- XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
- gc, x, y, s->char2b + from, len);
+ {
+ if (s->padding_p)
+ for (i = 0; i < len; i++)
+ XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x + i, y, s->char2b + from + i, 1);
+ else
+ XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, s->char2b + from, len);
+ }
else
- XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
- gc, x, y, s->char2b + from, len);
+ {
+ if (s->padding_p)
+ for (i = 0; i < len; i++)
+ XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x + i, y, s->char2b + from + i, 1);
+ else
+ XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, s->char2b + from, len);
+ }
UNBLOCK_INPUT;
return len;