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

From: Tim Ruffing <[email-masked]>
Date: Thu, 14 Dec 2023 11:37:15 +0100

On Thu, 2023-12-14 at 12:04 +0200, Eli Zaretskii wrote:
> What are the chances of someone wanting to disable this feature only
> for some fonts?  If we want to allow disabling it globally, it should
> be a simple matter of adding a boolean variable exposed to Lisp, and
> then performing this only when the variable doesn't inhibit that.
> 
> Adding a font property, or a regexp for matching fonts which are
> exempt from this, are by contrast much more complex and require more
> changes.  For a feature that was so far requested by a single user,
> I'm not sure this is justified.
> 

My first intuition was that, conceptually, it should depend on the font
because it's desirable for some fonts but not for others, and I thought
the complexity is not that big given that we have the code essentially
in place, because we do the same for vertical centering.

But yeah, I expect the chances that someone wants to disable this only
for some fonts to be rather low: Fonts for "normal" text without bold
are very rare, and probably not high-quality anyway. So I don't think
there's anyone who has an advanced setup with icon fonts but at the
same time uses a poor font for normal text that doesn't even have a
bold variant, and then really needs the overstriking... (Plus, there
may be other mechanisms in that case, such as FC_EMBOLDEN).

For me personally, a boolean toggle will be fine, exactly for the
reason outline above: All the other fonts that I use have a bold
variant anyway. 

> As for your example: if Doom uses this for icons, why cannot Doom
> refrain from using bold face for these cases?

That's of course possible, and this could even be integrated in
packages like nerd-fonts and all-the-icons. But as I said in my
previous email, I think this solves only part of the problem. Setting
the face works when there is existing code for inserting icons (e.g.,
file type icons in dired), because that code can then take care of
setting the face. 

But it doesn't work in cases when the user simply wants to insert icons
in their buffers: For example, if the user inserts an icon in a bold
org headline, it seems to me like the wrong approach to change the face
on the fly.