try to load fixed font if other fails

This commit is contained in:
Julien Danjou 2007-09-15 21:40:37 +02:00
parent 9dce41e194
commit 6e7eb17404
1 changed files with 2 additions and 1 deletions

View File

@ -416,7 +416,8 @@ initfont(const char *fontstr, Display * disp, DC * drawcontext)
if(drawcontext->font.xfont)
XFreeFont(disp, drawcontext->font.xfont);
drawcontext->font.xfont = NULL;
if(!(drawcontext->font.xfont = XLoadQueryFont(disp, fontstr)))
if(!(drawcontext->font.xfont = XLoadQueryFont(disp, fontstr))
|| !(drawcontext->font.xfont = XLoadQueryFont(disp, "fixed")))
eprint("error, cannot load font: '%s'\n", fontstr);
drawcontext->font.ascent = drawcontext->font.xfont->ascent;
drawcontext->font.descent = drawcontext->font.xfont->descent;