{ CS_JIS0212_1990_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0212*-0" },
#endif
-#if ENCODING_CN || ENCODING_CN_EXT
+#if ENCODING_ZH || ENCODING_ZH_EXT
# if XFT
{ CS_BIG5_EXT, "xft:AR PL Mingti2L Big5" },
{ CS_BIG5_EXT, "xft:AR PL KaitiM Big5" },
{ CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" },
{ CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" },
#if XFT
- { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false"},
+ { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true"},
+ { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" },
{ CS_UNICODE, "xft:Andale Mono:antialias=false" },
{ CS_UNICODE, "xft:Arial Unicode MS:antialias=false" },
- { CS_UNICODE, "xft:Courier New:antialias=false" },
// FreeMono is usually uglier than x fonts, so try last only.
- { CS_UNICODE, "xft:FreeMono" },
+ { CS_UNICODE, "xft:FreeMono:autohint=true" },
#endif
{ CS_UNKNOWN, 0 }
#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);
+ text_t c2[2];
+ int len2 = 1;
+
+ // support double-width (but not more) combining characters
+ if (len && *text == NOCHAR)
+ {
+ c2[1] = *text; // not text++ to get correct x-width
+ len2++;
+ }
+
+ c2[0] = cc->c1;
+ rxvt_font *f1 = (*fs)[fs->find_font (c2[0])];
+ f1->draw (d, x, y, c2, len2, fg, bg);
+
if (cc->c2 != NOCHAR)
{
- // prefer font of first character, for no good reasons
bool careful;
- rxvt_font *f2 = f1->has_char (cc->c2, 0, careful)
+
+ // prefer font of first character, for no good reasons
+ c2[0] = cc->c2;
+ rxvt_font *f2 = (f1->has_char (c2[0], 0, careful) && !careful)
? f1
- : (*fs)[fs->find_font (cc->c2)];
+ : (*fs)[fs->find_font (c2[0])];
- f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1);
+ f2->draw (d, x, y, c2, len2, fg, -1);
}
}
#endif
void
rxvt_fontset::clear ()
{
+ prop.width = prop.height = prop.weight = prop.slant
+ = rxvt_fontprop::unset;
+
for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++)
FONT_UNREF (*i);
}
bool
-rxvt_fontset::populate (const char *desc, const rxvt_fontprop &prop)
+rxvt_fontset::populate (const char *desc)
{
clear ();
fonts.push_back (new_font (0, CS_UNICODE));
realize_font (0);
- this->prop = prop;
-
add_fonts (desc);
return true;