font_unset_attribute (Lisp_Object font_object, enum font_property_index index,
Lisp_Object symbol)
{
- Lisp_Object tail;
-
- tail = Vfont_fallback_ignored_attributes;
+ Lisp_Object tail = Vface_font_lax_matched_attributes;
FOR_EACH_TAIL_SAFE (tail)
{
#ifdef HAVE_WINDOW_SYSTEM
struct face *default_face;
struct frame *f;
- Lisp_Object stipple, underline, overline, strike_through, box, spec;
+ Lisp_Object stipple, underline, overline, strike_through, box;
eassert (FRAME_WINDOW_P (cache->f));
}
if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
{
- spec = copy_font_spec (attrs[LFACE_FONT_INDEX]);
+ Lisp_Object spec = copy_font_spec (attrs[LFACE_FONT_INDEX]);
/* Unset several values in SPEC, usually the width, slant,
and weight. The best possible values for these
fonts that are exact matches for these weight, slant and
width attributes, which leads to suboptimal or wrong font
choices. (bug#5934) */
- font_unset_attribute (spec, FONT_WEIGHT_INDEX, QCwidth);
+ font_unset_attribute (spec, FONT_WEIGHT_INDEX, QCweight);
font_unset_attribute (spec, FONT_SLANT_INDEX, QCslant);
font_unset_attribute (spec, FONT_WIDTH_INDEX, QCwidth);
/* Also allow unsetting other attributes for debugging
clear the face cache, see `clear-face-cache'. */);
face_near_same_color_threshold = 30000;
- DEFVAR_LISP ("font-fallback-ignored-attributes",
- Vfont_fallback_ignored_attributes,
- doc: /* A list of face attributes to ignore.
-
-List of font-related face attributes to ignore when realizing a face.
-This is a list of symbols representing face attributes that will be
-ignored by Emacs when realizing a face, and an exact match couldn't be
-found for its preferred font. For example:
-
- (:weight :slant :width)
-
-tells Emacs to ignore the `:weight', `:slant' and `:width' face
-attributes when searching for a font and an exact match could not be
-found for the font attributes specified in the face being realized. */);
- Vfont_fallback_ignored_attributes
- = list3 (QCwidth, QCslant, QCwidth);
+ DEFVAR_LISP ("face-font-lax-matched-attributes",
+ Vface_font_lax_matched_attributes,
+ doc: /* Font-related face attributes to match in lax manner when realizing faces.
+
+The value should be a list of face attribute symbols; see
+`set-face-attribute' for the full list of attributes. The
+corresponding face attributes will be treated as "soft" constraints
+when looking for suitable fonts: if an exact match is not possible,
+a font can be selected that is a close, but not an exact, match. For
+example, looking for a semi-bold font might select a bold or a medium
+font if no semi-bold font matching other attributes is found. Emacs
+still tries to find a font that is the closest possible match; in
+particular, if a font is available that matches the face attributes
+exactly, it will be selected.
+
+Note that if the `:extra' attribute is present in the value, it
+will be ignored. */);
+ Vface_font_lax_matched_attributes = list3 (QCweight, QCslant, QCwidth);
#ifdef HAVE_WINDOW_SYSTEM
defsubr (&Sbitmap_spec_p);