Subject: Re: bug#67810: 29.1; fonts use synthetic bold on Linux / pgtk

From: Eli Zaretskii <[email-masked]>
Date: Fri, 12 Jan 2024 14:30:21 +0200

> From: Po Lu <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Fri, 12 Jan 2024 20:20:00 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > If we do introduce such a variable, wouldn't it prevent Emacs from
> > generating the missing variants?
> 
> On the contrary: if the generation of such variants by the font backend
> is inhibited, Emacs will display bold text with overstriking, when these
> variants are absent from the font itself.
> 
> I should clarify that "generation" refers to the automatic generation of
> oblique or bold fonts undertaken by a handful of our font backends, not
> the overstriking implemented in xfaces.c.

Then we are mis-communicating, I think: I was talking about the code
in xfaces.c to which you pointed up-thread:

> > Can you point me at the place in the code where we do this?
> 
> Yes, see lines 6192 and 6045 in xfaces.c, viz.:
> 
>   if (face->font
>       && FONT_WEIGHT_NAME_NUMERIC (attrs[LFACE_WEIGHT_INDEX]) > 100
>       && FONT_WEIGHT_NUMERIC (attrs[LFACE_FONT_INDEX]) <= 100)
>     face->overstrike = true;
> 
> and
> 
>   face->overstrike
>     = (! NILP (font_object)
>        && FONT_WEIGHT_NAME_NUMERIC (face->lface[LFACE_WEIGHT_INDEX]) > 100
>        && FONT_WEIGHT_NUMERIC (font_object) <= 100);

I ws suggesting to introduce a variable that would inhibit this.

> > And wouldn't avoiding to generate them do what the OP wanted,
> > i.e. have a default face's font where bold looks like regular?
> 
> No, see above.  However, the matter at hand is that I can't understand
> the deficiency OPs request is supposed to address.  Surely, if the
> author of a package which inserts icons wishes that they not be bold,
> the package should set the face by which they are displayed to one that
> isn't?

AFAIU, the OP's request was to allow to have a default font that lacks
the bold variant, so that the bold face attribute could be displayed
in some other way, or maybe not at all.