GNU bug report logs - #19408
25.0.50; Incorrect handling of face-font-rescale-alist on startup mangles font settings

Previous Next

Package: emacs;

Reported by: Kirill Ignatiev <kirill.ignatiev <at> gmail.com>

Date: Thu, 18 Dec 2014 20:27:02 UTC

Severity: normal

Tags: moreinfo

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19408 in the body.
You can then email your comments to 19408 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19408; Package emacs. (Thu, 18 Dec 2014 20:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kirill Ignatiev <kirill.ignatiev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 18 Dec 2014 20:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Incorrect handling of face-font-rescale-alist on startup
 mangles font settings
Date: Thu, 18 Dec 2014 15:26:19 -0500
[Message part 1 (text/plain, inline)]
Take the following .emacs file:

(custom-set-faces
 '(default ((t (:inherit nil :height 110 :foundry "nil" :family
"Source Code Pro")))))

(add-to-list 'face-font-rescale-alist (cons (font-spec :family
"STIXGeneral") 0.95) t)

Run emacs with no other customizations, using -Q -l <file.el>. The
font in the initial frame in the scratch buffer will be Source Code
Pro, as expected. Open a new frame, the font in that frame will be
some other font (in my case Helvetica), not the default one.

During startup, if face-font-rescale-alist changes, emacs will mangle
the default font setting, causing it to be wrong for all non-initial
frames.

I found the following workaround:

;; Workaround for emacs/lisp/startup.el:670
(defadvice frame-notice-user-settings (before my:rescale-alist)
  ;; (message "Set face-font-rescale-alist")
  (add-to-list 'face-font-rescale-alist
      (cons (font-spec :family "STIXGeneral") 0.95) t))
(ad-activate 'frame-notice-user-settings)

for this particular bit of lisp/startup.el (line ~660)

 ;; FIXME: The user's init file may change
 ;; face-font-rescale-alist.  However, the default face
 ;; already has an assigned font object, which does not take
 ;; face-font-rescale-alist into account.  For such
 ;; situations, we ought to have a way to find all font
 ;; objects and regenerate them; currently we do not.  As a
 ;; workaround, we specifically reset te default face's :font
 ;; attribute here.  See bug#1785.
 (unless (eq face-font-rescale-alist
     old-face-font-rescale-alist)
   (set-face-attribute 'default nil :font (font-spec)))

I am not sure how the default font should be regenerated in case it's
affected by face-font-rescale-alist, but using (font-spec) is wrong
because it resets user's own settings.

I attached the output of report-emacs-bug.
[report-emacs-bug.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19408; Package emacs. (Thu, 03 Dec 2020 12:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 19408 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
Cc: 19408 <at> debbugs.gnu.org
Subject: Re: bug#19408: 25.0.50; Incorrect handling of
 face-font-rescale-alist on startup mangles font settings
Date: Thu, 03 Dec 2020 13:20:48 +0100
Kirill Ignatiev <kirill.ignatiev <at> gmail.com> writes:

> Take the following .emacs file:
>
> (custom-set-faces
>  '(default ((t (:inherit nil :height 110 :foundry "nil" :family
> "Source Code Pro")))))
>
> (add-to-list 'face-font-rescale-alist (cons (font-spec :family
> "STIXGeneral") 0.95) t)

(This bug report unfortunately got no response at the time.)

I'm not sure what font that is, but I tried this in Emacs 28:

# apt install fonts-stix
emacs -Q -l /tmp/stix.el

> Run emacs with no other customizations, using -Q -l <file.el>. The
> font in the initial frame in the scratch buffer will be Source Code
> Pro, as expected. Open a new frame, the font in that frame will be
> some other font (in my case Helvetica), not the default one.

I get

    ftcrhb:-GOOG-Noto Sans CJK KR-normal-normal-normal-*-39-*-*-*-*-0-iso10646-1 (#x2D)

in the initial frame, which I guess just means that I don't have Source
Code Pro.

I then `C-x 5 2', and query the new frame for the font it's using, and
it's the same one.

So I don't seem to be able to reproduce this problem in Emacs 28 -- are
you still seeing it in more recent Emacs versions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Dec 2020 12:22:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19408; Package emacs. (Thu, 03 Dec 2020 12:55:02 GMT) Full text and rfc822 format available.

Message #13 received at 19408 <at> debbugs.gnu.org (full text, mbox):

From: Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 19408 <at> debbugs.gnu.org
Subject: Re: bug#19408: 25.0.50; Incorrect handling of face-font-rescale-alist
 on startup mangles font settings
Date: Thu, 3 Dec 2020 12:53:49 +0000
No I don't get that any more, that was six years ago now. Thanks for
looking at it!

On Thu, 3 Dec 2020 at 12:20, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> Kirill Ignatiev <kirill.ignatiev <at> gmail.com> writes:
>
> > Take the following .emacs file:
> >
> > (custom-set-faces
> >  '(default ((t (:inherit nil :height 110 :foundry "nil" :family
> > "Source Code Pro")))))
> >
> > (add-to-list 'face-font-rescale-alist (cons (font-spec :family
> > "STIXGeneral") 0.95) t)
>
> (This bug report unfortunately got no response at the time.)
>
> I'm not sure what font that is, but I tried this in Emacs 28:
>
> # apt install fonts-stix
> emacs -Q -l /tmp/stix.el
>
> > Run emacs with no other customizations, using -Q -l <file.el>. The
> > font in the initial frame in the scratch buffer will be Source Code
> > Pro, as expected. Open a new frame, the font in that frame will be
> > some other font (in my case Helvetica), not the default one.
>
> I get
>
>     ftcrhb:-GOOG-Noto Sans CJK KR-normal-normal-normal-*-39-*-*-*-*-0-iso10646-1 (#x2D)
>
> in the initial frame, which I guess just means that I don't have Source
> Code Pro.
>
> I then `C-x 5 2', and query the new frame for the font it's using, and
> it's the same one.
>
> So I don't seem to be able to reproduce this problem in Emacs 28 -- are
> you still seeing it in more recent Emacs versions?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19408; Package emacs. (Thu, 03 Dec 2020 12:59:01 GMT) Full text and rfc822 format available.

Message #16 received at 19408 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kirill Ignatiev <kirill.ignatiev <at> gmail.com>
Cc: 19408 <at> debbugs.gnu.org
Subject: Re: bug#19408: 25.0.50; Incorrect handling of
 face-font-rescale-alist on startup mangles font settings
Date: Thu, 03 Dec 2020 13:58:45 +0100
Kirill Ignatiev <kirill.ignatiev <at> gmail.com> writes:

> No I don't get that any more, that was six years ago now. Thanks for
> looking at it!

Thanks for checking; closing the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 19408 <at> debbugs.gnu.org and Kirill Ignatiev <kirill.ignatiev <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Dec 2020 13:00:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Jan 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.