aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2022-12-11 11:49:29 +0200
committerEli Zaretskii2022-12-11 11:49:29 +0200
commit2024ade271de1264f84c432eb925e4d610bc6bea (patch)
tree8f597e60865145857d117229d494736c6af92b6d /src
parentf221105723dc8d3ee9f3c8d1c2717058afbc6666 (diff)
downloademacs-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.c44
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
6021font_unset_attribute (Lisp_Object font_object, enum font_property_index index, 6021font_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
7406clear the face cache, see `clear-face-cache'. */); 7404clear 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
7413List of font-related face attributes to ignore when realizing a face. 7411The value should be a list of face attribute symbols; see
7414This is a list of symbols representing face attributes that will be 7412`set-face-attribute' for the full list of attributes. The
7415ignored by Emacs when realizing a face, and an exact match couldn't be 7413corresponding face attributes will be treated as "soft" constraints
7416found for its preferred font. For example: 7414when looking for suitable fonts: if an exact match is not possible,
7417 7415a font can be selected that is a close, but not an exact, match. For
7418 (:weight :slant :width) 7416example, looking for a semi-bold font might select a bold or a medium
7419 7417font if no semi-bold font matching other attributes is found. Emacs
7420tells Emacs to ignore the `:weight', `:slant' and `:width' face 7418still tries to find a font that is the closest possible match; in
7421attributes when searching for a font and an exact match could not be 7419particular, if a font is available that matches the face attributes
7422found for the font attributes specified in the face being realized. */); 7420exactly, it will be selected.
7423 Vfont_fallback_ignored_attributes 7421
7424 = list3 (QCwidth, QCslant, QCwidth); 7422Note that if the `:extra' attribute is present in the value, it
7423will 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);