diff options
| author | Gerd Moellmann | 2000-09-12 14:19:54 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-09-12 14:19:54 +0000 |
| commit | d12d0a9b791ed9c1959f98d7978c18644e9d438e (patch) | |
| tree | 36f89e53d11aeb1b04b8f5002f2c4512381ab7f1 /src | |
| parent | 0812c1e828a835f617e5e4ab14945fb125f8e8b6 (diff) | |
| download | emacs-d12d0a9b791ed9c1959f98d7978c18644e9d438e.tar.gz emacs-d12d0a9b791ed9c1959f98d7978c18644e9d438e.zip | |
Remove conditional compilation on SCALABLE_FONTS.
(Finternal_set_lisp_face_attribute): If frame is 0, set new frame
defaults first.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xfaces.c | 67 |
2 files changed, 16 insertions, 55 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 413bb772449..3f1315cd6e2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2000-09-12 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-09-12 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xfaces.c: Remove conditional compilation on SCALABLE_FONTS. | ||
| 4 | (Finternal_set_lisp_face_attribute): If frame is 0, set new frame | ||
| 5 | defaults first. | ||
| 6 | |||
| 3 | * lread.c (Fload): Put code checking for recursive loads in #if 0. | 7 | * lread.c (Fload): Put code checking for recursive loads in #if 0. |
| 4 | 8 | ||
| 5 | 2000-09-12 Miyashita Hisashi <himi@meadowy.org> | 9 | 2000-09-12 Miyashita Hisashi <himi@meadowy.org> |
diff --git a/src/xfaces.c b/src/xfaces.c index b3856127d9d..3f9e9dc5fdb 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -179,15 +179,6 @@ Boston, MA 02111-1307, USA. */ | |||
| 179 | basic faces are realized for CHARSET_ASCII. Frame parameters are | 179 | basic faces are realized for CHARSET_ASCII. Frame parameters are |
| 180 | used to fill in unspecified attributes of the default face. */ | 180 | used to fill in unspecified attributes of the default face. */ |
| 181 | 181 | ||
| 182 | /* Define SCALABLE_FONTS to a non-zero value to enable scalable | ||
| 183 | font use. Define it to zero to disable scalable font use. | ||
| 184 | |||
| 185 | Use of too many or too large scalable fonts can crash XFree86 | ||
| 186 | servers. That's why I've put the code dealing with scalable fonts | ||
| 187 | in #if's. */ | ||
| 188 | |||
| 189 | #define SCALABLE_FONTS 1 | ||
| 190 | |||
| 191 | #include <config.h> | 182 | #include <config.h> |
| 192 | #include <sys/types.h> | 183 | #include <sys/types.h> |
| 193 | #include <sys/stat.h> | 184 | #include <sys/stat.h> |
| @@ -197,14 +188,15 @@ Boston, MA 02111-1307, USA. */ | |||
| 197 | 188 | ||
| 198 | #ifdef HAVE_WINDOW_SYSTEM | 189 | #ifdef HAVE_WINDOW_SYSTEM |
| 199 | #include "fontset.h" | 190 | #include "fontset.h" |
| 200 | #endif | 191 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 192 | |||
| 201 | #ifdef HAVE_X_WINDOWS | 193 | #ifdef HAVE_X_WINDOWS |
| 202 | #include "xterm.h" | 194 | #include "xterm.h" |
| 203 | #ifdef USE_MOTIF | 195 | #ifdef USE_MOTIF |
| 204 | #include <Xm/Xm.h> | 196 | #include <Xm/Xm.h> |
| 205 | #include <Xm/XmStrDefs.h> | 197 | #include <Xm/XmStrDefs.h> |
| 206 | #endif /* USE_MOTIF */ | 198 | #endif /* USE_MOTIF */ |
| 207 | #endif | 199 | #endif /* HAVE_X_WINDOWS */ |
| 208 | 200 | ||
| 209 | #ifdef MSDOS | 201 | #ifdef MSDOS |
| 210 | #include "dosfns.h" | 202 | #include "dosfns.h" |
| @@ -224,7 +216,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 224 | /* For historic reasons, FONT_WIDTH refers to average width on W32, | 216 | /* For historic reasons, FONT_WIDTH refers to average width on W32, |
| 225 | not maximum as on X. Redefine here. */ | 217 | not maximum as on X. Redefine here. */ |
| 226 | #define FONT_WIDTH FONT_MAX_WIDTH | 218 | #define FONT_WIDTH FONT_MAX_WIDTH |
| 227 | #endif | 219 | #endif /* WINDOWSNT */ |
| 228 | 220 | ||
| 229 | #include "buffer.h" | 221 | #include "buffer.h" |
| 230 | #include "dispextern.h" | 222 | #include "dispextern.h" |
| @@ -362,9 +354,7 @@ Lisp_Object Vface_alternative_font_family_alist; | |||
| 362 | font may be scaled if its name matches a regular expression in the | 354 | font may be scaled if its name matches a regular expression in the |
| 363 | list. */ | 355 | list. */ |
| 364 | 356 | ||
| 365 | #if SCALABLE_FONTS | ||
| 366 | Lisp_Object Vscalable_fonts_allowed; | 357 | Lisp_Object Vscalable_fonts_allowed; |
| 367 | #endif | ||
| 368 | 358 | ||
| 369 | /* Maximum number of fonts to consider in font_list. If not an | 359 | /* Maximum number of fonts to consider in font_list. If not an |
| 370 | integer > 0, DEFAULT_FONT_LIST_LIMIT is used instead. */ | 360 | integer > 0, DEFAULT_FONT_LIST_LIMIT is used instead. */ |
| @@ -638,9 +628,9 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0, | |||
| 638 | return Qnil; | 628 | return Qnil; |
| 639 | } | 629 | } |
| 640 | 630 | ||
| 641 | |||
| 642 | #endif /* DEBUG_X_COLORS */ | 631 | #endif /* DEBUG_X_COLORS */ |
| 643 | 632 | ||
| 633 | |||
| 644 | /* Free colors used on frame F. PIXELS is an array of NPIXELS pixel | 634 | /* Free colors used on frame F. PIXELS is an array of NPIXELS pixel |
| 645 | color values. Interrupt input must be blocked when this function | 635 | color values. Interrupt input must be blocked when this function |
| 646 | is called. */ | 636 | is called. */ |
| @@ -2251,7 +2241,7 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p, | |||
| 2251 | BLOCK_INPUT; | 2241 | BLOCK_INPUT; |
| 2252 | names = XListFonts (dpy, pattern, nfonts, &n); | 2242 | names = XListFonts (dpy, pattern, nfonts, &n); |
| 2253 | UNBLOCK_INPUT; | 2243 | UNBLOCK_INPUT; |
| 2254 | #endif | 2244 | #endif /* HAVE_X_WINDOWS */ |
| 2255 | #ifdef WINDOWSNT | 2245 | #ifdef WINDOWSNT |
| 2256 | /* NTEMACS_TODO : currently this uses w32_list_fonts, but it may be | 2246 | /* NTEMACS_TODO : currently this uses w32_list_fonts, but it may be |
| 2257 | better to do it the other way around. */ | 2247 | better to do it the other way around. */ |
| @@ -2283,7 +2273,7 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p, | |||
| 2283 | names[i] = XSTRING (XCAR (tem))->data; | 2273 | names[i] = XSTRING (XCAR (tem))->data; |
| 2284 | tem = XCDR (tem); | 2274 | tem = XCDR (tem); |
| 2285 | } | 2275 | } |
| 2286 | #endif | 2276 | #endif /* WINDOWSNT */ |
| 2287 | 2277 | ||
| 2288 | if (names) | 2278 | if (names) |
| 2289 | { | 2279 | { |
| @@ -2299,16 +2289,11 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p, | |||
| 2299 | xfree (fonts[j].name); | 2289 | xfree (fonts[j].name); |
| 2300 | else if (font_scalable_p (fonts + j)) | 2290 | else if (font_scalable_p (fonts + j)) |
| 2301 | { | 2291 | { |
| 2302 | #if SCALABLE_FONTS | ||
| 2303 | if (!scalable_fonts_p | 2292 | if (!scalable_fonts_p |
| 2304 | || !may_use_scalable_font_p (fonts + j, names[i])) | 2293 | || !may_use_scalable_font_p (fonts + j, names[i])) |
| 2305 | xfree (fonts[j].name); | 2294 | xfree (fonts[j].name); |
| 2306 | else | 2295 | else |
| 2307 | ++j; | 2296 | ++j; |
| 2308 | #else /* !SCALABLE_FONTS */ | ||
| 2309 | /* Always ignore scalable fonts. */ | ||
| 2310 | xfree (fonts[j].name); | ||
| 2311 | #endif /* !SCALABLE_FONTS */ | ||
| 2312 | } | 2297 | } |
| 2313 | else | 2298 | else |
| 2314 | ++j; | 2299 | ++j; |
| @@ -2415,11 +2400,7 @@ sorted_font_list (f, pattern, cmpfn, fonts) | |||
| 2415 | nfonts = XFASTINT (Vfont_list_limit); | 2400 | nfonts = XFASTINT (Vfont_list_limit); |
| 2416 | 2401 | ||
| 2417 | *fonts = (struct font_name *) xmalloc (nfonts * sizeof **fonts); | 2402 | *fonts = (struct font_name *) xmalloc (nfonts * sizeof **fonts); |
| 2418 | #if SCALABLE_FONTS | ||
| 2419 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 1); | 2403 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 1); |
| 2420 | #else | ||
| 2421 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 0); | ||
| 2422 | #endif | ||
| 2423 | 2404 | ||
| 2424 | /* Sort the resulting array and return it in *FONTS. If no | 2405 | /* Sort the resulting array and return it in *FONTS. If no |
| 2425 | fonts were found, make sure to set *FONTS to null. */ | 2406 | fonts were found, make sure to set *FONTS to null. */ |
| @@ -3064,6 +3045,7 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) | |||
| 3064 | 3045 | ||
| 3065 | return 1; | 3046 | return 1; |
| 3066 | } | 3047 | } |
| 3048 | |||
| 3067 | #endif /* HAVE_WINDOW_SYSTEM */ | 3049 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 3068 | 3050 | ||
| 3069 | 3051 | ||
| @@ -3644,9 +3626,10 @@ FRAME 0 means change the face on all frames, and change the default\n\ | |||
| 3644 | if (INTEGERP (frame) && XINT (frame) == 0) | 3626 | if (INTEGERP (frame) && XINT (frame) == 0) |
| 3645 | { | 3627 | { |
| 3646 | Lisp_Object tail; | 3628 | Lisp_Object tail; |
| 3629 | Finternal_set_lisp_face_attribute (face, attr, value, Qt); | ||
| 3647 | FOR_EACH_FRAME (tail, frame) | 3630 | FOR_EACH_FRAME (tail, frame) |
| 3648 | Finternal_set_lisp_face_attribute (face, attr, value, frame); | 3631 | Finternal_set_lisp_face_attribute (face, attr, value, frame); |
| 3649 | return Finternal_set_lisp_face_attribute (face, attr, value, Qt); | 3632 | return face; |
| 3650 | } | 3633 | } |
| 3651 | 3634 | ||
| 3652 | /* Set lface to the Lisp attribute vector of FACE. */ | 3635 | /* Set lface to the Lisp attribute vector of FACE. */ |
| @@ -3995,7 +3978,7 @@ FRAME 0 means change the face on all frames, and change the default\n\ | |||
| 3995 | else if (EQ (attr, QCbackground)) | 3978 | else if (EQ (attr, QCbackground)) |
| 3996 | param = Qscroll_bar_background; | 3979 | param = Qscroll_bar_background; |
| 3997 | } | 3980 | } |
| 3998 | #endif | 3981 | #endif /* not WINDOWSNT */ |
| 3999 | else if (EQ (face, Qborder)) | 3982 | else if (EQ (face, Qborder)) |
| 4000 | { | 3983 | { |
| 4001 | /* Changing background color of `border' sets frame parameter | 3984 | /* Changing background color of `border' sets frame parameter |
| @@ -4145,7 +4128,7 @@ DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource, | |||
| 4145 | value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)), | 4128 | value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)), |
| 4146 | resource, class, Qnil, Qnil); | 4129 | resource, class, Qnil, Qnil); |
| 4147 | UNBLOCK_INPUT; | 4130 | UNBLOCK_INPUT; |
| 4148 | #endif | 4131 | #endif /* not WINDOWSNT */ |
| 4149 | return value; | 4132 | return value; |
| 4150 | } | 4133 | } |
| 4151 | 4134 | ||
| @@ -4336,7 +4319,6 @@ xm_set_menu_resources_from_menu_face (f, widget) | |||
| 4336 | } | 4319 | } |
| 4337 | } | 4320 | } |
| 4338 | 4321 | ||
| 4339 | |||
| 4340 | #endif /* USE_MOTIF */ | 4322 | #endif /* USE_MOTIF */ |
| 4341 | 4323 | ||
| 4342 | #ifdef USE_LUCID | 4324 | #ifdef USE_LUCID |
| @@ -5548,8 +5530,6 @@ better_font_p (values, font1, font2, compare_pt_p) | |||
| 5548 | } | 5530 | } |
| 5549 | 5531 | ||
| 5550 | 5532 | ||
| 5551 | #if SCALABLE_FONTS | ||
| 5552 | |||
| 5553 | /* Value is non-zero if FONT is an exact match for face attributes in | 5533 | /* Value is non-zero if FONT is an exact match for face attributes in |
| 5554 | SPECIFIED. SPECIFIED is an array of face attribute values in font | 5534 | SPECIFIED. SPECIFIED is an array of face attribute values in font |
| 5555 | sort order. */ | 5535 | sort order. */ |
| @@ -5658,7 +5638,6 @@ may_use_scalable_font_p (font, name) | |||
| 5658 | return 0; | 5638 | return 0; |
| 5659 | } | 5639 | } |
| 5660 | 5640 | ||
| 5661 | #endif /* SCALABLE_FONTS != 0 */ | ||
| 5662 | 5641 | ||
| 5663 | 5642 | ||
| 5664 | /* Return the name of the best matching font for face attributes | 5643 | /* Return the name of the best matching font for face attributes |
| @@ -5700,9 +5679,6 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5700 | abort (); | 5679 | abort (); |
| 5701 | } | 5680 | } |
| 5702 | 5681 | ||
| 5703 | #if SCALABLE_FONTS | ||
| 5704 | |||
| 5705 | /* Set to 1 */ | ||
| 5706 | exact_p = 0; | 5682 | exact_p = 0; |
| 5707 | 5683 | ||
| 5708 | /* Start with the first non-scalable font in the list. */ | 5684 | /* Start with the first non-scalable font in the list. */ |
| @@ -5765,22 +5741,6 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5765 | else | 5741 | else |
| 5766 | font_name = build_font_name (best); | 5742 | font_name = build_font_name (best); |
| 5767 | 5743 | ||
| 5768 | #else /* !SCALABLE_FONTS */ | ||
| 5769 | |||
| 5770 | /* Find the best non-scalable font. */ | ||
| 5771 | best = fonts; | ||
| 5772 | |||
| 5773 | for (i = 1; i < nfonts; ++i) | ||
| 5774 | { | ||
| 5775 | xassert (!font_scalable_p (fonts + i)); | ||
| 5776 | if (better_font_p (specified, fonts + i, best, 1)) | ||
| 5777 | best = fonts + i; | ||
| 5778 | } | ||
| 5779 | |||
| 5780 | font_name = build_font_name (best); | ||
| 5781 | |||
| 5782 | #endif /* !SCALABLE_FONTS */ | ||
| 5783 | |||
| 5784 | /* Free font_name structures. */ | 5744 | /* Free font_name structures. */ |
| 5785 | free_font_names (fonts, nfonts); | 5745 | free_font_names (fonts, nfonts); |
| 5786 | 5746 | ||
| @@ -7071,8 +7031,6 @@ See `set-face-stipple' for possible values for this variable."); | |||
| 7071 | "An alist of defined terminal colors and their RGB values."); | 7031 | "An alist of defined terminal colors and their RGB values."); |
| 7072 | Vtty_defined_color_alist = Qnil; | 7032 | Vtty_defined_color_alist = Qnil; |
| 7073 | 7033 | ||
| 7074 | #if SCALABLE_FONTS | ||
| 7075 | |||
| 7076 | DEFVAR_LISP ("scalable-fonts-allowed", &Vscalable_fonts_allowed, | 7034 | DEFVAR_LISP ("scalable-fonts-allowed", &Vscalable_fonts_allowed, |
| 7077 | "Allowed scalable fonts.\n\ | 7035 | "Allowed scalable fonts.\n\ |
| 7078 | A value of nil means don't allow any scalable fonts.\n\ | 7036 | A value of nil means don't allow any scalable fonts.\n\ |
| @@ -7086,7 +7044,6 @@ scaled if its name matches a regular expression in the list."); | |||
| 7086 | #else | 7044 | #else |
| 7087 | Vscalable_fonts_allowed = Qnil; | 7045 | Vscalable_fonts_allowed = Qnil; |
| 7088 | #endif | 7046 | #endif |
| 7089 | #endif /* SCALABLE_FONTS */ | ||
| 7090 | 7047 | ||
| 7091 | #ifdef HAVE_WINDOW_SYSTEM | 7048 | #ifdef HAVE_WINDOW_SYSTEM |
| 7092 | defsubr (&Sbitmap_spec_p); | 7049 | defsubr (&Sbitmap_spec_p); |