diff options
| author | Eli Zaretskii | 2022-12-11 11:49:29 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-12-11 11:49:29 +0200 |
| commit | 2024ade271de1264f84c432eb925e4d610bc6bea (patch) | |
| tree | 8f597e60865145857d117229d494736c6af92b6d /src | |
| parent | f221105723dc8d3ee9f3c8d1c2717058afbc6666 (diff) | |
| download | emacs-2024ade271de1264f84c432eb925e4d610bc6bea.tar.gz emacs-2024ade271de1264f84c432eb925e4d610bc6bea.zip | |
; Improve docs of relaxing face-font attribute match (bug#59347)
* src/xfaces.c (realize_gui_face): Fix typo and coding style.
(syms_of_xfaces) <face-font-lax-matched-attributes>: A better name.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 88d3a79f8c0..2571b0d4694 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6021,9 +6021,7 @@ static void | |||
| 6021 | font_unset_attribute (Lisp_Object font_object, enum font_property_index index, | 6021 | font_unset_attribute (Lisp_Object font_object, enum font_property_index index, |
| 6022 | Lisp_Object symbol) | 6022 | Lisp_Object symbol) |
| 6023 | { | 6023 | { |
| 6024 | Lisp_Object tail; | 6024 | Lisp_Object tail = Vface_font_lax_matched_attributes; |
| 6025 | |||
| 6026 | tail = Vfont_fallback_ignored_attributes; | ||
| 6027 | 6025 | ||
| 6028 | FOR_EACH_TAIL_SAFE (tail) | 6026 | FOR_EACH_TAIL_SAFE (tail) |
| 6029 | { | 6027 | { |
| @@ -6046,7 +6044,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] | |||
| 6046 | #ifdef HAVE_WINDOW_SYSTEM | 6044 | #ifdef HAVE_WINDOW_SYSTEM |
| 6047 | struct face *default_face; | 6045 | struct face *default_face; |
| 6048 | struct frame *f; | 6046 | struct frame *f; |
| 6049 | Lisp_Object stipple, underline, overline, strike_through, box, spec; | 6047 | Lisp_Object stipple, underline, overline, strike_through, box; |
| 6050 | 6048 | ||
| 6051 | eassert (FRAME_WINDOW_P (cache->f)); | 6049 | eassert (FRAME_WINDOW_P (cache->f)); |
| 6052 | 6050 | ||
| @@ -6089,7 +6087,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] | |||
| 6089 | } | 6087 | } |
| 6090 | if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) | 6088 | if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) |
| 6091 | { | 6089 | { |
| 6092 | spec = copy_font_spec (attrs[LFACE_FONT_INDEX]); | 6090 | Lisp_Object spec = copy_font_spec (attrs[LFACE_FONT_INDEX]); |
| 6093 | 6091 | ||
| 6094 | /* Unset several values in SPEC, usually the width, slant, | 6092 | /* Unset several values in SPEC, usually the width, slant, |
| 6095 | and weight. The best possible values for these | 6093 | and weight. The best possible values for these |
| @@ -6102,7 +6100,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] | |||
| 6102 | fonts that are exact matches for these weight, slant and | 6100 | fonts that are exact matches for these weight, slant and |
| 6103 | width attributes, which leads to suboptimal or wrong font | 6101 | width attributes, which leads to suboptimal or wrong font |
| 6104 | choices. (bug#5934) */ | 6102 | choices. (bug#5934) */ |
| 6105 | font_unset_attribute (spec, FONT_WEIGHT_INDEX, QCwidth); | 6103 | font_unset_attribute (spec, FONT_WEIGHT_INDEX, QCweight); |
| 6106 | font_unset_attribute (spec, FONT_SLANT_INDEX, QCslant); | 6104 | font_unset_attribute (spec, FONT_SLANT_INDEX, QCslant); |
| 6107 | font_unset_attribute (spec, FONT_WIDTH_INDEX, QCwidth); | 6105 | font_unset_attribute (spec, FONT_WIDTH_INDEX, QCwidth); |
| 6108 | /* Also allow unsetting other attributes for debugging | 6106 | /* Also allow unsetting other attributes for debugging |
| @@ -7406,22 +7404,24 @@ Lisp programs that change the value of this variable should also | |||
| 7406 | clear the face cache, see `clear-face-cache'. */); | 7404 | clear the face cache, see `clear-face-cache'. */); |
| 7407 | face_near_same_color_threshold = 30000; | 7405 | face_near_same_color_threshold = 30000; |
| 7408 | 7406 | ||
| 7409 | DEFVAR_LISP ("font-fallback-ignored-attributes", | 7407 | DEFVAR_LISP ("face-font-lax-matched-attributes", |
| 7410 | Vfont_fallback_ignored_attributes, | 7408 | Vface_font_lax_matched_attributes, |
| 7411 | doc: /* A list of face attributes to ignore. | 7409 | doc: /* Font-related face attributes to match in lax manner when realizing faces. |
| 7412 | 7410 | ||
| 7413 | List of font-related face attributes to ignore when realizing a face. | 7411 | The value should be a list of face attribute symbols; see |
| 7414 | This is a list of symbols representing face attributes that will be | 7412 | `set-face-attribute' for the full list of attributes. The |
| 7415 | ignored by Emacs when realizing a face, and an exact match couldn't be | 7413 | corresponding face attributes will be treated as "soft" constraints |
| 7416 | found for its preferred font. For example: | 7414 | when looking for suitable fonts: if an exact match is not possible, |
| 7417 | 7415 | a font can be selected that is a close, but not an exact, match. For | |
| 7418 | (:weight :slant :width) | 7416 | example, looking for a semi-bold font might select a bold or a medium |
| 7419 | 7417 | font if no semi-bold font matching other attributes is found. Emacs | |
| 7420 | tells Emacs to ignore the `:weight', `:slant' and `:width' face | 7418 | still tries to find a font that is the closest possible match; in |
| 7421 | attributes when searching for a font and an exact match could not be | 7419 | particular, if a font is available that matches the face attributes |
| 7422 | found for the font attributes specified in the face being realized. */); | 7420 | exactly, it will be selected. |
| 7423 | Vfont_fallback_ignored_attributes | 7421 | |
| 7424 | = list3 (QCwidth, QCslant, QCwidth); | 7422 | Note that if the `:extra' attribute is present in the value, it |
| 7423 | will be ignored. */); | ||
| 7424 | Vface_font_lax_matched_attributes = list3 (QCweight, QCslant, QCwidth); | ||
| 7425 | 7425 | ||
| 7426 | #ifdef HAVE_WINDOW_SYSTEM | 7426 | #ifdef HAVE_WINDOW_SYSTEM |
| 7427 | defsubr (&Sbitmap_spec_p); | 7427 | defsubr (&Sbitmap_spec_p); |