From 518c4881875ff7493ce8ff336ef15c1dc7994618 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 29 Apr 2009 01:40:57 +0000 Subject: [PATCH] (x_set_font): When ARG is a font-object, check if the font-object matches with the ASCII font-spec of the frame's fontset. If not, create a new fontset for the frame. --- src/frame.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/frame.c b/src/frame.c index 80a691e35fd..eb9088b5478 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3418,6 +3418,16 @@ x_set_font (f, arg, oldval) itself in the future. */ arg = AREF (font_object, FONT_NAME_INDEX); fontset = FRAME_FONTSET (f); + /* Check if we can use the current fontset. If not, set FONTSET + to -1 to generate a new fontset from FONT-OBJECT. */ + if (fontset >= 0) + { + Lisp_Object ascii_font = fontset_ascii (fontset); + Lisp_Object spec = font_spec_from_name (ascii_font); + + if (! font_match_p (spec, font_object)) + fontset = -1; + } } else signal_error ("Invalid font", arg); -- 2.39.2