changeset 15904:a31cfab57f69

(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.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Aug 1996 00:03:22 +0000
parents 0a93a0afdd74
children 76fb9ea4460f
files src/xterm.c
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;