diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfont.c | 46 |
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) | |||
| 775 | XFontStruct *xfont = s->face->font; | 775 | XFontStruct *xfont = s->face->font; |
| 776 | int len = to - from; | 776 | int len = to - from; |
| 777 | GC gc = s->gc; | 777 | GC gc = s->gc; |
| 778 | int i; | ||
| 778 | 779 | ||
| 779 | if (gc != s->face->gc) | 780 | if (gc != s->face->gc) |
| 780 | { | 781 | { |
| @@ -791,7 +792,6 @@ xfont_draw (s, from, to, x, y, with_background) | |||
| 791 | if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0) | 792 | if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0) |
| 792 | { | 793 | { |
| 793 | char *str; | 794 | char *str; |
| 794 | int i; | ||
| 795 | USE_SAFE_ALLOCA; | 795 | USE_SAFE_ALLOCA; |
| 796 | 796 | ||
| 797 | SAFE_ALLOCA (str, char *, len); | 797 | SAFE_ALLOCA (str, char *, len); |
| @@ -799,11 +799,25 @@ xfont_draw (s, from, to, x, y, with_background) | |||
| 799 | str[i] = XCHAR2B_BYTE2 (s->char2b + from + i); | 799 | str[i] = XCHAR2B_BYTE2 (s->char2b + from + i); |
| 800 | BLOCK_INPUT; | 800 | BLOCK_INPUT; |
| 801 | if (with_background > 0) | 801 | if (with_background > 0) |
| 802 | XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | 802 | { |
| 803 | gc, x, y, str, len); | 803 | if (s->padding_p) |
| 804 | for (i = 0; i < len; i++) | ||
| 805 | XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 806 | gc, x + i, y, str + i, 1); | ||
| 807 | else | ||
| 808 | XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 809 | gc, x, y, str, len); | ||
| 810 | } | ||
| 804 | else | 811 | else |
| 805 | XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | 812 | { |
| 806 | gc, x, y, str, len); | 813 | if (s->padding_p) |
| 814 | for (i = 0; i < len; i++) | ||
| 815 | XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 816 | gc, x + i, y, str + i, 1); | ||
| 817 | else | ||
| 818 | XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 819 | gc, x, y, str, len); | ||
| 820 | } | ||
| 807 | UNBLOCK_INPUT; | 821 | UNBLOCK_INPUT; |
| 808 | SAFE_FREE (); | 822 | SAFE_FREE (); |
| 809 | return s->nchars; | 823 | return s->nchars; |
| @@ -811,11 +825,25 @@ xfont_draw (s, from, to, x, y, with_background) | |||
| 811 | 825 | ||
| 812 | BLOCK_INPUT; | 826 | BLOCK_INPUT; |
| 813 | if (with_background > 0) | 827 | if (with_background > 0) |
| 814 | XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | 828 | { |
| 815 | gc, x, y, s->char2b + from, len); | 829 | if (s->padding_p) |
| 830 | for (i = 0; i < len; i++) | ||
| 831 | XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 832 | gc, x + i, y, s->char2b + from + i, 1); | ||
| 833 | else | ||
| 834 | XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 835 | gc, x, y, s->char2b + from, len); | ||
| 836 | } | ||
| 816 | else | 837 | else |
| 817 | XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | 838 | { |
| 818 | gc, x, y, s->char2b + from, len); | 839 | if (s->padding_p) |
| 840 | for (i = 0; i < len; i++) | ||
| 841 | XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 842 | gc, x + i, y, s->char2b + from + i, 1); | ||
| 843 | else | ||
| 844 | XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), | ||
| 845 | gc, x, y, s->char2b + from, len); | ||
| 846 | } | ||
| 819 | UNBLOCK_INPUT; | 847 | UNBLOCK_INPUT; |
| 820 | 848 | ||
| 821 | return len; | 849 | return len; |