changeset 37394:7847d9b8bbff

(Qscalable_fonts_allowed): New variable. (realizing_basic_faces_p): Removed. (x_face_list_fonts): Special handling for realizing_basic_faces_p removed. (realize_basic_faces): Specbind Qscalable_fonts_allowed to t. (syms_of_xfaces): Initialize Qscalable_fonts_allowed. Change default for scalable-fonts-allowed to t.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 18 Apr 2001 18:52:41 +0000
parents 12ff16bf66ed
children bdb34e3e0ef1
files src/xfaces.c
diffstat 1 files changed, 6 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Wed Apr 18 18:46:44 2001 +0000
+++ b/src/xfaces.c	Wed Apr 18 18:52:41 2001 +0000
@@ -403,7 +403,7 @@
    font may be scaled if its name matches a regular expression in the
    list.  */
 
-Lisp_Object Vscalable_fonts_allowed;
+Lisp_Object Vscalable_fonts_allowed, Qscalable_fonts_allowed;
 
 /* List of regular expressions that matches names of fonts to ignore. */
 
@@ -487,10 +487,6 @@
 
 static Lisp_Object Vparam_value_alist;
 
-/* Non-zero while realizing the default face.  */
-
-static int realizing_basic_faces_p;
-
 /* The total number of colors currently allocated.  */
 
 #if GLYPH_DEBUG
@@ -2360,23 +2356,6 @@
 	xfree (fonts[n].name);
     }
 
-  /* If someone specified a default font that's scalable, try
-     to do the right thing.  */
-  if (realizing_basic_faces_p
-      && try_alternatives_p
-      && n == 0
-      && nignored > 0)
-    {
-      for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem))
-	{
-	  fonts[n].name = xstrdup (XSTRING (XCAR (tem))->data);
-	  if (split_font_name (f, fonts + n, 1))
-	    ++n;
-	  else
-	    xfree (fonts[n].name);
-	}
-    }
-
   /* If no fonts found, try patterns from Valternate_fontname_alist.  */
   if (n == 0 && try_alternatives_p)
     {
@@ -5950,11 +5929,12 @@
      struct frame *f;
 {
   int success_p = 0;
+  int count = BINDING_STACK_SIZE ();
 
   /* Block input there so that we won't be surprised by an X expose
      event, for instance without having the faces set up.  */
   BLOCK_INPUT;
-  realizing_basic_faces_p = 1;
+  specbind (Qscalable_fonts_allowed, Qt);
 
   if (realize_default_face (f))
     {
@@ -5980,7 +5960,7 @@
       success_p = 1;
     }
 
-  realizing_basic_faces_p = 0;
+  unbind_to (count, Qnil);
   UNBLOCK_INPUT;
   return success_p;
 }
@@ -7067,6 +7047,8 @@
   staticpro (&Qtty_color_by_index);
   Qtty_color_alist = intern ("tty-color-alist");
   staticpro (&Qtty_color_alist);
+  Qscalable_fonts_allowed = intern ("scalable-fonts-allowed");
+  staticpro (&Qscalable_fonts_allowed);
 
   Vparam_value_alist = Fcons (Fcons (Qnil, Qnil), Qnil);
   staticpro (&Vparam_value_alist);
@@ -7132,13 +7114,7 @@
 A value of t means allow any scalable font.\n\
 Otherwise, value must be a list of regular expressions.  A font may be\n\
 scaled if its name matches a regular expression in the list.");
-#if defined (WINDOWSNT) || defined (macintosh)
-  /* Windows uses mainly truetype fonts, so disallowing scalable fonts
-     by default limits the fonts available severely. */
   Vscalable_fonts_allowed = Qt;
-#else
-  Vscalable_fonts_allowed = Qnil;
-#endif
 
   DEFVAR_LISP ("face-ignored-fonts", &Vface_ignored_fonts,
     "List of ignored fonts.\n\