2001-04-18 Gerd Moellmann <gerd@gnu.org>
+ * xfaces.c (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.
+
* fileio.c (Finsert_file_contents): If the file size returned from
stat is zero, set END to READ_BUF_SIZE. This makes sure we can
read from files on a procfs whose contents are generated
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. */
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
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)
{
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))
{
success_p = 1;
}
- realizing_basic_faces_p = 0;
+ unbind_to (count, Qnil);
UNBLOCK_INPUT;
return success_p;
}
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);
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\