--- rxvt-unicode/src/defaultfont.C 2004/03/03 20:15:18 1.29 +++ rxvt-unicode/src/defaultfont.C 2004/03/11 20:26:49 1.39 @@ -98,6 +98,10 @@ { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" }, { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" }, +#if UNICODE_3 && XFT + { CS_UNICODE, "xft:Code2001" }, // contains many plane-1 characters +#endif + { CS_UNKNOWN, 0 } }; @@ -266,6 +270,8 @@ width = 1; height = 1; ascent = 1; descent = 0; + set_name ("built-in pseudofont"); + return true; } @@ -273,6 +279,7 @@ { if (unicode <= 0x001f) return true; + if (unicode >= 0x0080 && unicode <= 0x009f) return true; @@ -280,6 +287,9 @@ && linedraw_cmds[unicode - 0x2500]) return true; + if (IS_COMPOSE (unicode)) + return true; + switch (unicode) { case ZERO_WIDTH_CHAR: @@ -305,6 +315,9 @@ while (len--) { +#if ENABLE_COMBINING + compose_char *cc; +#endif text_t t = *text++; // is it in our linedrawing table? @@ -312,8 +325,8 @@ { const char *p = linedraw_cmds[t - 0x2500]; - int x0 = x, x1 = x + r->TermWin.fwidth / 2, x2 = x + r->TermWin.fwidth - 1; - int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight - 1; + int x0 = x, x1 = x + (r->TermWin.fwidth - 1) / 2, x2 = x + r->TermWin.fwidth - 1; + int y0 = y, y1 = y + (r->TermWin.fheight - 1) / 2, y2 = y + r->TermWin.fheight - 1; XGCValues gcv; @@ -343,6 +356,22 @@ gcv.line_width = 0; XChangeGC (d.display->display, GC, GCLineWidth, &gcv); } +#if ENABLE_COMBINING + else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) + { + rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; + f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); + if (cc->c2 != NOCHAR) + { + // prefer font of first character, for no good reasons + rxvt_font *f2 = f1->has_codepoint (cc->c2) + ? f1 + : (*fs)[fs->find_font (cc->c2)]; + + f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1); + } + } +#endif else switch (t) { @@ -1015,6 +1044,7 @@ else f = new rxvt_font_x11; + f->fs = this; f->set_term (r); f->set_name (strdup (name));