Subject: Re: bug#32210: Support medium weighted fonts

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 21 Oct 2021 14:49:56 +0200

Eli Zaretskii <[email-masked]> writes:

>>  static const struct table_entry weight_table[] =
>>  {
>>    { 0, { "thin" }},
>> -  { 20, { "ultra-light", "ultralight" }},
>> -  { 40, { "extra-light", "extralight" }},
>> +  { 40, { "ultra-light", "ultralight", "extra-light", "extralight" }},
>
> This loses the distinction between ultra-light and extra-light.  Are
> these two really indistinguishable in all supported font backends?

I added them together because the Gtk documentation (and the Windows
one, I think? I've been working on this for a while, and some of the
details are vague) said that there's only one weight between "light" and
"thin", so people specifying "ultra-light" wouldn't actually get it,
because 20 is too far from being correct.

I fc-queried all the 1K fonts on this system, and indeed -- none of them
had a weight of 20.  There were weights at 0 and 40, though (and none
inbetween).

So I'm as confident about that change as...  er...  well, it's font
stuff, so I'm not confident at all, but I think it's worth a try.  I'll
test this stuff on FreeBSD and see what it says there, once I get the
VMs up again on my new VM machine.

>>  static Lisp_Object
>>  w32_to_fc_weight (int n)
>>  {
>> -  if (n >= FW_HEAVY)     return intern ("black");
>> +  if (n >= FW_HEAVY)     return Qbold;
>>    if (n >= FW_EXTRABOLD) return Qextra_bold;
>
> This doesn't look right.  Should that Qbold be Qblack?

Good catch.  Now fixed.

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