aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-04-18 18:53:11 +0000
committerGerd Moellmann2001-04-18 18:53:11 +0000
commiteeffb293a3e249447b1c55405cab0f778c10fd04 (patch)
treee0242f6475f7422ab5c73196f50c4c517db41377
parent2feba154699bdde60ecad4d92826999c9842b3d5 (diff)
downloademacs-eeffb293a3e249447b1c55405cab0f778c10fd04.tar.gz
emacs-eeffb293a3e249447b1c55405cab0f778c10fd04.zip
(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.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xfaces.c36
2 files changed, 14 insertions, 30 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e5fee939760..6facf4244d7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12001-04-18 Gerd Moellmann <gerd@gnu.org> 12001-04-18 Gerd Moellmann <gerd@gnu.org>
2 2
3 * xfaces.c (Qscalable_fonts_allowed): New variable.
4 (realizing_basic_faces_p): Removed.
5 (x_face_list_fonts): Special handling for realizing_basic_faces_p
6 removed.
7 (realize_basic_faces): Specbind Qscalable_fonts_allowed to t.
8 (syms_of_xfaces): Initialize Qscalable_fonts_allowed. Change
9 default for scalable-fonts-allowed to t.
10
3 * fileio.c (Finsert_file_contents): If the file size returned from 11 * fileio.c (Finsert_file_contents): If the file size returned from
4 stat is zero, set END to READ_BUF_SIZE. This makes sure we can 12 stat is zero, set END to READ_BUF_SIZE. This makes sure we can
5 read from files on a procfs whose contents are generated 13 read from files on a procfs whose contents are generated
diff --git a/src/xfaces.c b/src/xfaces.c
index ac8a771e847..24f4c8406e3 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -403,7 +403,7 @@ Lisp_Object Vface_alternative_font_registry_alist;
403 font may be scaled if its name matches a regular expression in the 403 font may be scaled if its name matches a regular expression in the
404 list. */ 404 list. */
405 405
406Lisp_Object Vscalable_fonts_allowed; 406Lisp_Object Vscalable_fonts_allowed, Qscalable_fonts_allowed;
407 407
408/* List of regular expressions that matches names of fonts to ignore. */ 408/* List of regular expressions that matches names of fonts to ignore. */
409 409
@@ -487,10 +487,6 @@ int tty_suppress_bold_inverse_default_colors_p;
487 487
488static Lisp_Object Vparam_value_alist; 488static Lisp_Object Vparam_value_alist;
489 489
490/* Non-zero while realizing the default face. */
491
492static int realizing_basic_faces_p;
493
494/* The total number of colors currently allocated. */ 490/* The total number of colors currently allocated. */
495 491
496#if GLYPH_DEBUG 492#if GLYPH_DEBUG
@@ -2360,23 +2356,6 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p)
2360 xfree (fonts[n].name); 2356 xfree (fonts[n].name);
2361 } 2357 }
2362 2358
2363 /* If someone specified a default font that's scalable, try
2364 to do the right thing. */
2365 if (realizing_basic_faces_p
2366 && try_alternatives_p
2367 && n == 0
2368 && nignored > 0)
2369 {
2370 for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem))
2371 {
2372 fonts[n].name = xstrdup (XSTRING (XCAR (tem))->data);
2373 if (split_font_name (f, fonts + n, 1))
2374 ++n;
2375 else
2376 xfree (fonts[n].name);
2377 }
2378 }
2379
2380 /* If no fonts found, try patterns from Valternate_fontname_alist. */ 2359 /* If no fonts found, try patterns from Valternate_fontname_alist. */
2381 if (n == 0 && try_alternatives_p) 2360 if (n == 0 && try_alternatives_p)
2382 { 2361 {
@@ -5950,11 +5929,12 @@ realize_basic_faces (f)
5950 struct frame *f; 5929 struct frame *f;
5951{ 5930{
5952 int success_p = 0; 5931 int success_p = 0;
5932 int count = BINDING_STACK_SIZE ();
5953 5933
5954 /* Block input there so that we won't be surprised by an X expose 5934 /* Block input there so that we won't be surprised by an X expose
5955 event, for instance without having the faces set up. */ 5935 event, for instance without having the faces set up. */
5956 BLOCK_INPUT; 5936 BLOCK_INPUT;
5957 realizing_basic_faces_p = 1; 5937 specbind (Qscalable_fonts_allowed, Qt);
5958 5938
5959 if (realize_default_face (f)) 5939 if (realize_default_face (f))
5960 { 5940 {
@@ -5980,7 +5960,7 @@ realize_basic_faces (f)
5980 success_p = 1; 5960 success_p = 1;
5981 } 5961 }
5982 5962
5983 realizing_basic_faces_p = 0; 5963 unbind_to (count, Qnil);
5984 UNBLOCK_INPUT; 5964 UNBLOCK_INPUT;
5985 return success_p; 5965 return success_p;
5986} 5966}
@@ -7067,6 +7047,8 @@ syms_of_xfaces ()
7067 staticpro (&Qtty_color_by_index); 7047 staticpro (&Qtty_color_by_index);
7068 Qtty_color_alist = intern ("tty-color-alist"); 7048 Qtty_color_alist = intern ("tty-color-alist");
7069 staticpro (&Qtty_color_alist); 7049 staticpro (&Qtty_color_alist);
7050 Qscalable_fonts_allowed = intern ("scalable-fonts-allowed");
7051 staticpro (&Qscalable_fonts_allowed);
7070 7052
7071 Vparam_value_alist = Fcons (Fcons (Qnil, Qnil), Qnil); 7053 Vparam_value_alist = Fcons (Fcons (Qnil, Qnil), Qnil);
7072 staticpro (&Vparam_value_alist); 7054 staticpro (&Vparam_value_alist);
@@ -7132,13 +7114,7 @@ A value of nil means don't allow any scalable fonts.\n\
7132A value of t means allow any scalable font.\n\ 7114A value of t means allow any scalable font.\n\
7133Otherwise, value must be a list of regular expressions. A font may be\n\ 7115Otherwise, value must be a list of regular expressions. A font may be\n\
7134scaled if its name matches a regular expression in the list."); 7116scaled if its name matches a regular expression in the list.");
7135#if defined (WINDOWSNT) || defined (macintosh)
7136 /* Windows uses mainly truetype fonts, so disallowing scalable fonts
7137 by default limits the fonts available severely. */
7138 Vscalable_fonts_allowed = Qt; 7117 Vscalable_fonts_allowed = Qt;
7139#else
7140 Vscalable_fonts_allowed = Qnil;
7141#endif
7142 7118
7143 DEFVAR_LISP ("face-ignored-fonts", &Vface_ignored_fonts, 7119 DEFVAR_LISP ("face-ignored-fonts", &Vface_ignored_fonts,
7144 "List of ignored fonts.\n\ 7120 "List of ignored fonts.\n\