Mercurial > emacs
comparison src/xfaces.c @ 95865:99530dd346d3
(LFACE_FOUNDRY): New macro.
(check_lface_attrs): Check foundry.
(set_lface_from_font): Don't parse "FOUNDRY-FAMILY" from.
(merge_face_vectors): Check foundry.
(merge_face_ref): Likewise.
(Finternal_set_lisp_face_attribute): Likewise.
(x_update_menu_appearance): Likewise.
(Finternal_get_lisp_face_attribute): Likewise.
(lface_hash): Likewise.
(lface_same_font_attributes_p): Likewise.
(x_supports_face_attributes_p): Likewise.
(tty_supports_face_attributes_p): Likewise.
(Finternal_set_alternative_font_family_alist): Intern strings.
(Finternal_set_alternative_font_registry_alist): Downcase strings.
(realize_default_face): Set LFACE_FOUNDRY (lface).
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 13 Jun 2008 02:08:32 +0000 |
parents | fa7d768bdd0b |
children | 6cece6cbe017 |
comparison
equal
deleted
inserted
replaced
95864:1388820636da | 95865:99530dd346d3 |
---|---|
25 changed by defining `faces'. Each face can specify the following | 25 changed by defining `faces'. Each face can specify the following |
26 display attributes: | 26 display attributes: |
27 | 27 |
28 1. Font family name. | 28 1. Font family name. |
29 | 29 |
30 2. Relative proportionate width, aka character set width or set | 30 2. Font foundary name. |
31 | |
32 3. Relative proportionate width, aka character set width or set | |
31 width (swidth), e.g. `semi-compressed'. | 33 width (swidth), e.g. `semi-compressed'. |
32 | 34 |
33 3. Font height in 1/10pt. | 35 4. Font height in 1/10pt. |
34 | 36 |
35 4. Font weight, e.g. `bold'. | 37 5. Font weight, e.g. `bold'. |
36 | 38 |
37 5. Font slant, e.g. `italic'. | 39 6. Font slant, e.g. `italic'. |
38 | 40 |
39 6. Foreground color. | 41 7. Foreground color. |
40 | 42 |
41 7. Background color. | 43 8. Background color. |
42 | 44 |
43 8. Whether or not characters should be underlined, and in what color. | 45 9. Whether or not characters should be underlined, and in what color. |
44 | 46 |
45 9. Whether or not characters should be displayed in inverse video. | 47 10. Whether or not characters should be displayed in inverse video. |
46 | 48 |
47 10. A background stipple, a bitmap. | 49 11. A background stipple, a bitmap. |
48 | 50 |
49 11. Whether or not characters should be overlined, and in what color. | 51 12. Whether or not characters should be overlined, and in what color. |
50 | 52 |
51 12. Whether or not characters should be strike-through, and in what | 53 13. Whether or not characters should be strike-through, and in what |
52 color. | 54 color. |
53 | 55 |
54 13. Whether or not a box should be drawn around characters, the box | 56 14. Whether or not a box should be drawn around characters, the box |
55 type, and, for simple boxes, in what color. | 57 type, and, for simple boxes, in what color. |
56 | 58 |
57 14. Font-spec, or nil. This is a special attribute. | 59 15. Font-spec, or nil. This is a special attribute. |
58 | 60 |
59 A font-spec is a collection of font attributes (specs). | 61 A font-spec is a collection of font attributes (specs). |
60 | 62 |
61 When this attribute is specified, the face uses a font matching | 63 When this attribute is specified, the face uses a font matching |
62 with the specs as is except for what overwritten by the specs in | 64 with the specs as is except for what overwritten by the specs in |
511 static int may_use_scalable_font_p P_ ((const char *)); | 513 static int may_use_scalable_font_p P_ ((const char *)); |
512 static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object)); | 514 static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object)); |
513 static int get_lface_attributes P_ ((struct frame *, Lisp_Object, Lisp_Object *, | 515 static int get_lface_attributes P_ ((struct frame *, Lisp_Object, Lisp_Object *, |
514 int, struct named_merge_point *)); | 516 int, struct named_merge_point *)); |
515 static int load_pixmap P_ ((struct frame *, Lisp_Object, unsigned *, unsigned *)); | 517 static int load_pixmap P_ ((struct frame *, Lisp_Object, unsigned *, unsigned *)); |
516 static unsigned char *xstrlwr P_ ((unsigned char *)); | |
517 static struct frame *frame_or_selected_frame P_ ((Lisp_Object, int)); | 518 static struct frame *frame_or_selected_frame P_ ((Lisp_Object, int)); |
518 static void load_face_colors P_ ((struct frame *, struct face *, Lisp_Object *)); | 519 static void load_face_colors P_ ((struct frame *, struct face *, Lisp_Object *)); |
519 static void free_face_colors P_ ((struct frame *, struct face *)); | 520 static void free_face_colors P_ ((struct frame *, struct face *)); |
520 static int face_color_gray_p P_ ((struct frame *, char *)); | 521 static int face_color_gray_p P_ ((struct frame *, char *)); |
521 static struct face *realize_face P_ ((struct face_cache *, Lisp_Object *, | 522 static struct face *realize_face P_ ((struct face_cache *, Lisp_Object *, |
1959 ***********************************************************************/ | 1960 ***********************************************************************/ |
1960 | 1961 |
1961 /* Access face attributes of face LFACE, a Lisp vector. */ | 1962 /* Access face attributes of face LFACE, a Lisp vector. */ |
1962 | 1963 |
1963 #define LFACE_FAMILY(LFACE) AREF ((LFACE), LFACE_FAMILY_INDEX) | 1964 #define LFACE_FAMILY(LFACE) AREF ((LFACE), LFACE_FAMILY_INDEX) |
1965 #define LFACE_FOUNDRY(LFACE) AREF ((LFACE), LFACE_FOUNDRY_INDEX) | |
1964 #define LFACE_HEIGHT(LFACE) AREF ((LFACE), LFACE_HEIGHT_INDEX) | 1966 #define LFACE_HEIGHT(LFACE) AREF ((LFACE), LFACE_HEIGHT_INDEX) |
1965 #define LFACE_WEIGHT(LFACE) AREF ((LFACE), LFACE_WEIGHT_INDEX) | 1967 #define LFACE_WEIGHT(LFACE) AREF ((LFACE), LFACE_WEIGHT_INDEX) |
1966 #define LFACE_SLANT(LFACE) AREF ((LFACE), LFACE_SLANT_INDEX) | 1968 #define LFACE_SLANT(LFACE) AREF ((LFACE), LFACE_SLANT_INDEX) |
1967 #define LFACE_UNDERLINE(LFACE) AREF ((LFACE), LFACE_UNDERLINE_INDEX) | 1969 #define LFACE_UNDERLINE(LFACE) AREF ((LFACE), LFACE_UNDERLINE_INDEX) |
1968 #define LFACE_INVERSE(LFACE) AREF ((LFACE), LFACE_INVERSE_INDEX) | 1970 #define LFACE_INVERSE(LFACE) AREF ((LFACE), LFACE_INVERSE_INDEX) |
1995 Lisp_Object *attrs; | 1997 Lisp_Object *attrs; |
1996 { | 1998 { |
1997 xassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) | 1999 xassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) |
1998 || IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX]) | 2000 || IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX]) |
1999 || STRINGP (attrs[LFACE_FAMILY_INDEX])); | 2001 || STRINGP (attrs[LFACE_FAMILY_INDEX])); |
2002 xassert (UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX]) | |
2003 || IGNORE_DEFFACE_P (attrs[LFACE_FOUNDRY_INDEX]) | |
2004 || STRINGP (attrs[LFACE_FOUNDRY_INDEX])); | |
2000 xassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) | 2005 xassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) |
2001 || IGNORE_DEFFACE_P (attrs[LFACE_SWIDTH_INDEX]) | 2006 || IGNORE_DEFFACE_P (attrs[LFACE_SWIDTH_INDEX]) |
2002 || SYMBOLP (attrs[LFACE_SWIDTH_INDEX])); | 2007 || SYMBOLP (attrs[LFACE_SWIDTH_INDEX])); |
2003 xassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) | 2008 xassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) |
2004 || IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX]) | 2009 || IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX]) |
2364 new frames would never take effect. If the font doesn't have a | 2369 new frames would never take effect. If the font doesn't have a |
2365 specific property, set a normal value for that. */ | 2370 specific property, set a normal value for that. */ |
2366 | 2371 |
2367 if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface))) | 2372 if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface))) |
2368 { | 2373 { |
2374 Lisp_Object family = AREF (font_object, FONT_FAMILY_INDEX); | |
2375 | |
2376 LFACE_FAMILY (lface) = SYMBOL_NAME (family); | |
2377 } | |
2378 | |
2379 if (force_p || UNSPECIFIEDP (LFACE_FOUNDRY (lface))) | |
2380 { | |
2369 Lisp_Object foundry = AREF (font_object, FONT_FOUNDRY_INDEX); | 2381 Lisp_Object foundry = AREF (font_object, FONT_FOUNDRY_INDEX); |
2370 Lisp_Object family = AREF (font_object, FONT_FAMILY_INDEX); | 2382 |
2371 | 2383 LFACE_FOUNDRY (lface) = SYMBOL_NAME (foundry); |
2372 if (! NILP (foundry)) | |
2373 { | |
2374 if (! NILP (family)) | |
2375 val = concat3 (SYMBOL_NAME (foundry), build_string ("-"), | |
2376 SYMBOL_NAME (family)); | |
2377 else | |
2378 val = concat2 (SYMBOL_NAME (foundry), build_string ("-*")); | |
2379 } | |
2380 else | |
2381 { | |
2382 if (! NILP (family)) | |
2383 val = SYMBOL_NAME (family); | |
2384 else | |
2385 val = build_string ("*"); | |
2386 } | |
2387 LFACE_FAMILY (lface) = val; | |
2388 } | 2384 } |
2389 | 2385 |
2390 if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface))) | 2386 if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface))) |
2391 { | 2387 { |
2392 int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy); | 2388 int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy); |
2515 { | 2511 { |
2516 to[i] = from[i]; | 2512 to[i] = from[i]; |
2517 if (i >= LFACE_FAMILY_INDEX && i <=LFACE_SLANT_INDEX) | 2513 if (i >= LFACE_FAMILY_INDEX && i <=LFACE_SLANT_INDEX) |
2518 font_clear_prop (to, | 2514 font_clear_prop (to, |
2519 (i == LFACE_FAMILY_INDEX ? FONT_FAMILY_INDEX | 2515 (i == LFACE_FAMILY_INDEX ? FONT_FAMILY_INDEX |
2516 : i == LFACE_FOUNDRY_INDEX ? FONT_FOUNDRY_INDEX | |
2520 : i == LFACE_SWIDTH_INDEX ? FONT_WIDTH_INDEX | 2517 : i == LFACE_SWIDTH_INDEX ? FONT_WIDTH_INDEX |
2521 : i == LFACE_HEIGHT_INDEX ? FONT_SIZE_INDEX | 2518 : i == LFACE_HEIGHT_INDEX ? FONT_SIZE_INDEX |
2522 : i == LFACE_WEIGHT_INDEX ? FONT_WEIGHT_INDEX | 2519 : i == LFACE_WEIGHT_INDEX ? FONT_WEIGHT_INDEX |
2523 : FONT_SLANT_INDEX)); | 2520 : FONT_SLANT_INDEX)); |
2524 } | 2521 } |
2646 { | 2643 { |
2647 if (STRINGP (value)) | 2644 if (STRINGP (value)) |
2648 { | 2645 { |
2649 to[LFACE_FAMILY_INDEX] = value; | 2646 to[LFACE_FAMILY_INDEX] = value; |
2650 font_clear_prop (to, FONT_FAMILY_INDEX); | 2647 font_clear_prop (to, FONT_FAMILY_INDEX); |
2648 } | |
2649 else | |
2650 err = 1; | |
2651 } | |
2652 else if (EQ (keyword, QCfoundry)) | |
2653 { | |
2654 if (STRINGP (value)) | |
2655 { | |
2656 to[LFACE_FOUNDRY_INDEX] = value; | |
2657 font_clear_prop (to, FONT_FOUNDRY_INDEX); | |
2651 } | 2658 } |
2652 else | 2659 else |
2653 err = 1; | 2660 err = 1; |
2654 } | 2661 } |
2655 else if (EQ (keyword, QCheight)) | 2662 else if (EQ (keyword, QCheight)) |
3050 } | 3057 } |
3051 old_value = LFACE_FAMILY (lface); | 3058 old_value = LFACE_FAMILY (lface); |
3052 LFACE_FAMILY (lface) = value; | 3059 LFACE_FAMILY (lface) = value; |
3053 prop_index = FONT_FAMILY_INDEX; | 3060 prop_index = FONT_FAMILY_INDEX; |
3054 } | 3061 } |
3062 else if (EQ (attr, QCfoundry)) | |
3063 { | |
3064 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) | |
3065 { | |
3066 CHECK_STRING (value); | |
3067 if (SCHARS (value) == 0) | |
3068 signal_error ("Invalid face foundry", value); | |
3069 } | |
3070 old_value = LFACE_FOUNDRY (lface); | |
3071 LFACE_FOUNDRY (lface) = value; | |
3072 prop_index = FONT_FOUNDRY_INDEX; | |
3073 } | |
3055 else if (EQ (attr, QCheight)) | 3074 else if (EQ (attr, QCheight)) |
3056 { | 3075 { |
3057 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) | 3076 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) |
3058 { | 3077 { |
3059 Lisp_Object test; | 3078 Lisp_Object test; |
3728 changed_p = 1; | 3747 changed_p = 1; |
3729 } | 3748 } |
3730 | 3749 |
3731 if (face->font | 3750 if (face->font |
3732 && (!UNSPECIFIEDP (LFACE_FAMILY (lface)) | 3751 && (!UNSPECIFIEDP (LFACE_FAMILY (lface)) |
3752 || !UNSPECIFIEDP (LFACE_FOUNDRY (lface)) | |
3733 || !UNSPECIFIEDP (LFACE_SWIDTH (lface)) | 3753 || !UNSPECIFIEDP (LFACE_SWIDTH (lface)) |
3734 || !UNSPECIFIEDP (LFACE_WEIGHT (lface)) | 3754 || !UNSPECIFIEDP (LFACE_WEIGHT (lface)) |
3735 || !UNSPECIFIEDP (LFACE_SLANT (lface)) | 3755 || !UNSPECIFIEDP (LFACE_SLANT (lface)) |
3736 || !UNSPECIFIEDP (LFACE_HEIGHT (lface)))) | 3756 || !UNSPECIFIEDP (LFACE_HEIGHT (lface)))) |
3737 { | 3757 { |
3844 lface = lface_from_face_name (XFRAME (frame), symbol, 1); | 3864 lface = lface_from_face_name (XFRAME (frame), symbol, 1); |
3845 } | 3865 } |
3846 | 3866 |
3847 if (EQ (keyword, QCfamily)) | 3867 if (EQ (keyword, QCfamily)) |
3848 value = LFACE_FAMILY (lface); | 3868 value = LFACE_FAMILY (lface); |
3869 else if (EQ (keyword, QCfoundry)) | |
3870 value = LFACE_FOUNDRY (lface); | |
3849 else if (EQ (keyword, QCheight)) | 3871 else if (EQ (keyword, QCheight)) |
3850 value = LFACE_HEIGHT (lface); | 3872 value = LFACE_HEIGHT (lface); |
3851 else if (EQ (keyword, QCweight)) | 3873 else if (EQ (keyword, QCweight)) |
3852 value = LFACE_WEIGHT (lface); | 3874 value = LFACE_WEIGHT (lface); |
3853 else if (EQ (keyword, QCslant)) | 3875 else if (EQ (keyword, QCslant)) |
4154 static INLINE unsigned | 4176 static INLINE unsigned |
4155 lface_hash (v) | 4177 lface_hash (v) |
4156 Lisp_Object *v; | 4178 Lisp_Object *v; |
4157 { | 4179 { |
4158 return (hash_string_case_insensitive (v[LFACE_FAMILY_INDEX]) | 4180 return (hash_string_case_insensitive (v[LFACE_FAMILY_INDEX]) |
4181 ^ hash_string_case_insensitive (v[LFACE_FOUNDRY_INDEX]) | |
4159 ^ hash_string_case_insensitive (v[LFACE_FOREGROUND_INDEX]) | 4182 ^ hash_string_case_insensitive (v[LFACE_FOREGROUND_INDEX]) |
4160 ^ hash_string_case_insensitive (v[LFACE_BACKGROUND_INDEX]) | 4183 ^ hash_string_case_insensitive (v[LFACE_BACKGROUND_INDEX]) |
4161 ^ XHASH (v[LFACE_WEIGHT_INDEX]) | 4184 ^ XHASH (v[LFACE_WEIGHT_INDEX]) |
4162 ^ XHASH (v[LFACE_SLANT_INDEX]) | 4185 ^ XHASH (v[LFACE_SLANT_INDEX]) |
4163 ^ XHASH (v[LFACE_SWIDTH_INDEX]) | 4186 ^ XHASH (v[LFACE_SWIDTH_INDEX]) |
4176 { | 4199 { |
4177 xassert (lface_fully_specified_p (lface1) | 4200 xassert (lface_fully_specified_p (lface1) |
4178 && lface_fully_specified_p (lface2)); | 4201 && lface_fully_specified_p (lface2)); |
4179 return (xstrcasecmp (SDATA (lface1[LFACE_FAMILY_INDEX]), | 4202 return (xstrcasecmp (SDATA (lface1[LFACE_FAMILY_INDEX]), |
4180 SDATA (lface2[LFACE_FAMILY_INDEX])) == 0 | 4203 SDATA (lface2[LFACE_FAMILY_INDEX])) == 0 |
4204 && xstrcasecmp (SDATA (lface1[LFACE_FOUNDRY_INDEX]), | |
4205 SDATA (lface2[LFACE_FOUNDRY_INDEX])) == 0 | |
4181 && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX]) | 4206 && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX]) |
4182 && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX]) | 4207 && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX]) |
4183 && EQ (lface1[LFACE_WEIGHT_INDEX], lface2[LFACE_WEIGHT_INDEX]) | 4208 && EQ (lface1[LFACE_WEIGHT_INDEX], lface2[LFACE_WEIGHT_INDEX]) |
4184 && EQ (lface1[LFACE_SLANT_INDEX], lface2[LFACE_SLANT_INDEX]) | 4209 && EQ (lface1[LFACE_SLANT_INDEX], lface2[LFACE_SLANT_INDEX]) |
4185 && EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX]) | 4210 && EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX]) |
5014 return 0; | 5039 return 0; |
5015 | 5040 |
5016 /* Check font-related attributes, as those are the most commonly | 5041 /* Check font-related attributes, as those are the most commonly |
5017 "unsupported" on a window-system (because of missing fonts). */ | 5042 "unsupported" on a window-system (because of missing fonts). */ |
5018 if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) | 5043 if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) |
5044 || !UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX]) | |
5019 || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) | 5045 || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) |
5020 || !UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX]) | 5046 || !UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX]) |
5021 || !UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX]) | 5047 || !UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX]) |
5022 || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX])) | 5048 || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX])) |
5023 { | 5049 { |
5101 consider :slant unsupportable on ttys, even though the face code | 5127 consider :slant unsupportable on ttys, even though the face code |
5102 actually `fakes' them using a dim attribute if possible. This is | 5128 actually `fakes' them using a dim attribute if possible. This is |
5103 because the faked result is too different from what the face | 5129 because the faked result is too different from what the face |
5104 specifies. */ | 5130 specifies. */ |
5105 if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) | 5131 if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) |
5132 || !UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX]) | |
5106 || !UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX]) | 5133 || !UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX]) |
5107 || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) | 5134 || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) |
5108 || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) | 5135 || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) |
5109 || !UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) | 5136 || !UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) |
5110 || !UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) | 5137 || !UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) |
5400 Each ALTERNATIVE is tried in order if no fonts of font family FAMILY can | 5427 Each ALTERNATIVE is tried in order if no fonts of font family FAMILY can |
5401 be found. Value is ALIST. */) | 5428 be found. Value is ALIST. */) |
5402 (alist) | 5429 (alist) |
5403 Lisp_Object alist; | 5430 Lisp_Object alist; |
5404 { | 5431 { |
5432 Lisp_Object tail, tail2; | |
5433 | |
5405 CHECK_LIST (alist); | 5434 CHECK_LIST (alist); |
5435 alist = Fcopy_sequence (alist); | |
5436 for (tail = alist; CONSP (tail); tail = XCDR (tail)) | |
5437 for (tail2 = XCAR (tail); CONSP (tail2); tail2 = XCDR (tail2)) | |
5438 XSETCAR (tail2, Fintern (XCAR (tail2), Qnil)); | |
5406 Vface_alternative_font_family_alist = alist; | 5439 Vface_alternative_font_family_alist = alist; |
5407 free_all_realized_faces (Qnil); | 5440 free_all_realized_faces (Qnil); |
5408 return alist; | 5441 return alist; |
5409 } | 5442 } |
5410 | 5443 |
5417 Each ALTERNATIVE is tried in order if no fonts of font registry REGISTRY can | 5450 Each ALTERNATIVE is tried in order if no fonts of font registry REGISTRY can |
5418 be found. Value is ALIST. */) | 5451 be found. Value is ALIST. */) |
5419 (alist) | 5452 (alist) |
5420 Lisp_Object alist; | 5453 Lisp_Object alist; |
5421 { | 5454 { |
5455 Lisp_Object tail, tail2; | |
5456 | |
5422 CHECK_LIST (alist); | 5457 CHECK_LIST (alist); |
5458 alist = Fcopy_sequence (alist); | |
5459 for (tail = alist; CONSP (tail); tail = XCDR (tail)) | |
5460 for (tail2 = XCAR (tail); CONSP (tail2); tail2 = XCDR (tail2)) | |
5461 XSETCAR (tail2, Fdowncase (XCAR (tail2))); | |
5423 Vface_alternative_font_registry_alist = alist; | 5462 Vface_alternative_font_registry_alist = alist; |
5424 free_all_realized_faces (Qnil); | 5463 free_all_realized_faces (Qnil); |
5425 return alist; | 5464 return alist; |
5426 } | 5465 } |
5427 | 5466 |
5540 #endif /* HAVE_WINDOW_SYSTEM */ | 5579 #endif /* HAVE_WINDOW_SYSTEM */ |
5541 | 5580 |
5542 if (!FRAME_WINDOW_P (f)) | 5581 if (!FRAME_WINDOW_P (f)) |
5543 { | 5582 { |
5544 LFACE_FAMILY (lface) = build_string ("default"); | 5583 LFACE_FAMILY (lface) = build_string ("default"); |
5584 LFACE_FOUNDRY (lface) = LFACE_FAMILY (lface); | |
5545 LFACE_SWIDTH (lface) = Qnormal; | 5585 LFACE_SWIDTH (lface) = Qnormal; |
5546 LFACE_HEIGHT (lface) = make_number (1); | 5586 LFACE_HEIGHT (lface) = make_number (1); |
5547 if (UNSPECIFIEDP (LFACE_WEIGHT (lface))) | 5587 if (UNSPECIFIEDP (LFACE_WEIGHT (lface))) |
5548 LFACE_WEIGHT (lface) = Qnormal; | 5588 LFACE_WEIGHT (lface) = Qnormal; |
5549 if (UNSPECIFIEDP (LFACE_SLANT (lface))) | 5589 if (UNSPECIFIEDP (LFACE_SLANT (lface))) |