From: Kenichi Handa Date: Wed, 29 Apr 2009 01:40:57 +0000 (+0000) Subject: (x_set_font): When ARG is a font-object, check if the X-Git-Tag: emacs-pretest-23.0.93~29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=518c4881875ff7493ce8ff336ef15c1dc7994618;p=emacs.git (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. --- 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);