Subject: bug#51821: 29.0.50; Suggest add variable or frame parameter: line-height

From: Eli Zaretskii <[email-masked]>
Date: Fri, 19 Nov 2021 14:27:21 +0200

> From: Po Lu <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Fri, 19 Nov 2021 17:33:18 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> I think he expects the text in the smaller font to be "centered"
> >> vertically, instead of sharing the same baseline as the Chinese font,
> >> but I'm not sure.
> 
> > Really?  That can be done, but won't it look ugly on display?
> 
> IMO yes, but other people might have differing opinions.  Would it hurt
> to make this an option?

I'd rather not introduce one more option to control the line height
unless it's really needed.  The code there is already a "maze of
twisted passages all alike", quite hard to understand and modify, so
adding one more option could easily break something.

For now, it does sound like Feng Shu wants the baseline aligned, so
such an option is not required yet.

> > Do other GUI applications do that with mixed CJK and non-CJK fonts?
> 
> I found out earlier that the other applications simply scale the
> overlarge glyphs to fit some predefined height.

Emacs doesn't scale the font glyphs, AFAIK, primarily because that
won't work with bitmapped fonts, which we still support and which some
users still use (I remember recent enough bug reports due to some
change that broke bitmapped fonts).  We let the font backend do the
scaling, when we request a font of certain size, and the result is
what you see now.

But if you or someone else know how to scale font glyphs on the fly,
please show the code.  The main difficulty her, as I see it, is to
decide to which size to scale, since each character can have a glyph
with different metrics.