commit 04797343db457578906355cf1118548be90a183e from: Connor Lane Smith date: Sat May 21 19:26:26 2011 UTC update draw.c commit - e7d41cc18824114300a09d3bdb26c536f30b466e commit + 04797343db457578906355cf1118548be90a183e blob - 341a26f0f9625746741f98e16cb21e729e469ecd blob + 2028fd94d2d72d239929018afe32d36d9c86774b --- draw.c +++ draw.c @@ -126,13 +126,13 @@ loadfont(DC *dc, const char *fontstr) { if(!*fontstr) return False; - if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) { + if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) n = XFontsOfFontSet(dc->font.set, &xfonts, &names); - } - else { - dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr); + else if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr))) xfonts = &dc->font.xfont; - } + else + n = 0; + for(i = 0; i < n; i++) { dc->font.ascent = MAX(dc->font.ascent, xfonts[i]->ascent); dc->font.descent = MAX(dc->font.descent, xfonts[i]->descent);