* Font weight selection problem
@ 2024-01-21 17:41 Nicolas P. Rougier (inria)
2024-01-23 17:28 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2024-01-21 17:41 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]
I'm using Emacs 29.2 on OSX and I'm having difficulty selecting a
font with the proper weight. The following simple script shows the
problem on my machine:
(set-frame-font "Roboto Mono-14:light")
(insert "test")
(insert (propertize "test" 'face '(:family "Roboto Mono" :weight
light)))
The set-frame-font installs the proper font and weight.
The first insert displays the text with light weight (as expected)
The second insert displays the text with a *regular* weight
(unexpected).
When I ask for char description for both displayed strings, Emacs
reports " mac-ct:-*-Roboto
Mono-regular-normal-normal-*-14-*-*-*-m-0-iso10646-1" for both
strings (even though the visual appearance is clearly different).
I think the problem has been here since at least version 28.0 (and
I solved it by creating a dedicated font file with a new name).
All necessary fonts are installed:
$ fc-list "Roboto Mono" -f '%{weight} %{style}\n' | sort -n
0 Thin
0 Thin Italic
[0 200]
[0 200]
50 Light
50 Light Italic
80 Italic
80 Regular
100 Medium
100 Medium Italic
200 Bold
200 Bold Italic
Nicolas
[-- Attachment #2: Screenshot 2024-01-21 at 18.26.51.png --]
[-- Type: image/png, Size: 65893 bytes --]
[-- Attachment #3: Type: text/plain, Size: 113 bytes --]
--
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-21 17:41 Font weight selection problem Nicolas P. Rougier (inria)
@ 2024-01-23 17:28 ` Eli Zaretskii
2024-01-23 17:39 ` Nicolas P. Rougier (inria)
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-23 17:28 UTC (permalink / raw)
To: Nicolas P. Rougier (inria); +Cc: emacs-devel
> From: "Nicolas P. Rougier (inria)" <nicolas.rougier@inria.fr>
> Date: Sun, 21 Jan 2024 18:41:42 +0100
>
> I'm using Emacs 29.2 on OSX and I'm having difficulty selecting a
> font with the proper weight. The following simple script shows the
> problem on my machine:
>
> (set-frame-font "Roboto Mono-14:light")
> (insert "test")
> (insert (propertize "test" 'face '(:family "Roboto Mono" :weight
> light)))
>
> The set-frame-font installs the proper font and weight.
> The first insert displays the text with light weight (as expected)
> The second insert displays the text with a *regular* weight
> (unexpected).
Did you try to change the order between :family and :weight in your
'propertize' call?
> I think the problem has been here since at least version 28.0
I'm not sure it was ever supported. Can you make that do what you
expect in older versions of Emacs?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-23 17:28 ` Eli Zaretskii
@ 2024-01-23 17:39 ` Nicolas P. Rougier (inria)
2024-01-23 18:47 ` Nicolas P. Rougier (inria)
0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2024-01-23 17:39 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On Tue 23 Jan 2024 at 19:28, Eli Zaretskii <eliz@gnu.org> wrote:
> Did you try to change the order between :family and :weight in
> your
> 'propertize' call?
No change.
> > I think the problem has been here since at least version 28.0
> I'm not sure it was ever supported. Can you make that do what
> you
> expect in older versions of Emacs?
With version 27.0 I was able to select the "Roboto Mono" light,
but version 28.0 did not work anymore for some reason. I solved
the issue by creating a font file with a unique weight (light)
(and named it differently). It looks as if Emacs is confused by
the "light" version inside the font but I don't know if the font
is malformed or if Emacs interprets "light" differently. I've
tried other fonts and the light face always ends up either thin or
regular, which makes me think that Emacs might be the cause.
I've since found what seems to be a relevant (small) patch:
https://github.com/yaglo/emacs-mac-patches/blob/main/fix_weights_and_widths.diff
but I did not tested it yet. The patch change values for weights
but I don't know what is the semantic of these values (and if it
is relevant here).
Nicolas
--
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-23 17:39 ` Nicolas P. Rougier (inria)
@ 2024-01-23 18:47 ` Nicolas P. Rougier (inria)
2024-01-24 9:33 ` Roman Rudakov
0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2024-01-23 18:47 UTC (permalink / raw)
To: Eli Zaretskii, emacs-devel
On Tue 23 Jan 2024 at 18:39, "Nicolas P. Rougier (inria)"
<nicolas.rougier@inria.fr> wrote:
> I've since found what seems to be a relevant (small) patch:
> https://github.com/yaglo/emacs-mac-patches/blob/main/fix_weights_and_widths.diff
>
> but I did not tested it yet. The patch change values for weights
> but I
> don't know what is the semantic of these values (and if it is
> relevant
> here).
Patch is working on my machine. However there it not much
information from the author. I can try to contact him to see if he
wants to propose a patch or discuss it here if you think it is
worth.
Nicolas
--
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-23 18:47 ` Nicolas P. Rougier (inria)
@ 2024-01-24 9:33 ` Roman Rudakov
2024-01-24 10:51 ` Nicolas P. Rougier (inria)
0 siblings, 1 reply; 11+ messages in thread
From: Roman Rudakov @ 2024-01-24 9:33 UTC (permalink / raw)
To: Nicolas P. Rougier (inria); +Cc: Eli Zaretskii, emacs-devel
"Nicolas P. Rougier (inria)" <nicolas.rougier@inria.fr> writes:
> On Tue 23 Jan 2024 at 18:39, "Nicolas P. Rougier (inria)"
> <nicolas.rougier@inria.fr> wrote:
>
>> I've since found what seems to be a relevant (small) patch:
>> https://github.com/yaglo/emacs-mac-patches/blob/main/fix_weights_and_widths.diff
>> but I did not tested it yet. The patch change values for weights
>> but
>> I
>> don't know what is the semantic of these values (and if it is
>> relevant
>> here).
>
> Patch is working on my machine. However there it not much
> information
> from the author. I can try to contact him to see if he wants to
> propose a patch or discuss it here if you think it is worth.
>
> Nicolas
Hello, I noticed that a similar patch was submitted to emacs-bugs
mailing list a while ago.
https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-06/msg00585.html
Looks like the author has signed a CA. Does it solve the same problem?
--
Best regards, Roman
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-24 9:33 ` Roman Rudakov
@ 2024-01-24 10:51 ` Nicolas P. Rougier (inria)
2024-01-27 11:14 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2024-01-24 10:51 UTC (permalink / raw)
To: rrudakov; +Cc: Eli Zaretskii, emacs-devel
On Wed 24 Jan 2024 at 10:33, Roman Rudakov <rrudakov@fastmail.com>
wrote:
> Hello, I noticed that a similar patch was submitted to
> emacs-bugs
> mailing list a while ago.
>
> https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-06/msg00585.html
>
> Looks like the author has signed a CA. Does it solve the same
> problem?
This is exactly that,.thanks.
I'll wait for the patch to be merged then.
Nicolas
--
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-24 10:51 ` Nicolas P. Rougier (inria)
@ 2024-01-27 11:14 ` Eli Zaretskii
2024-01-27 11:45 ` Po Lu
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-27 11:14 UTC (permalink / raw)
To: Nicolas P. Rougier (inria), Po Lu; +Cc: rrudakov, emacs-devel
> From: "Nicolas P. Rougier (inria)" <nicolas.rougier@inria.fr>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> Date: Wed, 24 Jan 2024 11:51:09 +0100
>
>
> On Wed 24 Jan 2024 at 10:33, Roman Rudakov <rrudakov@fastmail.com>
> wrote:
>
> > Hello, I noticed that a similar patch was submitted to
> > emacs-bugs
> > mailing list a while ago.
> >
> > https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-06/msg00585.html
> >
> > Looks like the author has signed a CA. Does it solve the same
> > problem?
>
> This is exactly that,.thanks.
> I'll wait for the patch to be merged then.
Po Lu, should we install that patch now? The copyright assignment is
on file.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-27 11:14 ` Eli Zaretskii
@ 2024-01-27 11:45 ` Po Lu
2024-01-27 11:48 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Po Lu @ 2024-01-27 11:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Nicolas P. Rougier (inria), rrudakov, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> Po Lu, should we install that patch now? The copyright assignment is
> on file.
I have no more objections, but as I recall it, we are still awaiting a
response from the author of the Mac font driver.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-27 11:45 ` Po Lu
@ 2024-01-27 11:48 ` Eli Zaretskii
2024-01-27 13:08 ` Po Lu
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-27 11:48 UTC (permalink / raw)
To: Po Lu; +Cc: nicolas.rougier, rrudakov, emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Cc: "Nicolas P. Rougier (inria)" <nicolas.rougier@inria.fr>,
> rrudakov@fastmail.com, emacs-devel@gnu.org
> Date: Sat, 27 Jan 2024 19:45:20 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Po Lu, should we install that patch now? The copyright assignment is
> > on file.
>
> I have no more objections, but as I recall it, we are still awaiting a
> response from the author of the Mac font driver.
How long should we wait? If the patch works for users of that
platform, we could keep waiting after installing it, no?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-27 11:48 ` Eli Zaretskii
@ 2024-01-27 13:08 ` Po Lu
2024-02-01 10:22 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Po Lu @ 2024-01-27 13:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: nicolas.rougier, rrudakov, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> How long should we wait? If the patch works for users of that
> platform, we could keep waiting after installing it, no?
Sure, no problem. Let's install then.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Font weight selection problem
2024-01-27 13:08 ` Po Lu
@ 2024-02-01 10:22 ` Eli Zaretskii
0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2024-02-01 10:22 UTC (permalink / raw)
To: Po Lu; +Cc: nicolas.rougier, rrudakov, emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Cc: nicolas.rougier@inria.fr, rrudakov@fastmail.com, emacs-devel@gnu.org
> Date: Sat, 27 Jan 2024 21:08:14 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > How long should we wait? If the patch works for users of that
> > platform, we could keep waiting after installing it, no?
>
> Sure, no problem. Let's install then.
Done.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-02-01 10:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 17:41 Font weight selection problem Nicolas P. Rougier (inria)
2024-01-23 17:28 ` Eli Zaretskii
2024-01-23 17:39 ` Nicolas P. Rougier (inria)
2024-01-23 18:47 ` Nicolas P. Rougier (inria)
2024-01-24 9:33 ` Roman Rudakov
2024-01-24 10:51 ` Nicolas P. Rougier (inria)
2024-01-27 11:14 ` Eli Zaretskii
2024-01-27 11:45 ` Po Lu
2024-01-27 11:48 ` Eli Zaretskii
2024-01-27 13:08 ` Po Lu
2024-02-01 10:22 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).