Subject: bug#79083: 31.0.50; Inconsistencies wrt fixed-pitch face

From: Protesilaos Stavrou <[email-masked]>
Date: Thu, 24 Jul 2025 09:48:32 +0300

On 2025-07-23 17:27, Sean Whitton wrote:
> X-debbugs-cc: [email-masked], [email-masked], [email-masked], 
> [email-masked]
> 
> Hello,

Hello Sean,

> [...]
> 
> This is not incompatible with being a face that's always fixed pitch no
> matter whether the default face is fixed pitch, but it does mean that
> themes, or the user, shouldn't usually customise default and 
> fixed-pitch
> to use the same typeface.  If this is the idea, then it should be
> documented, and I would propose to do so as follows:

I do not see a problem with 'default' and 'fixed-pitch' using the same 
font family if that is monospaced. Interfaces/users/themes that 
absolutely need to distinguish regular text from "monospaced" text, like 
Info, should rely on more than just the font family (e.g. the 
'Info-quoted' face can have a distinct foreground value).

Personally, I would never want 'fixed-pitch' to be a monospaced family 
other than my preferred one. Different fonts come with differing 
inherent metrics. Some fonts look taller/shorter than others even when 
they are set to the same ':height' value. If you force users to apply 
distinct fonts, then you must expect them to set 'fixed-pitch' to a 
':height' like '0.9' or '1.1'. This is inconvenient and dependent on the 
exact ':height' value of the 'default' face. The relative height needs 
to be adjusted when the default font is made smaller/larger, which makes 
'text-scale-adjust' awkward.

Another common problem with fonts of varying heights is how the text can 
appear to jump around when the user scrolls to a point that has a taller 
line. I remember dealing with this recently while 
'display-line-numbers-mode' was enabled.

> [...]
> 
>  (defface fixed-pitch
>    '((t :family "Monospace"))
> -  "The basic fixed-pitch face."
> +  "The basic fixed-pitch face.
> +This face is intended to be visually distinct from the `default' face 
> on
> +graphical frames, even when the `default' face also uses a fixed-pitch
> +typeface.  In practice this means that this face should always use a
> +different typeface to the `default' face's typeface."
>    :group 'basic-faces)

I would personally not follow this guideline. Yes, 'fixed-pitch' should 
be a monospaced font to be consistent with the expectations it sets. 
Other than that, the user can pick any font family they want.

All the best,
Protesilaos (or simply "Prot")