X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=2cf9a26d3a34f3ccf58ddd1e6d7c2066e26bdad2;hb=c2fd2754ebea6f802e4c71219af269c58b78262e;hp=b148401a1693cde21d15566577258ac7d7abb791;hpb=93661042a2a0cf6f3655360f5c52215c684a4211;p=st.git diff --git a/st.c b/st.c index b148401..2cf9a26 100644 --- a/st.c +++ b/st.c @@ -2319,10 +2319,11 @@ tdeftran(char ascii) { static int vcs[] = {CS_GRAPHIC0, CS_USA}; char *p; - if((p = strchr(cs, ascii)) == NULL) + if((p = strchr(cs, ascii)) == NULL) { fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii); - else + } else { term.trantbl[term.icharset] = vcs[p - cs]; + } } void @@ -3244,28 +3245,22 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { bytelen -= u8cblen; doesexist = XftCharExists(xw.dpy, font->match, unicodep); - if(oneatatime || !doesexist || bytelen <= 0) { - if(oneatatime || bytelen <= 0) { - if(doesexist) { - u8fl++; - u8fblen += u8cblen; - } - } - - if(u8fl > 0) { - XftDrawStringUtf8(xw.draw, fg, - font->match, xp, - winy + font->ascent, - (FcChar8 *)u8fs, - u8fblen); - xp += xw.cw * u8fl; - - } - break; + if(doesexist) { + u8fl++; + u8fblen += u8cblen; + if(!oneatatime && bytelen > 0) + continue; } - u8fl++; - u8fblen += u8cblen; + if(u8fl > 0) { + XftDrawStringUtf8(xw.draw, fg, + font->match, xp, + winy + font->ascent, + (FcChar8 *)u8fs, + u8fblen); + xp += xw.cw * u8fl; + } + break; } if(doesexist) { if(oneatatime)