# HG changeset patch # User Kenichi Handa # Date 1237445441 0 # Node ID 8cacd0d8fb30a57acc090c32db7016fec31f95c5 # Parent eaf39e07d5ea8cd2a3b8a2d8534e1e2d0157a6e4 (Fset_fontset_font): When a spec of ASCII font is changed, use font_load_for_lface to get a new font object. Call free_realized_fontset after handling ASCII font change. diff -r eaf39e07d5ea -r 8cacd0d8fb30 src/fontset.c --- a/src/fontset.c Thu Mar 19 06:26:04 2009 +0000 +++ b/src/fontset.c Thu Mar 19 06:50:41 2009 +0000 @@ -1612,39 +1612,42 @@ for (; CONSP (range_list); range_list = XCDR (range_list)) FONTSET_ADD (fontset, XCAR (range_list), font_def, add); - /* Free all realized fontsets whose base is FONTSET. This way, the - specified character(s) are surely redisplayed by a correct - font. */ - free_realized_fontsets (fontset); - if (ascii_changed) { Lisp_Object tail, frame, alist; int fontset_id = XINT (FONTSET_ID (fontset)); - alist = Qnil; FONTSET_ASCII (fontset) = fontname; name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, frame) { FRAME_PTR f = XFRAME (frame); Lisp_Object font_object; + struct face *face; - if (FRAME_INITIAL_P(f) || FRAME_TERMCAP_P (f)) + if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f)) continue; if (fontset_id != FRAME_FONTSET (f)) continue; - font_object = font_open_by_spec (f, font_spec); + face = FACE_FROM_ID (f, DEFAULT_FACE_ID); + if (face) + font_object = font_load_for_lface (f, face->lface, font_spec); + else + font_object = font_open_by_spec (f, font_spec); if (! NILP (font_object)) { update_auto_fontset_alist (font_object, fontset); - if (NILP (alist)) - alist = Fcons (Fcons (Qfont, name), Qnil); + alist = Fcons (Fcons (Qfont, Fcons (name, font_object)), Qnil); Fmodify_frame_parameters (frame, alist); } } } + /* Free all realized fontsets whose base is FONTSET. This way, the + specified character(s) are surely redisplayed by a correct + font. */ + free_realized_fontsets (fontset); + return Qnil; }