Subject: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center

From: Daniel Mendler <[email-masked]>
Date: Tue, 18 Feb 2025 19:04:07 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Daniel Mendler <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Tue, 18 Feb 2025 16:40:15 +0100
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> > And finally, I have a question: what does this patch do with a line
>> > that mixes different fonts, especially fonts with very different
>> > values of ascent and descent?  Does the result look well?  ISTR that
>> > we need to handle the underline property specially due to these
>> > considerations, so as to avoid producing broken underline.
>> 
>> I cannot tell yet. I can answer that when I worked a little bit on the
>> patch. All I can say confidently is that the status quo with the
>> non-centered line-spacing does not look good, not even with a single
>> font (see my hi-lock example from above).
>
> "Good" in that case is in the eyes of the beholder, because the added
> spacing is uniform whatever the font.  You say "not good" because I'm
> guessing you don't like the effect in general, not because it breaks
> when different fonts are used on the same screen line.

Yes, it depends on preference. Therefore I am suggesting to add a
customization option, e.g., `line-spacing-align', or alternatively
extend the `line-spacing' variable as you suggested, such that the
feature must be enabled explicitly.

I rarely use multiple fonts on a single line. But I agree that multiple
fonts should be supported well if a `line-spacing-align' patch gets
merged, given that some themes use fonts instead of colors for font
locking. Stefan Monnier mentioned this in the thread about adding new
semantic faces.

Daniel