From: root Date: Sat, 18 Jun 2005 09:02:37 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=f5acf0f30ab71d523dccbd3f308c42a78b33c2ab;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index c8dcee32..bab5f07b 100644 --- a/Changes +++ b/Changes @@ -14,8 +14,11 @@ WISH: just for fun, do shade and tint with XRender. 5.6 - R_SB_RXVT bitset value was 0, so rxvt scrollbar was initialised - every time (original rxvt also affected). Reported by Jasmin - Buchert. + every time resulting in display errors (original rxvt also affected). + Reported by Jasmin Buchert. + - font names are now considered to be utf-8 encoded (xft apperently + uses this convention. X Core fonts might not, but it should be rare). + Affects display in iso14755 box. 5.5 Sat Apr 23 22:31:36 CEST 2005 - re-enabled modifer state matching as in 5.3, but implement diff --git a/src/command.C b/src/command.C index 11f703df..31cd8883 100644 --- a/src/command.C +++ b/src/command.C @@ -165,9 +165,11 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r) { rxvt_fontset *fs = FONTSET (r); rxvt_font *f = (*fs)[fs->find_font (ch)]; - wchar_t *chr, *alloc, ch2; + wchar_t *chr, *alloc, ch2, *fname; int len; + fname = rxvt_utf8towcs (f->name); + #if ENABLE_COMBINING if (IS_COMPOSE (ch)) { @@ -185,7 +187,7 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r) len = 1; } - int width = strlen (f->name); + int width = wcswidth (fname, wcslen (fname)); scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); @@ -208,7 +210,9 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r) scr_overlay_set (12, y, NOCHAR, r); } - scr_overlay_set (0, len, f->name); + scr_overlay_set (0, len, fname); + + free (fname); #if ENABLE_COMBINING if (alloc) diff --git a/src/rxvt.h b/src/rxvt.h index 3643235e..bb3e3805 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1229,6 +1229,7 @@ struct rxvt_term : zero_initialized, rxvt_vars { text_t text, rend_t rend = OVERLAY_RSTYLE); void scr_overlay_set (int x, int y, const char *s); + void scr_overlay_set (int x, int y, const wchar_t *s); #endif vector allocated; // free these memory blocks with free() diff --git a/src/screen.C b/src/screen.C index a46937a3..f91155fc 100644 --- a/src/screen.C +++ b/src/screen.C @@ -3797,6 +3797,22 @@ rxvt_term::scr_overlay_set (int x, int y, const char *s) scr_overlay_set (x++, y, *s++); } +void +rxvt_term::scr_overlay_set (int x, int y, const wchar_t *s) +{ + while (*s) + { + text_t t = *s++; + int width = wcwidth (t); + + while (width--) + { + scr_overlay_set (x++, y, t); + t = NOCHAR; + } + } +} + void rxvt_term::scr_swap_overlay () {