Rebuilt today emacs on 36d873bf0d3f1185d0090e4b506a6a726476aec6, I
noticed when I start a fresh new instance of emacs the selected weight
for my default font is 'normal instead of 'medium.
I'm currently using Iosevka, which provides both regular and medium
weights, which I suspect interacts with the recent commit
1b2511fa2aed460120a36765ba16c14e355eef1d.
This is why I currently do in my init.el:
(set-face-attribute 'default nil :family "Iosevka"
:height 140 :weight 'medium)
If I re-evaluate this _after_ the frame has been created though, the
correct weight is selected.
> From: Yuri D'Elia <wavexx@thregr.org>> Date: Fri, 17 Dec 2021 15:51:58 +0100> > Rebuilt today emacs on 36d873bf0d3f1185d0090e4b506a6a726476aec6, I> noticed when I start a fresh new instance of emacs the selected weight> for my default font is 'normal instead of 'medium.
Emacs by default requests the normal (a.k.a. "regular") weight, so
what you see now is the correct expected behavior. If previously
Emacs selected the "medium" weight, that was a subtle bug.
> This is why I currently do in my init.el:> > (set-face-attribute 'default nil :family "Iosevka"> :height 140 :weight 'medium)> > If I re-evaluate this _after_ the frame has been created though, the> correct weight is selected.
This is the intended behavior, so I don't think there's anything we
need to fix here.
Hello,
On Fri 17 Dec 2021 at 03:51PM +01, Yuri D'Elia wrote:
> Rebuilt today emacs on 36d873bf0d3f1185d0090e4b506a6a726476aec6, I> noticed when I start a fresh new instance of emacs the selected weight> for my default font is 'normal instead of 'medium.>> I'm currently using Iosevka, which provides both regular and medium> weights, which I suspect interacts with the recent commit> 1b2511fa2aed460120a36765ba16c14e355eef1d.>> This is why I currently do in my init.el:>> (set-face-attribute 'default nil :family "Iosevka"> :height 140 :weight 'medium)>> If I re-evaluate this _after_ the frame has been created though, the> correct weight is selected.
I am seeing something similar but distinct, I think. I'm using pgtk.
If I use M-: to evaluate this form
(set-frame-font (font-spec :name "Inconsolata-13" :weight 'medium))
then what I get is the regular weight, not the medium weight. It is as
though the :weight parameter is being completely ignored.
--
Sean Whitton
> From: Sean Whitton <spwhitton@spwhitton.name>> Date: Sat, 18 Dec 2021 16:26:16 -0700> > I am seeing something similar but distinct, I think. I'm using pgtk.> If I use M-: to evaluate this form> > (set-frame-font (font-spec :name "Inconsolata-13" :weight 'medium))> > then what I get is the regular weight, not the medium weight. It is as> though the :weight parameter is being completely ignored.
Does that font have the 'medium' weight?
On Sun, Dec 19 2021, Eli Zaretskii wrote:
>> (set-frame-font (font-spec :name "Inconsolata-13" :weight 'medium))>>>> then what I get is the regular weight, not the medium weight. It is as>> though the :weight parameter is being completely ignored.>> Does that font have the 'medium' weight?
$ fc-list 'Inconsolata' | grep Medium
/usr/share/fonts/truetype/inconsolata/Inconsolata.otf: Inconsolata:style=Medium
However:
$ fc-list 'Iosevka' -f '%{style}\n' | grep Medium
Medium Extended Oblique,Regular
Medium Extended,Regular
Medium Oblique,Regular
Medium Italic,Italic
Medium Extended Italic,Italic
Medium,Regular
^^^^^^^^^^^^^^
Note that "Regular" exists as a style on it's own.
> From: Yuri D'Elia <wavexx@thregr.org>> Cc: Sean Whitton <spwhitton@spwhitton.name>, emacs-devel@gnu.org> Date: Sun, 19 Dec 2021 12:29:10 +0100> > On Sun, Dec 19 2021, Eli Zaretskii wrote:> >> (set-frame-font (font-spec :name "Inconsolata-13" :weight 'medium))> >>> >> then what I get is the regular weight, not the medium weight. It is as> >> though the :weight parameter is being completely ignored.> >> > Does that font have the 'medium' weight?> > $ fc-list 'Inconsolata' | grep Medium> /usr/share/fonts/truetype/inconsolata/Inconsolata.otf: Inconsolata:style=Medium> > However:> > $ fc-list 'Iosevka' -f '%{style}\n' | grep Medium> Medium Extended Oblique,Regular> Medium Extended,Regular> Medium Oblique,Regular> Medium Italic,Italic> Medium Extended Italic,Italic> Medium,Regular> ^^^^^^^^^^^^^^
I asked about the weight, not the style.
Emacs 29 distinguishes between 'medium' and 'regular'/'normal' weight,
and I don't think I see 'medium' in the above output (or maybe I
misunderstand it).
Can you show the numerical value of the weight for each one of the
above font varieties? (Sorry, I don't know how to ask fc to report
that.)
On Sun, Dec 19 2021, Eli Zaretskii wrote:
> I asked about the weight, not the style.
Good point, got confused :/
> Emacs 29 distinguishes between 'medium' and 'regular'/'normal' weight,> and I don't think I see 'medium' in the above output (or maybe I> misunderstand it).>> Can you show the numerical value of the weight for each one of the> above font varieties? (Sorry, I don't know how to ask fc to report> that.)
$ fc-list Iosevka -f '%{weight} %{style}\n' | egrep -i 'Medium|Regular' | sort -n
0 Thin Extended Oblique,Regular
0 Thin Extended,Regular
0 Thin Oblique,Regular
0 Thin,Regular
40 Extralight Extended Oblique,Regular
40 Extralight Extended,Regular
40 Extralight Oblique,Regular
40 Extralight,Regular
50 Light Extended Oblique,Regular
50 Light Extended,Regular
50 Light Oblique,Regular
50 Light,Regular
80 Extended Oblique,Regular
80 Extended,Regular
80 Oblique,Regular
80 Regular
100 Medium Extended Italic,Italic
100 Medium Extended Oblique,Regular
100 Medium Extended,Regular
100 Medium Italic,Italic
100 Medium Oblique,Regular
100 Medium,Regular
180 Semibold Extended Oblique,Regular
180 Semibold Extended,Regular
180 Semibold Oblique,Regular
180 Semibold,Regular
205 Extrabold Extended Oblique,Regular
205 Extrabold Extended,Regular
205 Extrabold Oblique,Regular
205 Extrabold,Regular
210 Heavy Extended Oblique,Regular
210 Heavy Extended,Regular
210 Heavy Oblique,Regular
210 Heavy,Regular
Keep in mind I'm also not a font guru.
$ fc-list Inconsolata -f '%{weight} %{style}\n'
100 Medium
So Inconsolata _only_ has Medium on my system (this is Inconsolata
001.010-6 from the debian unstable package). I assume the other weights
are synthesized via freetype in this case.
For comparison:
$ fc-list 'Noto Sans' -f '%{weight} %{style}\n' | sort -n
80 Italic
80 Regular
200 Bold
200 Bold Italic
So the weight mapping in Iosevka seems at least superficially correct.
Note that Iosevka is a open font, just in case you want to test this:
https://github.com/be5invis/Iosevka/
The version I've been using for these tests:
https://github.com/be5invis/Iosevka/releases/download/v11.2.0/super-ttc-iosevka-11.2.0.zip
it's a massive font due to all the style/weight combinations.
> From: Yuri D'Elia <wavexx@thregr.org>> Cc: spwhitton@spwhitton.name, emacs-devel@gnu.org> Date: Sun, 19 Dec 2021 13:57:06 +0100> > On Sun, Dec 19 2021, Eli Zaretskii wrote:> > I asked about the weight, not the style.> > Good point, got confused :/> > > Emacs 29 distinguishes between 'medium' and 'regular'/'normal' weight,> > and I don't think I see 'medium' in the above output (or maybe I> > misunderstand it).> >> > Can you show the numerical value of the weight for each one of the> > above font varieties? (Sorry, I don't know how to ask fc to report> > that.)> > $ fc-list Iosevka -f '%{weight} %{style}\n' | egrep -i 'Medium|Regular' | sort -n> 0 Thin Extended Oblique,Regular> 0 Thin Extended,Regular> 0 Thin Oblique,Regular> 0 Thin,Regular> 40 Extralight Extended Oblique,Regular> 40 Extralight Extended,Regular> 40 Extralight Oblique,Regular> 40 Extralight,Regular> 50 Light Extended Oblique,Regular> 50 Light Extended,Regular> 50 Light Oblique,Regular> 50 Light,Regular> 80 Extended Oblique,Regular> 80 Extended,Regular> 80 Oblique,Regular> 80 Regular> 100 Medium Extended Italic,Italic> 100 Medium Extended Oblique,Regular> 100 Medium Extended,Regular> 100 Medium Italic,Italic> 100 Medium Oblique,Regular> 100 Medium,Regular> 180 Semibold Extended Oblique,Regular> 180 Semibold Extended,Regular> 180 Semibold Oblique,Regular> 180 Semibold,Regular> 205 Extrabold Extended Oblique,Regular> 205 Extrabold Extended,Regular> 205 Extrabold Oblique,Regular> 205 Extrabold,Regular> 210 Heavy Extended Oblique,Regular> 210 Heavy Extended,Regular> 210 Heavy Oblique,Regular> 210 Heavy,Regular> > Keep in mind I'm also not a font guru.> > $ fc-list Inconsolata -f '%{weight} %{style}\n'> 100 Medium> > So Inconsolata _only_ has Medium on my system (this is Inconsolata> 001.010-6 from the debian unstable package). I assume the other weights> are synthesized via freetype in this case.> > For comparison:> > $ fc-list 'Noto Sans' -f '%{weight} %{style}\n' | sort -n> 80 Italic> 80 Regular> 200 Bold> 200 Bold Italic> > So the weight mapping in Iosevka seems at least superficially correct.
There are two different people in this discussion with two different
font families and with potentially different setups of their systems.
I no longer understand what questions am I supposed to answer.
> Note that Iosevka is a open font, just in case you want to test this:> > https://github.com/be5invis/Iosevka/
I cannot test this on machines to which I have access, sorry.
Anyway, I asked about Inconsolata, not Iosevka, and I asked Sean about
his setup.
Hello,
On Sun 19 Dec 2021 at 02:52PM +02, Eli Zaretskii wrote:
>> From: Yuri D'Elia <wavexx@thregr.org>>> Cc: Sean Whitton <spwhitton@spwhitton.name>, emacs-devel@gnu.org>> Date: Sun, 19 Dec 2021 12:29:10 +0100>> >> On Sun, Dec 19 2021, Eli Zaretskii wrote:>> >> (set-frame-font (font-spec :name "Inconsolata-13" :weight 'medium))>> >>>> >> then what I get is the regular weight, not the medium weight. It is as>> >> though the :weight parameter is being completely ignored.>> >>> > Does that font have the 'medium' weight?
I think so, though see fc-list output below.
I customized the 'default' face to medium Inconsolata, and commented out
my code which directly calls set-frame-font, and then I get something
which looks the same as it used to (I compared some screenshots).
> Emacs 29 distinguishes between 'medium' and 'regular'/'normal' weight,> and I don't think I see 'medium' in the above output (or maybe I> misunderstand it).>> Can you show the numerical value of the weight for each one of the> above font varieties? (Sorry, I don't know how to ask fc to report> that.)
Here is what I get:
% fc-list Inconsolata family weight | grep -i medium
Inconsolata,Inconsolata ExpandedMedium:weight=100
Inconsolata,Inconsolata UltraExpandedMedium:weight=100
Inconsolata,Inconsolata CondensedMedium:weight=100
Inconsolata,Inconsolata UltraCondensedMedium:weight=100
Inconsolata,Inconsolata SemiCondensedMedium:weight=100
Inconsolata,Inconsolata ExtraExpandedMedium:weight=100
Inconsolata,Inconsolata Medium:weight=100
Inconsolata,Inconsolata ExtraCondensedMedium:weight=100
Inconsolata,Inconsolata SemiExpandedMedium:weight=100
I'm attaching the un-grepped output so you can see the other numerical
weights.
--
Sean Whitton
On Sun, Dec 19 2021, Sean Whitton wrote:
> I think so, though see fc-list output below.>> I customized the 'default' face to medium Inconsolata, and commented out> my code which directly calls set-frame-font, and then I get something> which looks the same as it used to (I compared some screenshots).
So you switched to customize?
Could you provide some screenshots before/after?
Also, what happens when you create a new frame? (M-x make-frame)
Hello,
On Sun 19 Dec 2021 at 11:04PM +01, Yuri D'Elia wrote:
> On Sun, Dec 19 2021, Sean Whitton wrote:>> I think so, though see fc-list output below.>>>> I customized the 'default' face to medium Inconsolata, and commented out>> my code which directly calls set-frame-font, and then I get something>> which looks the same as it used to (I compared some screenshots).>> So you switched to customize?
Well, I'd rather keep my programmatic font setting, as it does a few
things which are useful to me.
What's weird is how the weight seems to be ignored in the set-face-font
call but not in the customisation.
> Could you provide some screenshots before/after?
Before/after what, sorry?
> Also, what happens when you create a new frame? (M-x make-frame)
Do you mean with my original programmatic font setting?
It gives me (what looks like) a regular rather than medium weight.
--
Sean Whitton
Hello,
On Sun 19 Dec 2021 at 02:03PM -07, Sean Whitton wrote:
> Hello,>> On Sun 19 Dec 2021 at 02:52PM +02, Eli Zaretskii wrote:>>>> From: Yuri D'Elia <wavexx@thregr.org>>>> Cc: Sean Whitton <spwhitton@spwhitton.name>, emacs-devel@gnu.org>>> Date: Sun, 19 Dec 2021 12:29:10 +0100>>>>>> On Sun, Dec 19 2021, Eli Zaretskii wrote:>>> >> (set-frame-font (font-spec :name "Inconsolata-13" :weight 'medium))>>> >>>>> >> then what I get is the regular weight, not the medium weight. It is as>>> >> though the :weight parameter is being completely ignored.>>> >>>> > Does that font have the 'medium' weight?>> I think so, though see fc-list output below.>> I customized the 'default' face to medium Inconsolata, and commented out> my code which directly calls set-frame-font, and then I get something> which looks the same as it used to (I compared some screenshots).
Reverting 1b2511f fixes the problem.
--
Sean Whitton