Commit 51b592fb authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 0072414b
......@@ -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);
return dpyinfo;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment