bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Feng Shu
Subject: bug#51821: 29.0.50; Suggest add variable or frame parameter: line-height
Date: Mon, 15 Nov 2021 06:37:23 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Feng Shu" <tumashu@163.com>
>> Date: Sun, 14 Nov 2021 07:28:46 +0800
>> 
>> I have try the below code, and it work
>>  
>>    (insert (propertize "\n" 'line-height 1.4))
>>  
>> But how to apply line-height global and let line-height work with
>> mode/header/tab-bar?  
>> 
>> Maybe we should add a variable or frame parameter: line-height
>
> Adding a variable is easy, but what would be its semantics?  Emacs can
> display different faces in the same window, and some of those faces
> can have smaller height.  If the line of text in a window uses the
> smaller faces, that line's height will be smaller as well.
>
> For example, evaluate the following:
>
>   (defface small
>     '((t :height 0.6))
>     "")
>
> Then visit some file, and do this:
>
>   M-x font-lock-mode RET
>   M-x load-library RET facemenu RET
>   C-SPC
>   C-n
>   C-n
>   M-x facemenu-set-face RET small RET
>
> Now you should see 2 lines in a smaller font; those lines have
> correspondingly smaller height.

I think user should set to (t . RATIO) instead in most case.

Maybe line-height can be a alist ((face1 . RATIO) (face2 .RATIO)).


  ‘(FACE . RATIO)’
     If the height spec is a cons of the format shown, the numeric
     height is RATIO times the height of face FACE.  RATIO can be any
     type of number, or ‘nil’ which means a ratio of 1.  If FACE is ‘t’,
     it refers to the current face.


>
> So if we require all the lines to be at least line-height pixels,
> those smaller lines will also become higher, and that is not what's
> expected, I guess?

If user set line-height to a INTEGER with a variable, I think it
is user expected.


>
> So what would be the correct interpretation of the line-height
> variable or frame parameter, when different faces are being used?

-- 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]