X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=draw.c;h=92f07ca786b705d991a6d06fd3051d64ff8e76e3;hb=771c0cb6072b3e90d4ed7007073552736c49e655;hp=56a1beb37e6778b92ede9223691ab93f94748341;hpb=5d43e9243ce7b3273f2438bec2da170dcc8e329b;p=dmenu.git diff --git a/draw.c b/draw.c index 56a1beb..92f07ca 100644 --- a/draw.c +++ b/draw.c @@ -1,10 +1,9 @@ -/* (C)opyright MMIV-MMVI Anselm R. Garbe +/* (C)opyright MMIV-MMVII Anselm R. Garbe * See LICENSE file for license details. */ #include "dmenu.h" #include #include -#include /* static */ @@ -80,11 +79,10 @@ getcolor(const char *colstr) { void setfont(const char *fontstr) { - char **missing, *def; + char *def, **missing; int i, n; missing = NULL; - setlocale(LC_ALL, ""); if(dc.font.set) XFreeFontSet(dpy, dc.font.set); dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); @@ -109,11 +107,8 @@ setfont(const char *fontstr) { if(dc.font.xfont) XFreeFont(dpy, dc.font.xfont); dc.font.xfont = NULL; - dc.font.xfont = XLoadQueryFont(dpy, fontstr); - if (!dc.font.xfont) - dc.font.xfont = XLoadQueryFont(dpy, "fixed"); - if (!dc.font.xfont) - eprint("error, cannot init 'fixed' font\n"); + if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))) + eprint("error, cannot load font: '%s'\n", fontstr); dc.font.ascent = dc.font.xfont->ascent; dc.font.descent = dc.font.xfont->descent; }