JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
update size hints on zoom
[st.git] / st.c
diff --git a/st.c b/st.c
index 13226d8..26053b0 100644 (file)
--- a/st.c
+++ b/st.c
@@ -180,7 +180,6 @@ typedef unsigned short ushort;
 
 typedef XftDraw *Draw;
 typedef XftColor Color;
-typedef Colormap Colormap;
 
 typedef struct {
        char c[UTF_SIZ]; /* character code */
@@ -2316,19 +2315,15 @@ techo(char *buf, int len) {
 
 void
 tdeftran(char ascii) {
-       char c, (*bp)[2];
-       static char tbl[][2] = {
-               {'0', CS_GRAPHIC0}, {'B', CS_USA},
-               {0, 0}
-       };
-
-       for (bp = &tbl[0]; (c = (*bp)[0]) && c != ascii; ++bp)
-               /* nothing */;
+       static char cs[] = "0B";
+       static int vcs[] = {CS_GRAPHIC0, CS_USA};
+       char *p;
 
-       if (c == 0)
+       if((p = strchr(cs, ascii)) == NULL) {
                fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii);
-       else
-               term.trantbl[term.icharset] = (*bp)[1];
+       } else {
+               term.trantbl[term.icharset] = vcs[p - cs];
+       }
 }
 
 void
@@ -2998,6 +2993,7 @@ xzoom(const Arg *arg) {
        xloadfonts(usedfont, usedfontsize + arg->i);
        cresize(0, 0);
        redraw(0);
+       xhints();
 }
 
 void
@@ -3250,28 +3246,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)