diff src/faces.c @ 3707:f6f6fc9eb269

[xemacs-hg @ 2006-11-28 21:20:22 by aidan] Better language behaviour on startup.
author aidan
date Tue, 28 Nov 2006 21:20:37 +0000
parents 3ef0aaf3dc34
children c13b89ba4796
line wrap: on
line diff
--- a/src/faces.c	Tue Nov 28 16:09:47 2006 +0000
+++ b/src/faces.c	Tue Nov 28 21:20:37 2006 +0000
@@ -719,6 +719,8 @@
 			int *height, int *width, int *proportional_p)
 {
   Lisp_Object font_instance;
+  struct face_cachel *cachel;
+  struct window *w = NULL;
 
   if (noninteractive)
     {
@@ -735,16 +737,16 @@
       return;
     }
 
-  /* We use ASCII here.  This is probably reasonable because the
-     people calling this function are using the resulting values to
-     come up with overall sizes for windows and frames. */
-  if (WINDOWP (domain))
+  /* We use ASCII here.  This is reasonable because the people calling this
+     function are using the resulting values to come up with overall sizes
+     for windows and frames. 
+
+     It's possible for this function to get called when the face cachels
+     have not been initialized--put a call to debug-print in
+     init-locale-at-early-startup to see it happen. */
+
+  if (WINDOWP (domain) && (w = XWINDOW (domain)) && w->face_cachels)
     {
-      struct face_cachel *cachel;
-      struct window *w = XWINDOW (domain);
-
-      /* #### It's possible for this function to get called when the
-	 face cachels have not been initialized.  I don't know why. */
       if (!Dynarr_length (w->face_cachels))
         reset_face_cachels (w);
       cachel = WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
@@ -755,6 +757,11 @@
       font_instance = FACE_FONT (Vdefault_face, domain, Vcharset_ascii);
     }
 
+  if (UNBOUNDP (font_instance))
+    {
+      return;
+    }
+
   if (height)
     *height = XFONT_INSTANCE (font_instance)->height;
   if (width)