# HG changeset patch # User Kenichi Handa # Date 1240969257 0 # Node ID 129ed78cd44207fab19f52e5e68a0b27e1512bec # Parent d98eb168e700c980bd4cc0f646783775a37f61b9 (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 -r d98eb168e700 -r 129ed78cd442 src/frame.c --- a/src/frame.c Tue Apr 28 21:29:47 2009 +0000 +++ b/src/frame.c Wed Apr 29 01:40:57 2009 +0000 @@ -3418,6 +3418,16 @@ 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);