commit 7aade32fff4a348a9f2573958b1662da7c51d28a
parent f285a36054d253e46e1c7de10d6e7aedca75562c
Author: Kris Maglione <jg@suckless.org>
Date: Mon, 5 Feb 2007 21:27:54 -0500
1up on last commit: Try to load default font before we die.
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/draw.c b/draw.c
@@ -56,11 +56,15 @@ loadfont(Blitz *blitz, BlitzFont *font) {
XFreeFont(blitz->dpy, font->xfont);
font->xfont = nil;
font->xfont = XLoadQueryFont(blitz->dpy, fontname);
- if (!font->xfont)
- font->xfont = XLoadQueryFont(blitz->dpy, "fixed");
if (!font->xfont) {
- fprintf(stderr, "wmii: error, cannot load 'fixed' font\n");
- exit(1);
+ if(!strncmp(fontname, BLITZ_FONT, sizeof(BLITZ_FONT))) {
+ fprintf(stderr, "wmii: error, cannot load '%s' font\n",
+ BLITZ_FONT);
+ exit(1);
+ }
+ free(font->fontstr);
+ font->fontstr = ixp_estrdup(BLITZ_FONT);
+ return loadfont(blitz, font);
}
font->ascent = font->xfont->ascent;
font->descent = font->xfont->descent;