]> code.delx.au - gnu-emacs/blobdiff - src/xfaces.c
[TARGET_API_MAC_CARBON] (mac_do_receive_drag): Don't
[gnu-emacs] / src / xfaces.c
index f67ea61b37ae18cdf6a2120689c1708cd17daea0..46a95feeb452d48e54660fc4372b0fb151631610 100644 (file)
@@ -1,6 +1,6 @@
 /* xfaces.c -- "Face" primitives.
    Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006 Free Software Foundation, Inc.
+                 2005, 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1189,7 +1189,7 @@ load_pixmap (f, name, w_ptr, h_ptr)
 
   if (bitmap_id < 0)
     {
-      add_to_log ("Invalid or undefined bitmap %s", name, Qnil);
+      add_to_log ("Invalid or undefined bitmap `%s'", name, Qnil);
       bitmap_id = 0;
 
       if (w_ptr)
@@ -5717,6 +5717,8 @@ lookup_named_face (f, symbol, c, signal_p)
       if (!realize_basic_faces (f))
        return -1;
       default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+      if (default_face == NULL)
+       abort ();  /* realize_basic_faces must have set it up  */
     }
 
   if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p))
@@ -6176,7 +6178,7 @@ face for italic.  */)
   (attributes, display)
      Lisp_Object attributes, display;
 {
-  int supports, i;
+  int supports = 0, i;
   Lisp_Object frame;
   struct frame *f;
   struct face *def_face;
@@ -6221,6 +6223,8 @@ face for italic.  */)
       if (! realize_basic_faces (f))
        error ("Cannot realize default face");
       def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+      if (def_face == NULL)
+       abort ();  /* realize_basic_faces must have set it up  */
     }
 
   /* Dispatch to the appropriate handler.  */
@@ -6684,10 +6688,10 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike)
        {
          /* We want a bold font, but didn't get one; try to use
             overstriking instead to simulate bold-face.  However,
-            don't overstrike an already-bold fontn unless the
+            don't overstrike an already-bold font unless the
             desired weight grossly exceeds the available weight.  */
          if (got_weight > XLFD_WEIGHT_MEDIUM)
-           *needs_overstrike = (got_weight - want_weight) > 2;
+           *needs_overstrike = (want_weight - got_weight) > 2;
          else
            *needs_overstrike = 1;
        }
@@ -7067,10 +7071,18 @@ realize_default_face (f)
 #ifdef HAVE_WINDOW_SYSTEM
 #ifdef HAVE_X_WINDOWS
   if (face->font != FRAME_FONT (f))
-    /* As the font specified for the frame was not acceptable as a
-       font for the default face (perhaps because auto-scaled fonts
-       are rejected), we must adjust the frame font.  */
-    x_set_font (f, build_string (face->font_name), Qnil);
+    {
+      /* This can happen when making a frame on a display that does
+        not support the default font.  */
+      if (!face->font)
+       return 0;
+
+      /* Otherwise, the font specified for the frame was not
+        acceptable as a font for the default face (perhaps because
+        auto-scaled fonts are rejected), so we must adjust the frame
+        font.  */
+      x_set_font (f, build_string (face->font_name), Qnil);
+    }
 #endif /* HAVE_X_WINDOWS */
 #endif /* HAVE_WINDOW_SYSTEM */
   return 1;