From: Richard M. Stallman Date: Sat, 24 Aug 1996 00:03:22 +0000 (+0000) Subject: (x_term_init): If the default Xt font does not exist on X-Git-Tag: emacs-20.1~4040 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=51b592fb337528c8e5c14376d4ff9e08db43b868;p=emacs.git (x_term_init): If the default Xt font does not exist on the X server, add a resource so that dialog boxes use a common font. --- diff --git a/src/xterm.c b/src/xterm.c index 5dfffb0ef8e..78c427bf904 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6108,6 +6108,30 @@ x_term_init (display_name, xrm_option, resource_name) init_sigio (connection); #endif /* ! defined (SIGIO) */ +#ifdef USE_LUCID + /* Make sure that we have a valid font for dialog boxes + so that Xt does not crash. */ + { + Display *dpy = dpyinfo->display; + XrmValue d, fr, to; + Font font; + + d.addr = (XPointer)&dpy; + d.size = sizeof (Display *); + fr.addr = XtDefaultFont; + fr.size = sizeof (XtDefaultFont); + to.size = sizeof (Font *); + to.addr = (XPointer)&font; + x_catch_errors (dpy); + if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) + abort (); + if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) + XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); + x_uncatch_errors (dpy); + } +#endif + + UNBLOCK_INPUT; return dpyinfo;