aboutsummaryrefslogtreecommitdiffstats
path: root/src/fontset.c
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2009-03-19 06:50:41 +0000
committerKenichi Handa <[email protected]>2009-03-19 06:50:41 +0000
commit0875632e0069c5f841081671cee8e768a0f30677 (patch)
tree3e7562c4788e26cffbb8f1d833d8c2f525b333b2 /src/fontset.c
parentc68845e0581685a01e5a6f0603bdc29f9b39c5ef (diff)
(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.
Diffstat (limited to 'src/fontset.c')
-rw-r--r--src/fontset.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 47f99c59d2..51568a50d4 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1612,39 +1612,42 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
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;
}