emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect font weight selected


From: Yuri D'Elia
Subject: Re: Incorrect font weight selected
Date: Sat, 18 Dec 2021 13:00:52 +0100
User-agent: mu4e 1.7.5; emacs 29.0.50

On Sat, Dec 18 2021, Eli Zaretskii wrote:
>> I assumed that when setting the default font (by calling
>> set-face-attribute with FRAME set to nil) the actual face selection
>> would be effectively delayed until frame creation time. I guess this is
>> incorrect - i/e font selection is done immediately?
>
> Yes.

Just out of curiosity, if you happen to know it, how does the "custom"
machinery does this then regarding to faces? It it also done in a frame
hook?

As it looks like we're able to alter the face
colors/parameters/inheritance at will, but still have to delay setting
the font family until the frame is setup. This is kind of ugly.

> You could use a simple flag variable for that.

Regarding that...

> Welcome to the club.  The code which selects fonts in Emacs is quite
> complex and notoriously under-documented.  On top of that, we don't
> have any experts on board who are familiar with that code and can
> readily answer questions such as this one.  The only way to
> investigate is to step through the code, starting in xfaces.c (where
> we process set-face-attribute), and following into font.c and
> fontset.c, where the font selection actually happens.

So I now moved the (set-face-attribute 'default nil ...) call to run
once after the first frame is created.

It works. But for the first frame only (!).

When I create a new frame, the second new frame still selects the wrong
weight.

Duh...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]