+ /* If this hack uses fonts (meaning, mentioned "font" in DEFAULTS)
+ then load it. */
+ {
+ char *name = get_string_resource ("font", "Font");
+ if (name)
+ {
+ XFontStruct *f = XLoadQueryFont (dpy, name);
+ const char *def1 = "-*-times-bold-r-normal-*-180-*";
+ const char *def2 = "fixed";
+ if (!f)
+ {
+ fprintf (stderr, "%s: font %s does not exist, using %s\n",
+ progname, name, def1);
+ f = XLoadQueryFont (dpy, def1);
+ }
+ if (!f)
+ {
+ fprintf (stderr, "%s: font %s does not exist, using %s\n",
+ progname, def1, def2);
+ f = XLoadQueryFont (dpy, def2);
+ }
+ if (f) XSetFont (dpy, mi.gc, f->fid);
+ if (f) XFreeFont (dpy, f);
+ }
+ }
+