From 962e8aa92adf4e309468b4940f52bad683424654 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 13 Jan 2009 20:02:59 +0000 Subject: [PATCH] (font_clear_prop): If clearing the family, clear the font width index too. --- src/font.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/font.c b/src/font.c index 3cb48e3df7c..b7f4c42fc62 100644 --- a/src/font.c +++ b/src/font.c @@ -3083,7 +3083,13 @@ font_clear_prop (attrs, prop) if (prop == FONT_FAMILY_INDEX || prop == FONT_FOUNDRY_INDEX) { if (prop == FONT_FAMILY_INDEX) - ASET (font, FONT_FOUNDRY_INDEX, Qnil); + { + ASET (font, FONT_FOUNDRY_INDEX, Qnil); + /* If we are setting the font family, we must also clear + FONT_WIDTH_INDEX to avoid rejecting families that lack + support for some widths. */ + ASET (font, FONT_WIDTH_INDEX, Qnil); + } ASET (font, FONT_ADSTYLE_INDEX, Qnil); ASET (font, FONT_REGISTRY_INDEX, Qnil); ASET (font, FONT_SIZE_INDEX, Qnil); -- 2.39.2