From 27129af9d775855efb529d63d2d5c62af2699afe Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Jun 2008 01:57:19 +0000 Subject: [PATCH] * w32fns.c, xfns.c (Qfont_param): New var. (syms_of_w32fns): Initialize it. (x_default_font_parameter): Record explicit `font' into `font-parameter'. * faces.el (face-set-after-frame-default): Re-apply explicit `font' frame parameters after setting up the `default' face. --- lisp/ChangeLog | 5 +++++ lisp/faces.el | 3 ++- src/ChangeLog | 10 ++++++++-- src/w32fns.c | 8 ++++++++ src/xfns.c | 9 +++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 88debfeb812..90b9b297b55 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-06-19 Stefan Monnier + + * faces.el (face-set-after-frame-default): Re-apply explicit `font' + frame parameters after setting up the `default' face. + 2008-06-18 Stefan Monnier * faces.el (face-set-after-frame-default): Don't exclude `default'. diff --git a/lisp/faces.el b/lisp/faces.el index 251bacc5610..643b50a1316 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -703,7 +703,7 @@ like an underlying face would be, with higher priority than underlying faces." (put (or (get face 'face-alias) face) 'face-modified t)) (while args ;; Don't recursively set the attributes from the frame's font param - ;; when we update the frame's font param fro the attributes. + ;; when we update the frame's font param from the attributes. (let ((inhibit-face-set-after-frame-default t)) (if (and (eq (car args) :family) (stringp (cadr args)) @@ -2018,6 +2018,7 @@ Initialize colors of certain faces from frame parameters." ;; Find attributes that should be initialized from frame parameters. (let ((face-params '((foreground-color default :foreground) (background-color default :background) + (font-parameter default :font) (border-color border :background) (cursor-color cursor :background) (scroll-bar-foreground scroll-bar :foreground) diff --git a/src/ChangeLog b/src/ChangeLog index 60cff399cd7..6a920f22f9a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2008-06-19 Stefan Monnier + + * w32fns.c, xfns.c (Qfont_param): New var. + (syms_of_w32fns): Initialize it. + (x_default_font_parameter): Record explicit `font' into `font-parameter'. + 2008-06-18 Kenichi Handa * font.c (font_parse_xlfd): Fix previous change. @@ -24,9 +30,9 @@ 2008-06-18 Jason Rumney - * w32font.c (w32font_list, w32font_match): Add logging. + * w32font.c (w32font_list, w32font_match): Add logging. - * w32uniscribe (uniscribe_list, uniscribe_match): Add logging. + * w32uniscribe (uniscribe_list, uniscribe_match): Add logging. 2008-06-17 Chong Yidong diff --git a/src/w32fns.c b/src/w32fns.c index c31ee5be04d..34897314567 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -206,6 +206,7 @@ Lisp_Object Qnone; Lisp_Object Qsuppress_icon; Lisp_Object Qundefined_color; Lisp_Object Qcancel_timer; +Lisp_Object Qfont_param; Lisp_Object Qhyper; Lisp_Object Qsuper; Lisp_Object Qmeta; @@ -4295,6 +4296,12 @@ x_default_font_parameter (f, parms) if (NILP (font)) error ("No suitable font was found"); } + else + { + /* Remember the explicit font parameter, so we can re-apply it after + we've applied the `default' face settings. */ + x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font), Qnil)); + } x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); } @@ -8891,6 +8898,7 @@ syms_of_w32fns () DEFSYM (Qctrl, "ctrl"); DEFSYM (Qcontrol, "control"); DEFSYM (Qshift, "shift"); + DEFSYM (Qfont_param, "font-parameter"); /* This is the end of symbol initialization. */ /* Text property `display' should be nonsticky by default. */ diff --git a/src/xfns.c b/src/xfns.c index 57b14d3f9d2..58b03691e2f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -204,6 +204,7 @@ Lisp_Object Qnone; Lisp_Object Qsuppress_icon; Lisp_Object Qundefined_color; Lisp_Object Qcompound_text, Qcancel_timer; +static Lisp_Object Qfont_param; /* In dispnew.c */ @@ -3087,6 +3088,12 @@ x_default_font_parameter (f, parms) if (NILP (font)) error ("No suitable font was found"); } + else + { + /* Remember the explicit font parameter, so we can re-apply it after + we've applied the `default' face settings. */ + x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font), Qnil)); + } x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); } @@ -5854,6 +5861,8 @@ syms_of_xfns () staticpro (&Qcompound_text); Qcancel_timer = intern ("cancel-timer"); staticpro (&Qcancel_timer); + Qfont_param = intern ("font-parameter"); + staticpro (&Qfont_param); /* This is the end of symbol initialization. */ /* Text property `display' should be nonsticky by default. */ -- 2.39.2