--- rxvt-unicode/src/rxvtfont.C 2011/02/21 07:41:03 1.178 +++ rxvt-unicode/src/rxvtfont.C 2012/05/17 20:08:00 1.190 @@ -24,7 +24,7 @@ #include "rxvtutil.h" #include "rxvtfont.h" -#include +#include #include @@ -134,7 +134,6 @@ # endif #endif - { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" }, //{ CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, // this gem of a font has actual dotted circles within the combining character glyphs. #if XFT { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true" }, @@ -526,12 +525,16 @@ const text_t *text, int len, int fg, int bg) { - while (len--) + while (len) { int fid = fs->find_font_idx (*text); - (*fs)[fid]->draw (d, x, y, text, 1, fg, bg); - ++text; - x += term->fwidth; + int w = 1; + while (w < len && text[w] == NOCHAR) + w++; + (*fs)[fid]->draw (d, x, y, text, w, fg, bg); + text += w; + len -= w; + x += term->fwidth * w; } } }; @@ -815,10 +818,10 @@ // this loop only iterates when the guessed font-size is too small for (;;) { - font_weight *best = fonts + count - 1; + font_weight *best = fonts; - for (font_weight *w = best; w-- > fonts; ) - if (w->diff <= best->diff) + for (font_weight *w = fonts + 1; w < fonts + count; w++) + if (w->diff < best->diff) best = w; if (!best->name @@ -923,7 +926,7 @@ width = 1; - for (uint16_t *t = extent_test_chars + ARRAY_LENGTH(extent_test_chars); t-- > extent_test_chars; ) + for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++) { if (FROM_UNICODE (cs, *t) == NOCHAR) continue; @@ -1245,7 +1248,7 @@ int glheight = height; - for (uint16_t *t = extent_test_chars + ARRAY_LENGTH(extent_test_chars); t-- > extent_test_chars; ) + for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++) { FcChar16 ch = *t; @@ -1784,7 +1787,7 @@ if (!fmap[hi]) { - fmap[hi] = (pagemap *)new pagemap; + fmap[hi] = new pagemap; memset (fmap[hi], 0xff, sizeof (pagemap)); }