# HG changeset patch # User Richard M. Stallman # Date 840845002 0 # Node ID a31cfab57f695986504963ab6368217849758b4d # Parent 0a93a0afdd749a15818569ad2f1e9324baf78f05 (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 -r 0a93a0afdd74 -r a31cfab57f69 src/xterm.c --- a/src/xterm.c Fri Aug 23 08:16:06 1996 +0000 +++ b/src/xterm.c Sat Aug 24 00:03:22 1996 +0000 @@ -6108,6 +6108,30 @@ 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;