After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333157 - Rendering bug on some characters
Rendering bug on some characters
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: Behdad Esfahbod
VTE Maintainers
: 332838 418324 420699 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-03-02 17:14 UTC by Joe Shaw
Modified: 2007-03-20 20:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[1] single ampersand (3.81 KB, image/png)
2006-03-02 17:17 UTC, Joe Shaw
  Details
[2] 3 ampersands (3.89 KB, image/png)
2006-03-02 17:17 UTC, Joe Shaw
  Details
[3] several ampersands (3.94 KB, image/png)
2006-03-02 17:18 UTC, Joe Shaw
  Details
[4] several ampersands, after pressing backspace once (3.93 KB, image/png)
2006-03-02 17:19 UTC, Joe Shaw
  Details
Draw cells either side of invalidated region (but first apply a clip) (10.13 KB, patch)
2007-01-19 23:14 UTC, Chris Wilson
none Details | Review

Description Joe Shaw 2006-03-02 17:14:02 UTC
Since I've upgraded to 0.11.18 (and continuing with 0.11.20) I've noticed a slight rendering bug in my terminals with certain characters.  I'm using the Bitstream Vera Sans Mono font, and the terminal color is gray-on-black.

If I type an ampersand (&) in my terminal[1], and then two more[2], the first ampersand loses its "tail".  If I type several ampersands in a row[3] (all but the last one having lost its tail) and then type backspace all of the tails reappear[4].

I'll attach xmag screenshots for 1-4.
Comment 1 Joe Shaw 2006-03-02 17:17:17 UTC
Created attachment 60507 [details]
[1] single ampersand
Comment 2 Joe Shaw 2006-03-02 17:17:56 UTC
Created attachment 60508 [details]
[2] 3 ampersands
Comment 3 Joe Shaw 2006-03-02 17:18:14 UTC
Created attachment 60509 [details]
[3] several ampersands
Comment 4 Joe Shaw 2006-03-02 17:19:19 UTC
Created attachment 60510 [details]
[4] several ampersands, after pressing backspace once
Comment 5 Joe Shaw 2006-03-02 17:20:40 UTC
Bleh, I am an idiot and messed up the two mime types for #2 and #3; they're both pngs though.
Comment 6 Behdad Esfahbod 2006-03-03 01:18:02 UTC
Hi Joe,

Welcome to the land of vte misrendering :).

This is really hard stuff.  I'll try to come up with a fix though.
Comment 7 Behdad Esfahbod 2006-03-03 01:22:22 UTC
*** Bug 332838 has been marked as a duplicate of this bug. ***
Comment 8 Behdad Esfahbod 2006-03-03 01:24:00 UTC
The solution seems to be rendering the glyphs to the left and right of the clip region.  This also happens about characters on top and bottom rows (for underlines for example), but that's less noticable.
Comment 9 Sebastien Bacher 2006-07-19 09:59:38 UTC
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/vte/+bug/33144
Comment 10 Chris Wilson 2007-01-19 23:14:06 UTC
Created attachment 80741 [details] [review]
Draw cells either side of invalidated region (but first apply a clip)

This uses the approach Behdad suggests, but clips the right column(s) of the bold font. WIP.
Comment 11 Behdad Esfahbod 2007-01-20 00:56:56 UTC
Nice.  Have you measured its performance impact?
(We really need a performance suite.)

Any idea how to do it for top and bottom too?  It may be enough to do the top only.  It only can happen with underlines (or insane fonts).
Comment 12 Chris Wilson 2007-01-20 01:10:13 UTC
Single run of a hexdump suggested that setting a (redundant) clip box was insignificant. No thorough analysis though.

As for top and bottom, can we not just draw the lines above and below and allow the clip to take care of the suplus?

The misrender of the right hand column of the bold font is not an artifact of this patch, but rather the tight invalidation. I hope it is not a new one!
Comment 13 Behdad Esfahbod 2007-01-20 20:02:35 UTC
The patch caused some artifacts where the first column is not redrawn.  Best seen in vim, doing page-up/page-down, I sometimes see the '#' from a "#define" in the previous page to remain on the screen.
Comment 14 Chris Wilson 2007-01-20 21:02:26 UTC
Ah, that one. That stems from my imperfect understanding of which *"!"£!£ cells one has to include to actually have them redrawn. I'm learning slowly... though I suspect those occassional 1s should actually be cell->columns.
Comment 15 Behdad Esfahbod 2007-01-21 07:30:49 UTC
(In reply to comment #14)
> though I suspect those occassional 1s should actually be cell->columns.

Or cell->fragment.  cell->columns is only set on the first cell of a char.  The second cell, if any, has cell->fragment set.  And there are no more than two cells.
Comment 16 Chris Wilson 2007-01-26 20:59:40 UTC
r1548: 2007-01-26  Chris Wilson  <chris@chris-wilson.co.uk>

	Bug 401082 – double-draw issue

	The main cause of this bug was not expanding the cleared area to cover
	all the cells affected by the draw and forgetting to offset the clear
	by VTE_PAD_WIDTH.

	To counter the performance hit due to the expanded repaint area, each
	backend is presented with the opportunity to apply a clip to the
	exposed region before painting.

	This also fixes bug 333157,

	* src/vte.c: (_vte_invalidate_cells), (vte_terminal_paint_area),
	(vte_terminal_paint):
	* src/vtedraw.c: (_vte_draw_clip):
	* src/vtedraw.h:
	* src/vteft2.c: (_vte_ft2_end), (_vte_ft2_clip):
	* src/vtegl.c:
	* src/vtepango.c: (_vte_pango_clip):
	* src/vtepangox.c: (_vte_pango_x_clip):
	* src/vtexft.c: (_vte_xft_clip), (_vte_xft_draw_text):

Comment 17 Chris Wilson 2007-03-14 19:24:55 UTC
*** Bug 418324 has been marked as a duplicate of this bug. ***
Comment 18 Chris Wilson 2007-03-20 20:54:57 UTC
*** Bug 420699 has been marked as a duplicate of this bug. ***