unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20510: 25.0.50; Underscore hidden by underline
@ 2015-05-05 20:13 Fabrice Niessen
  2015-05-06 17:13 ` Eli Zaretskii
  2019-09-30  0:10 ` Stefan Kangas
  0 siblings, 2 replies; 6+ messages in thread
From: Fabrice Niessen @ 2015-05-05 20:13 UTC (permalink / raw)
  To: 20510-ubl+/3LiMTaZdePnXv/OxA

When `hl-line' is enabled with the `underline' attribute, and when the
font is "DejaVu Sans Mono" in 8 pt, then underscores get overridden by
the underline (of the current, highlighted, line).

Minimal config to reproduce the problem:

--8<---------------cut here---------------start------------->8---
(modify-all-frames-parameters '((font . "DejaVu Sans Mono-8")))

(global-hl-line-mode 1)

(set-face-attribute 'hl-line nil
                    :underline "#FFFF19" :background "#F6FECD")
--8<---------------cut here---------------end--------------->8---

Screenshot: http://screencast.com/t/UXoET9RHs0E.

Is this normal (while this does not occur with 9 or 10 pt faces)?

If yes, is there a way to get the hl-line's underline in the background?

Best regards,
Fabrice





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20510: 25.0.50; Underscore hidden by underline
  2015-05-05 20:13 bug#20510: 25.0.50; Underscore hidden by underline Fabrice Niessen
@ 2015-05-06 17:13 ` Eli Zaretskii
       [not found]   ` <83mw1hr5nc.fsf-mXXj517/zsQ@public.gmane.org>
  2019-09-30  0:10 ` Stefan Kangas
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2015-05-06 17:13 UTC (permalink / raw)
  To: Fabrice Niessen; +Cc: 20510

> From: Fabrice Niessen <fni-news@pirilampo.org>
> Date: Tue, 05 May 2015 22:13:14 +0200
> 
> When `hl-line' is enabled with the `underline' attribute, and when the
> font is "DejaVu Sans Mono" in 8 pt, then underscores get overridden by
> the underline (of the current, highlighted, line).

Well, the underline _must_ overwrite _some_ part of the character.

> Screenshot: http://screencast.com/t/UXoET9RHs0E.
> 
> Is this normal

Yes, this is how the code was written to work.

> (while this does not occur with 9 or 10 pt faces)?

It depends on the font, yes.

You can try tweaking the value of x-use-underline-position-properties
and/or of x-underline-at-descent-line, they might fix your problem
with this font.

> If yes, is there a way to get the hl-line's underline in the background?

Not sure what you mean by that.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20510: 25.0.50; Underscore hidden by underline
       [not found]   ` <83mw1hr5nc.fsf-mXXj517/zsQ@public.gmane.org>
@ 2015-05-06 19:00     ` Fabrice Niessen
  2015-05-06 19:21       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Niessen @ 2015-05-06 19:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20510-ubl+/3LiMTaZdePnXv/OxA

Eli Zaretskii wrote:
> Well, the underline _must_ overwrite _some_ part of the character.
>
>> If yes, is there a way to get the hl-line's underline in the background?
>
> Not sure what you mean by that.

I mean: can't the hl-line-mode code be written in a way that the
underline goes in the background of the character, that is that every
pixel of every character gets written "over" the underline line?

Best regards,
Fabrice





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20510: 25.0.50; Underscore hidden by underline
  2015-05-06 19:00     ` Fabrice Niessen
@ 2015-05-06 19:21       ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2015-05-06 19:21 UTC (permalink / raw)
  To: Fabrice Niessen; +Cc: 20510

> From: Fabrice Niessen <fni-news@pirilampo.org>
> Cc: 20510@debbugs.gnu.org
> Date: Wed, 06 May 2015 21:00:16 +0200
> 
> I mean: can't the hl-line-mode code be written in a way that the
> underline goes in the background of the character, that is that every
> pixel of every character gets written "over" the underline line?

hl-line-mode cannot control that, and nothing on the Lisp level can.

When hl-line-mode puts its overlay on a line, the characters of that
line have the hl-line face merged with their face, with the result
that each character of that line will have the underline face in the
color you specify.  That's all Lisp can do; then along comes the
display engine and redraws the characters in this new merged face.
The C code which draws characters is written so that we first draw the
background, then the characters, then the underline.

So what you are actually asking is that the order of drawing the
underline (and also overline, strike-through, etc.) is changed so that
these attributes are drawn _before_ the characters.  That should be
possible by changing the order in the C code, but I have no idea what
that will do in other situations.  It's probably not TRT at least when
we draw images and other similar stuff instead of characters.

Perhaps someone who knows more than I do about GUI display back-end
could tell if this is a safe change.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20510: 25.0.50; Underscore hidden by underline
  2015-05-05 20:13 bug#20510: 25.0.50; Underscore hidden by underline Fabrice Niessen
  2015-05-06 17:13 ` Eli Zaretskii
@ 2019-09-30  0:10 ` Stefan Kangas
  2019-09-30  6:39   ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2019-09-30  0:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Fabrice Niessen, 20510

tags 20510 + wontfix
close 20510
thanks

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Fabrice Niessen <fni-news@pirilampo.org>
>> Cc: 20510@debbugs.gnu.org
>> Date: Wed, 06 May 2015 21:00:16 +0200
>>
>> I mean: can't the hl-line-mode code be written in a way that the
>> underline goes in the background of the character, that is that every
>> pixel of every character gets written "over" the underline line?
>
> hl-line-mode cannot control that, and nothing on the Lisp level can.
>
> When hl-line-mode puts its overlay on a line, the characters of that
> line have the hl-line face merged with their face, with the result
> that each character of that line will have the underline face in the
> color you specify.  That's all Lisp can do; then along comes the
> display engine and redraws the characters in this new merged face.
> The C code which draws characters is written so that we first draw the
> background, then the characters, then the underline.
>
> So what you are actually asking is that the order of drawing the
> underline (and also overline, strike-through, etc.) is changed so that
> these attributes are drawn _before_ the characters.  That should be
> possible by changing the order in the C code, but I have no idea what
> that will do in other situations.  It's probably not TRT at least when
> we draw images and other similar stuff instead of characters.
>
> Perhaps someone who knows more than I do about GUI display back-end
> could tell if this is a safe change.

It sounds to me like this is not something we are interested in doing.
I'm closing this as wontfix.

Please reopen if I'm mistaken.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#20510: 25.0.50; Underscore hidden by underline
  2019-09-30  0:10 ` Stefan Kangas
@ 2019-09-30  6:39   ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2019-09-30  6:39 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: fni-news, 20510

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 30 Sep 2019 02:10:24 +0200
> Cc: Fabrice Niessen <fni-news@pirilampo.org>, 20510@debbugs.gnu.org
> 
> >> I mean: can't the hl-line-mode code be written in a way that the
> >> underline goes in the background of the character, that is that every
> >> pixel of every character gets written "over" the underline line?
> >
> > hl-line-mode cannot control that, and nothing on the Lisp level can.
> >
> > When hl-line-mode puts its overlay on a line, the characters of that
> > line have the hl-line face merged with their face, with the result
> > that each character of that line will have the underline face in the
> > color you specify.  That's all Lisp can do; then along comes the
> > display engine and redraws the characters in this new merged face.
> > The C code which draws characters is written so that we first draw the
> > background, then the characters, then the underline.
> >
> > So what you are actually asking is that the order of drawing the
> > underline (and also overline, strike-through, etc.) is changed so that
> > these attributes are drawn _before_ the characters.  That should be
> > possible by changing the order in the C code, but I have no idea what
> > that will do in other situations.  It's probably not TRT at least when
> > we draw images and other similar stuff instead of characters.
> >
> > Perhaps someone who knows more than I do about GUI display back-end
> > could tell if this is a safe change.
> 
> It sounds to me like this is not something we are interested in doing.
> I'm closing this as wontfix.

I can also suggest trying to play with the following variables, which
affect how the underline is displayed:

  underline-minimum-offset
  x-underline-at-descent-line
  x-use-underline-position-properties





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-30  6:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05 20:13 bug#20510: 25.0.50; Underscore hidden by underline Fabrice Niessen
2015-05-06 17:13 ` Eli Zaretskii
     [not found]   ` <83mw1hr5nc.fsf-mXXj517/zsQ@public.gmane.org>
2015-05-06 19:00     ` Fabrice Niessen
2015-05-06 19:21       ` Eli Zaretskii
2019-09-30  0:10 ` Stefan Kangas
2019-09-30  6:39   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).