diff src/xfaces.c @ 31570:9eeff4863080

Remove conditional compilation on SCALABLE_FONTS. (Finternal_set_lisp_face_attribute): If frame is 0, set new frame defaults first.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 12 Sep 2000 14:19:32 +0000
parents 7ba4ef0eac8d
children d69d99161d39
line wrap: on
line diff
--- a/src/xfaces.c	Tue Sep 12 13:32:06 2000 +0000
+++ b/src/xfaces.c	Tue Sep 12 14:19:32 2000 +0000
@@ -179,15 +179,6 @@
    basic faces are realized for CHARSET_ASCII.  Frame parameters are
    used to fill in unspecified attributes of the default face.  */
 
-/* Define SCALABLE_FONTS to a non-zero value to enable scalable
-   font use. Define it to zero to disable scalable font use.
-
-   Use of too many or too large scalable fonts can crash XFree86
-   servers.  That's why I've put the code dealing with scalable fonts
-   in #if's.  */
-
-#define SCALABLE_FONTS 1
-
 #include <config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -197,14 +188,15 @@
 
 #ifdef HAVE_WINDOW_SYSTEM
 #include "fontset.h"
-#endif
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #ifdef HAVE_X_WINDOWS
 #include "xterm.h"
 #ifdef USE_MOTIF
 #include <Xm/Xm.h>
 #include <Xm/XmStrDefs.h>
 #endif /* USE_MOTIF */
-#endif
+#endif /* HAVE_X_WINDOWS */
 
 #ifdef MSDOS
 #include "dosfns.h"
@@ -224,7 +216,7 @@
 /* For historic reasons, FONT_WIDTH refers to average width on W32,
    not maximum as on X. Redefine here. */
 #define FONT_WIDTH FONT_MAX_WIDTH
-#endif
+#endif /* WINDOWSNT */
 
 #include "buffer.h"
 #include "dispextern.h"
@@ -362,9 +354,7 @@
    font may be scaled if its name matches a regular expression in the
    list.  */
 
-#if SCALABLE_FONTS
 Lisp_Object Vscalable_fonts_allowed;
-#endif
 
 /* Maximum number of fonts to consider in font_list.  If not an
    integer > 0, DEFAULT_FONT_LIST_LIMIT is used instead.  */
@@ -638,9 +628,9 @@
   return Qnil;
 }
 
-
 #endif /* DEBUG_X_COLORS */
 
+
 /* Free colors used on frame F.  PIXELS is an array of NPIXELS pixel
    color values.  Interrupt input must be blocked when this function
    is called.  */
@@ -2251,7 +2241,7 @@
   BLOCK_INPUT;
   names = XListFonts (dpy, pattern, nfonts, &n);
   UNBLOCK_INPUT;
-#endif
+#endif /* HAVE_X_WINDOWS */
 #ifdef WINDOWSNT
   /* NTEMACS_TODO : currently this uses w32_list_fonts, but it may be
      better to do it the other way around. */
@@ -2283,7 +2273,7 @@
       names[i] = XSTRING (XCAR (tem))->data;
       tem = XCDR (tem);
     }
-#endif
+#endif /* WINDOWSNT */
 
   if (names)
     {
@@ -2299,16 +2289,11 @@
 	    xfree (fonts[j].name);
 	  else if (font_scalable_p (fonts + j))
 	    {
-#if SCALABLE_FONTS
 	      if (!scalable_fonts_p
 		  || !may_use_scalable_font_p (fonts + j, names[i]))
 		xfree (fonts[j].name);
 	      else
 		++j;
-#else /* !SCALABLE_FONTS */
-	      /* Always ignore scalable fonts.  */
-	      xfree (fonts[j].name);
-#endif /* !SCALABLE_FONTS */
 	    }
 	  else
 	    ++j;
@@ -2415,11 +2400,7 @@
     nfonts = XFASTINT (Vfont_list_limit);
 
   *fonts = (struct font_name *) xmalloc (nfonts * sizeof **fonts);
-#if SCALABLE_FONTS
   nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 1);
-#else
-  nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 0);
-#endif
 
   /* Sort the resulting array and return it in *FONTS.  If no
      fonts were found, make sure to set *FONTS to null.  */
@@ -3064,6 +3045,7 @@
 
   return 1;
 }
+
 #endif /* HAVE_WINDOW_SYSTEM */
 
 
@@ -3644,9 +3626,10 @@
   if (INTEGERP (frame) && XINT (frame) == 0)
     {
       Lisp_Object tail;
+      Finternal_set_lisp_face_attribute (face, attr, value, Qt);
       FOR_EACH_FRAME (tail, frame)
 	Finternal_set_lisp_face_attribute (face, attr, value, frame);
-      return Finternal_set_lisp_face_attribute (face, attr, value, Qt);
+      return face;
     }
 
   /* Set lface to the Lisp attribute vector of FACE.  */
@@ -3995,7 +3978,7 @@
 	  else if (EQ (attr, QCbackground))
 	    param = Qscroll_bar_background;
 	}
-#endif
+#endif /* not WINDOWSNT */
       else if (EQ (face, Qborder))
 	{
 	  /* Changing background color of `border' sets frame parameter
@@ -4145,7 +4128,7 @@
   value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)),
 				  resource, class, Qnil, Qnil);
   UNBLOCK_INPUT;
-#endif
+#endif /* not WINDOWSNT */
   return value;
 }
 
@@ -4336,7 +4319,6 @@
     }
 }
 
-
 #endif /* USE_MOTIF */
 
 #ifdef USE_LUCID
@@ -5548,8 +5530,6 @@
 }
 
 
-#if SCALABLE_FONTS
-
 /* Value is non-zero if FONT is an exact match for face attributes in
    SPECIFIED.  SPECIFIED is an array of face attribute values in font
    sort order.  */
@@ -5658,7 +5638,6 @@
   return 0;
 }
 
-#endif /* SCALABLE_FONTS != 0 */
 
 
 /* Return the name of the best matching font for face attributes
@@ -5700,9 +5679,6 @@
 	abort ();
     }
 
-#if SCALABLE_FONTS
-
-  /* Set to 1 */
   exact_p = 0;
 
   /* Start with the first non-scalable font in the list.  */
@@ -5765,22 +5741,6 @@
   else
     font_name = build_font_name (best);
 
-#else /* !SCALABLE_FONTS */
-
-  /* Find the best non-scalable font.  */
-  best = fonts;
-
-  for (i = 1; i < nfonts; ++i)
-    {
-      xassert (!font_scalable_p (fonts + i));
-      if (better_font_p (specified, fonts + i, best, 1))
-	best = fonts + i;
-    }
-
-  font_name = build_font_name (best);
-
-#endif /* !SCALABLE_FONTS */
-
   /* Free font_name structures.  */
   free_font_names (fonts, nfonts);
 
@@ -7071,8 +7031,6 @@
    "An alist of defined terminal colors and their RGB values.");
   Vtty_defined_color_alist = Qnil;
 
-#if SCALABLE_FONTS
-
   DEFVAR_LISP ("scalable-fonts-allowed", &Vscalable_fonts_allowed,
     "Allowed scalable fonts.\n\
 A value of nil means don't allow any scalable fonts.\n\
@@ -7086,7 +7044,6 @@
 #else
   Vscalable_fonts_allowed = Qnil;
 #endif
-#endif /* SCALABLE_FONTS */
 
 #ifdef HAVE_WINDOW_SYSTEM
   defsubr (&Sbitmap_spec_p);