update draw.c
04797343
1 file(s) · +5 −5
| 126 | 126 | ||
| 127 | 127 | if(!*fontstr) |
|
| 128 | 128 | return False; |
|
| 129 | - | if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) { |
|
| 129 | + | if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) |
|
| 130 | 130 | n = XFontsOfFontSet(dc->font.set, &xfonts, &names); |
|
| 131 | - | } |
|
| 132 | - | else { |
|
| 133 | - | dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr); |
|
| 131 | + | else if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr))) |
|
| 134 | 132 | xfonts = &dc->font.xfont; |
|
| 135 | - | } |
|
| 133 | + | else |
|
| 134 | + | n = 0; |
|
| 135 | + | ||
| 136 | 136 | for(i = 0; i < n; i++) { |
|
| 137 | 137 | dc->font.ascent = MAX(dc->font.ascent, xfonts[i]->ascent); |
|
| 138 | 138 | dc->font.descent = MAX(dc->font.descent, xfonts[i]->descent); |