diff options
author | Michael Jennings <mej@kainx.org> | 2004-12-20 19:37:04 +0000 |
---|---|---|
committer | Michael Jennings <mej@kainx.org> | 2004-12-20 19:37:04 +0000 |
commit | 3c059ee512e479ce67d1e767039e570a16d54b08 (patch) | |
tree | e3a7d45cee9cc99cae454d07fe5136377b75e5ce | |
parent | 11356eeb96b0adb876588d5766472e80d6cdd7eb (diff) | |
download | eterm-3c059ee512e479ce67d1e767039e570a16d54b08.tar.gz |
Mon Dec 20 14:31:33 2004 Michael Jennings (mej)
Okay, so my first problem was that I didn't pay close enough attention
to the iconv_open() man page and got the parameter order wrong. Duh.
Thanks to Sytse Wielinga <s.b.wielinga@student.utwente.nl> for
noticing that.
kwo suggested using XmbDrawString(), but that causes font problems I'm
not ready to diagnose just yet.
----------------------------------------------------------------------
SVN revision: 12526
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/command.c | 8 | ||||
-rw-r--r-- | src/screen.c | 15 | ||||
-rw-r--r-- | src/screen.h | 6 |
4 files changed, 34 insertions, 5 deletions
@@ -5279,3 +5279,13 @@ someone can help me out. If you know iconv(), please have a look at the FIXME_BLOCK starting at line 3509 of src/command.c. ---------------------------------------------------------------------- +Mon Dec 20 14:31:33 2004 Michael Jennings (mej) + +Okay, so my first problem was that I didn't pay close enough attention +to the iconv_open() man page and got the parameter order wrong. Duh. +Thanks to Sytse Wielinga <s.b.wielinga@student.utwente.nl> for +noticing that. + +kwo suggested using XmbDrawString(), but that causes font problems I'm +not ready to diagnose just yet. +---------------------------------------------------------------------- diff --git a/src/command.c b/src/command.c index d8d6644..a63474b 100644 --- a/src/command.c +++ b/src/command.c @@ -3506,7 +3506,7 @@ main_loop(void) } D_SCREEN(("Adding %d lines (%d chars); str == %8p, cmdbuf_ptr == %8p, cmdbuf_endp == %8p\n", nlines, cmdbuf_ptr - str, str, cmdbuf_ptr, cmdbuf_endp)); -#if FIXME_BLOCK +#if !FIXME_BLOCK /* * iconv() is not my friend. :-( I've tried various things * to make this work (including UCS2, SJIS, EUCJ, and @@ -3530,17 +3530,17 @@ main_loop(void) char *outbuff, *pinbuff, *poutbuff; wchar_t *wcbuff; mbstate_t mbs; - size_t bufflen, outlen = 0, outbufflen, retval; + size_t bufflen, outlen = 0, retval; pinbuff = (char *) str; bufflen = cmdbuf_ptr - str; - outbufflen = outlen = bufflen * 6; + outlen = bufflen * 6; poutbuff = outbuff = SPIF_CAST_C(char *) MALLOC(outlen); errno = 0; D_VT(("Allocated output buffer of %lu chars at %010p against input buffer of %lu\n", bufflen * 6, outbuff, bufflen)); print_warning("Moo: %s\n", safe_print_string(str, bufflen)); retval = iconv(handle, &pinbuff, &bufflen, &poutbuff, &outlen); - outlen = outbufflen - outlen; + outlen = (size_t) (poutbuff - outbuff); if (retval != (size_t) -1) { errno = 0; } diff --git a/src/screen.c b/src/screen.c index f6a7aa0..41f0be1 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1682,8 +1682,13 @@ scr_refresh(int type) XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid); +#if FIXME_BLOCK + draw_string = XmbDrawString; + draw_image_string = XmbDrawImageString; +#else draw_string = XDrawString; draw_image_string = XDrawImageString; +#endif BOUND(screen.row, 0, TERM_WINDOW_GET_REPORTED_ROWS() - 1); BOUND(screen.col, 0, TERM_WINDOW_GET_REPORTED_COLS() - 1); @@ -1768,8 +1773,13 @@ scr_refresh(int type) if (!wbyte) { wbyte = 1; XSetFont(Xdisplay, TermWin.gc, TermWin.mfont->fid); +# if FIXME_BLOCK + draw_string = XmbDrawString; + draw_image_string = XmbDrawImageString; +# else draw_string = XDrawString16; draw_image_string = XDrawImageString16; +# endif } /* double stepping - we're in Multibyte mode */ for (; ++col < ncols;) { @@ -1806,8 +1816,13 @@ scr_refresh(int type) if (wbyte) { wbyte = 0; XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid); +# if FIXME_BLOCK + draw_string = XmbDrawString; + draw_image_string = XmbDrawImageString; +# else draw_string = XDrawString; draw_image_string = XDrawImageString; +# endif } #endif /* single stepping - `normal' mode */ diff --git a/src/screen.h b/src/screen.h index 9f6960f..09c7a62 100644 --- a/src/screen.h +++ b/src/screen.h @@ -59,7 +59,11 @@ if (y1 < low_y) low_y = y1; if (y2 > high_y) high_y = y2;}} while (0) #define ERASE_ROWS(row, num) do {XFillRectangle(Xdisplay, draw_buffer, TermWin.gc, Col2Pixel(0), Row2Pixel(row), TERM_WINDOW_GET_WIDTH(), Height2Pixel(num)); \ if (buffer_pixmap) {XClearArea(Xdisplay, TermWin.vt, Col2Pixel(0), Row2Pixel(row), TERM_WINDOW_GET_WIDTH(), Height2Pixel(num), 0);}} while (0) -#define DRAW_STRING(Func, x, y, str, len) Func(Xdisplay, draw_buffer, TermWin.gc, x, y, str, len) +#if 0 +# define DRAW_STRING(Func, x, y, str, len) Func(Xdisplay, draw_buffer, TermWin.fontset, TermWin.gc, x, y, str, len) +#else +# define DRAW_STRING(Func, x, y, str, len) Func(Xdisplay, draw_buffer, TermWin.gc, x, y, str, len) +#endif /* Make bold if bold flag is set and either we're drawing the foreground color or we're not suppressing bold. In other words, the foreground color can always be bolded, but other colors can't if bold is suppressed. */ |