GNU bug report logs - #30609
26.0.91; underline should be drawn behind text

Previous Next

Package: emacs;

Reported by: Aaron Jensen <aaronjensen <at> gmail.com>

Date: Sun, 25 Feb 2018 23:06:02 UTC

Severity: wishlist

Found in version 26.0.91

To reply to this bug, email your comments to 30609 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#30609; Package emacs. (Sun, 25 Feb 2018 23:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aaron Jensen <aaronjensen <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 25 Feb 2018 23:06:02 GMT) Full text and rfc822 format available.

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

From: Aaron Jensen <aaronjensen <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.91; underline should be drawn behind text
Date: Sun, 25 Feb 2018 15:05:29 -0800
I don't know if it's true on all platforms, but at least on the mac the
text decorations (like underlines) are drawn after the glyph causing
them to overlap the descenders. Typically underlines are drawn behind
the characters as they are less important than the characters
themselves.
I'd be happy to submit a patch to change the order if no one sees a problem with this.

Maybe some day we a text-decoration-skip equivalent, but that's a bit
beyond my capabilities at the moment :)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30609; Package emacs. (Mon, 26 Feb 2018 03:48:02 GMT) Full text and rfc822 format available.

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

From: Aaron Jensen <aaronjensen <at> gmail.com>
To: 30609 <at> debbugs.gnu.org
Subject: Re: 26.0.91; underline should be drawn behind text
Date: Sun, 25 Feb 2018 19:46:55 -0800
It seems like there's a bit more to this than I thought. It looks like
ns_draw_glyph_string_foreground sometimes draws the background too,
covering the underline. It didn't do this with emacs -Q, but it did
with my config. It seems like I'd need to actually draw the background
separately, then the underline, then the glyph above. Any thoughts
about this or other suggestions?

Thanks,

Aaron




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30609; Package emacs. (Mon, 26 Feb 2018 15:46:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Aaron Jensen <aaronjensen <at> gmail.com>
Cc: 30609 <at> debbugs.gnu.org
Subject: Re: bug#30609: 26.0.91; underline should be drawn behind text
Date: Mon, 26 Feb 2018 17:44:56 +0200
> From: Aaron Jensen <aaronjensen <at> gmail.com>
> Date: Sun, 25 Feb 2018 15:05:29 -0800
> 
> I don't know if it's true on all platforms, but at least on the mac the
> text decorations (like underlines) are drawn after the glyph causing
> them to overlap the descenders. Typically underlines are drawn behind
> the characters as they are less important than the characters
> themselves.
> I'd be happy to submit a patch to change the order if no one sees a problem with this.

I'm far from being an expert in this area, but AFAICT, such a change
could cause the underline to become partially or even fully invisible,
at least in some situations.  For example, if the underline is to be
drawn below one or more images, or some special characters, or what we
use to display characters with no font.  That's because we sometimes
clear the entire character cell with the background color before
drawing the foreground, and that would erase the part of the underline
below that cell.  Right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30609; Package emacs. (Mon, 26 Feb 2018 15:47:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Aaron Jensen <aaronjensen <at> gmail.com>
Cc: 30609 <at> debbugs.gnu.org
Subject: Re: bug#30609: 26.0.91; underline should be drawn behind text
Date: Mon, 26 Feb 2018 17:46:05 +0200
> From: Aaron Jensen <aaronjensen <at> gmail.com>
> Date: Sun, 25 Feb 2018 19:46:55 -0800
> 
> It seems like there's a bit more to this than I thought. It looks like
> ns_draw_glyph_string_foreground sometimes draws the background too,
> covering the underline. It didn't do this with emacs -Q, but it did
> with my config. It seems like I'd need to actually draw the background
> separately, then the underline, then the glyph above. Any thoughts
> about this or other suggestions?

Yes, this is what I feared, and that's why I think simply switching
the order will not give good results.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30609; Package emacs. (Mon, 26 Feb 2018 21:11:02 GMT) Full text and rfc822 format available.

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

From: Aaron Jensen <aaronjensen <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 30609 <at> debbugs.gnu.org
Subject: Re: bug#30609: 26.0.91; underline should be drawn behind text
Date: Mon, 26 Feb 2018 13:10:06 -0800
On Mon, Feb 26, 2018 at 7:46 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> Yes, this is what I feared, and that's why I think simply switching
> the order will not give good results.

I may be able to move the text decoration code to the font drawing,
but text decoration is done for more than fonts, so that could result
in some duplication or nsterm referencing nsfont which would then
reference nsterm. If that's ok, I can look into that.

The other option would be to move the background drawing code out of
the font rendering. I don't know all of the places that it is done, so
that may be cumbersome.

One other, completely different idea that may not work or may be
really slow would be to do a color replacement--only replacing pixels
that match the background color with the underline color. I have no
idea if reading from the canvas in this way is slow. This would end up
giving a similar effect to text-decoration-skip.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30609; Package emacs. (Mon, 26 Feb 2018 21:39:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <athird <at> googlemail.com>
To: Aaron Jensen <aaronjensen <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 30609 <at> debbugs.gnu.org
Subject: Re: bug#30609: 26.0.91; underline should be drawn behind text
Date: Mon, 26 Feb 2018 21:38:20 +0000
[Message part 1 (text/plain, inline)]
On 26 Feb 2018 9:11 p.m., "Aaron Jensen" <aaronjensen <at> gmail.com> wrote:


I may be able to move the text decoration code to the font drawing,
but text decoration is done for more than fonts, so that could result
in some duplication or nsterm referencing nsfont which would then
reference nsterm. If that's ok, I can look into that.


The NS port has two font backends: nsfont and macfont. If you make changes
you'll have to support both.
[Message part 2 (text/html, inline)]

This bug report was last modified 7 years and 206 days ago.

Previous Next


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