GNU bug report logs - #67563
30.0.50; Box should not extend with line-spacing

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Fri, 1 Dec 2023 07:49:01 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 67563 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67563; Package emacs. (Fri, 01 Dec 2023 07:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuan Fu <casouri <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 01 Dec 2023 07:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Bug Report Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.50; Box should not extend with line-spacing
Date: Thu, 30 Nov 2023 23:47:37 -0800
[Message part 1 (text/plain, inline)]
If I set a box face for a button, and then set a line-space for the buffer, I expect the extra space between lines to be added outside of the box, like so:

+-------------------------+
|          Box            |
|                         |
+-------------------------+
       extra line space
+-------------------------+
|          Box            |
|                         |
+-------------------------+

However, right now, the bottom line of the box includes the extra line spacing, like so:

+-------------------------+
|          Box            |
|                         |
+                         +
|      extra line space   |
+-------------------------+
+-------------------------+
|          Box            |
|                         |
+-------------------------+

Screenshot:
[Screenshot 2023-11-30 at 11.44.53 PM.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
Ideally there should be some space between the two buttons on the two lines. Also notice the extra space above the bottom line of the box.

I also attached a repo file to produce these buttons.

If someone can give me some pointers, I can try to look into this.

Yuan

[repo.el (application/octet-stream, attachment)]
[Message part 5 (text/plain, inline)]


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67563; Package emacs. (Sat, 02 Dec 2023 14:08:02 GMT) Full text and rfc822 format available.

Message #8 received at 67563 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 67563 <at> debbugs.gnu.org
Subject: Re: bug#67563: 30.0.50; Box should not extend with line-spacing
Date: Sat, 02 Dec 2023 16:06:54 +0200
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Thu, 30 Nov 2023 23:47:37 -0800
> 
> If I set a box face for a button, and then set a line-space for the buffer, I expect the extra space between lines to be added outside of the box, like so:
> 
> +-------------------------+
> |          Box            |
> |                         |
> +-------------------------+
>        extra line space
> +-------------------------+
> |          Box            |
> |                         |
> +-------------------------+
> 
> However, right now, the bottom line of the box includes the extra line spacing, like so:
> 
> +-------------------------+
> |          Box            |
> |                         |
> +                         +
> |      extra line space   |
> +-------------------------+
> +-------------------------+
> |          Box            |
> |                         |
> +-------------------------+
> 
> Screenshot:
> 
> Ideally there should be some space between the two buttons on the two lines. Also notice the extra space above the bottom line of the box.
> 
> I also attached a repo file to produce these buttons.
> 
> If someone can give me some pointers, I can try to look into this.

We currently draw the box such that its height is equal to the height
of the screen line, and that includes line-spacing.

The implementation is in x_draw_glyph_string_box and similar functions
in other GUI backends (w32_draw_glyph_string_box etc.).

If you want to ad a feature where the box excludes line-space, please
make it optional, by default off, as the current behavior is a very
old one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67563; Package emacs. (Mon, 04 Dec 2023 08:24:01 GMT) Full text and rfc822 format available.

Message #11 received at 67563 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67563 <at> debbugs.gnu.org
Subject: Re: bug#67563: 30.0.50; Box should not extend with line-spacing
Date: Mon, 4 Dec 2023 00:23:21 -0800

On 12/2/23 6:06 AM, Eli Zaretskii wrote:
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Thu, 30 Nov 2023 23:47:37 -0800
>>
>> If I set a box face for a button, and then set a line-space for the buffer, I expect the extra space between lines to be added outside of the box, like so:
>>
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +-------------------------+
>>         extra line space
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +-------------------------+
>>
>> However, right now, the bottom line of the box includes the extra line spacing, like so:
>>
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +                         +
>> |      extra line space   |
>> +-------------------------+
>> +-------------------------+
>> |          Box            |
>> |                         |
>> +-------------------------+
>>
>> Screenshot:
>>
>> Ideally there should be some space between the two buttons on the two lines. Also notice the extra space above the bottom line of the box.
>>
>> I also attached a repo file to produce these buttons.
>>
>> If someone can give me some pointers, I can try to look into this.
> We currently draw the box such that its height is equal to the height
> of the screen line, and that includes line-spacing.
>
> The implementation is in x_draw_glyph_string_box and similar functions
> in other GUI backends (w32_draw_glyph_string_box etc.).
Thanks, I'll come back when I have good questions to ask.
> If you want to ad a feature where the box excludes line-space, please
> make it optional, by default off, as the current behavior is a very
> old one.
Will do. I'm sure the current behavior has its use-cases too.

Yuan




This bug report was last modified 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.