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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 21 Oct 2021 10:01:20 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 21 Oct 2021 04:33:49 +0200
> 
> I've now gone through all the fonts I have here that have different
> weights for medium and regular, and with the adjustments in the weights
> and Pango weights, I can now select both of them.  (And the other
> weights for Noto and DejaVu, which are the main fonts that I've tested
> with, also work.)
> 
> So I've pushed the changes now to the trunk.  If these changes don't
> work with other fonts, please let me know.

Hmm... bother:

>  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?

>  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?