changeset 98698:ef67b2d51a4d

(Finternal_set_lisp_face_attribute): If the font is to be updated, clear its average width field too.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 14 Oct 2008 04:08:08 +0000
parents 09e567998d7b
children f3c1254483a0
files src/xfaces.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Tue Oct 14 04:07:54 2008 +0000
+++ b/src/xfaces.c	Tue Oct 14 04:08:08 2008 +0000
@@ -3356,12 +3356,16 @@
     signal_error ("Invalid face attribute name", attr);
 
   if (prop_index)
-    /* If a font-related attribute other than QCfont and QCfontset is
-       specified, and if the original QCfont attribute has a font
-       (font-spec or font-object), set the corresponding property in
-       the font to nil so that the font selector doesn't think that
-       the attribute is mandatory.  */
-    font_clear_prop (XVECTOR (lface)->contents, prop_index);
+    {
+      /* If a font-related attribute other than QCfont and QCfontset
+	 is specified, and if the original QCfont attribute has a font
+	 (font-spec or font-object), set the corresponding property in
+	 the font to nil so that the font selector doesn't think that
+	 the attribute is mandatory.  Also, clear the average
+	 width.  */
+      font_clear_prop (XVECTOR (lface)->contents, prop_index);
+      font_clear_prop (XVECTOR (lface)->contents, FONT_AVGWIDTH_INDEX);
+    }
 
   /* Changing a named face means that all realized faces depending on
      that face are invalid.  Since we cannot tell which realized faces