[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 23.0.60; Deja vu font breaks mouse-face highlighting in Gnus
From: |
Johan Bockgård |
Subject: |
Re: 23.0.60; Deja vu font breaks mouse-face highlighting in Gnus |
Date: |
Sun, 17 Feb 2008 21:25:18 +0100 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) |
Stephen Berman <address@hidden> 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