unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Subject: Re: 23.0.60; Deja vu font breaks mouse-face highlighting in Gnus
Date: Sun, 17 Feb 2008 21:25:18 +0100	[thread overview]
Message-ID: <yoijve4n9vpt.fsf@remote2.student.chalmers.se> (raw)
In-Reply-To: 87d4qvpw7o.fsf@escher.local.home

Stephen Berman <Stephen.Berman@gmx.net> writes:

> I had also tried an italic Dejavu and it showed the problem but, as I
> said, not with as many strings; here's a case in point:
>
> (progn (font-lock-mode 0)
>   (insert (propertize "Re: 23.0.60" 'mouse-face 'highlight))
>   (insert (propertize "Re: 23.0.60" 'face 'italic 'mouse-face 'highlight)))
>
> I see a gap in mouse-face highlighting when the cursor is over the
> unitalicized "R" and "2" but not when it is over the italicized ones.
> Do you see that too?  This seems contrary to you characterization of the
> triggering conditions, i.e. characters that stick out of their box, but
> I do not know the properties of the font nor understand the code you
> pointed to, so maybe it is no contradiction.

Well, when I try this I notice a problem with highlighting next to the
cursor to the right of the R in the non-italic case and to the left of
the 3 in the italic case.  (Going from unslanted to slanted makes the
lower right of "R" extend less, while OTOH slanting "3" makes the lower
curve protrude to the left.)  I haven't examined the font in detail, but
in any case `contains_overlapping_glyphs_p' is the relevant variable.

The problem goes away if you add a `&& hl == DRAW_NORMAL_TEXT' test to
the conditional below (but I don't think this fix is entirely right.)

>> The responsible code is this part in `draw_glyphs':
>>
>>    /* If there are any glyphs with lbearing < 0 or rbearing > width in
>>       the row, redraw some glyphs in front or following the glyph
>>       strings built above.  */
>>   if (head && !overlaps && row->contains_overlapping_glyphs_p)
>>      {
>>        ...
>
> How did you figure this out?  Do you just know the code well and realize
> that draw_glyphs was involved, or did you arrive there by using gdb?  If
> the latter, could you tell me how you did it?  That might help me make
> more useful bug reports and perhaps even suggest bug fixes.

Actually, I had already discovered another problem with precisely this
code that I had been planning to report.  That one also involved display
problems around the (box) cursor, which led me to x_draw_window_cursor
-> draw_phys_cursor_glyph -> draw_glyphs (with hl=DRAW_CURSOR;
similarly, mouse-face highlighting is produced by draw_glyphs with
hl=DRAW_MOUSE_FACE).  (I was somewhat familiar with the box cursor
drawing code, http://article.gmane.org/gmane.emacs.devel/81652.)  gdb
helped revealing the difference between the working and non-working
cases (contains_overlapping_glyphs_p).

-- 
Johan Bockgård





  reply	other threads:[~2008-02-17 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11 15:47 23.0.60; broken mouse-face highlighting in Gnus Stephen Berman
2008-02-16 23:56 ` 23.0.60; Deja vu font breaks " Stephen Berman
2008-02-17  0:40   ` Johan Bockgård
2008-02-17 13:07     ` Stephen Berman
2008-02-17 20:25       ` Johan Bockgård [this message]
2008-02-17 20:47         ` Bad drawing of xft fonts overlapping box cursor Johan Bockgård
2008-02-18  0:36           ` Stephen Berman
2008-02-18  0:58             ` Jason Rumney
2008-02-18  0:36         ` 23.0.60; Deja vu font breaks mouse-face highlighting in Gnus Stephen Berman
2008-02-18  1:12           ` Johan Bockgård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yoijve4n9vpt.fsf@remote2.student.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).