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 435000 - Bad rendering of line-drawing characters
Bad rendering of line-drawing characters
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.33.x
Other Linux
: Normal normal
: ---
Assigned To: Behdad Esfahbod
VTE Maintainers
[fixed-next]
Depends on:
Blocks:
 
 
Reported: 2007-05-01 20:35 UTC by Sven Arvidsson
Modified: 2014-04-06 17:42 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6


Attachments
screenshot of problem (25.17 KB, image/png)
2007-05-01 20:37 UTC, Sven Arvidsson
  Details
proposed patch (2.23 KB, patch)
2007-08-12 23:13 UTC, Michael Vrable
none Details | Review
Screenshot of gnome-terminal with vte 0.20.1, demonstrating problem with line-drawing characters (42.11 KB, image/png)
2009-05-24 23:32 UTC, Josh Triplett
  Details

Description Sven Arvidsson 2007-05-01 20:35:33 UTC
[ Forwarded http://bugs.debian.org/421320 ]

"Since upgrading to gnome-terminal 2.18, line-drawing characters no longer line up correctly.  They appear to overlap or not meet.  Examples include the scrollbar in the lower half of an aptitude window, the boxes around aptitude menus and dialog boxes, the volume bars in alsamixer, or many other terminal applications."
Comment 1 Sven Arvidsson 2007-05-01 20:37:10 UTC
Created attachment 87359 [details]
screenshot of problem

I can reproduce this, and I'm attaching a screenshot of the problem, showing xterm (on top) and gnome-terminal, both using DejaVu Sans Mono size 9. The volume bars in alsamixer does not seem to line up.
Comment 2 Behdad Esfahbod 2007-05-01 22:30:19 UTC
That is because of this commit:

2006-04-12  Behdad Esfahbod  <behdad@gnome.org>

        Bug 149633 – gnome-terminal messes up boxdrawing chars aligment

        * src/vte.c: Try to use the font first for all graphic characters.
        This results in better looking graphics with modern fonts.


Maybe we should revert it back for the line-drawing chars. (but not for other chars like Greek Pi).
Comment 3 Michael Vrable 2007-08-12 23:13:34 UTC
Created attachment 93558 [details] [review]
proposed patch

The attached patch fixes the rendering of line-drawing characters for me.  The patch is against a version of vte as packaged in Debian (0.16.6-1).  I originally posted this patch to the Debian bug-tracking system (http://bugs.debian.org/421320).
Comment 4 Michael Vrable 2007-11-12 21:27:44 UTC
Ping?

Any chance of the patch above being included in the official vte?  Or some other fix for this problem?  Each time the vte library is upgraded on my system, I have to go back and compile a new version with my patch included.  I've been using it for months now with no issues, and it fixes a (for me) very visible problem.

If the patch isn't acceptable for some reason, please let me know why and I'll see if I can fix it.
Comment 5 Behdad Esfahbod 2007-11-27 13:19:57 UTC
Why only those characters and not the full box-drawing set?
Comment 6 Michael Vrable 2008-01-28 01:39:57 UTC
Sorry for the slow response.

The original vte code was able to draw a limited set of characters, including some line-drawing characters (but not the full set) and some other assorted characters.  This custom code for drawing these characters was not used if the font already included the appropriate glyph.

My patch forced this built-in drawing of all the line-drawing characters for which there was already support, but I didn't try to add support for the remaining line-drawing characters.  The ones already supported already covered everything in my day-to-day use (primarily, line-drawing chracters needed for mutt's threaded message display).

I later discovered that installing the DejaVu fonts improved the situation markedly (previously, I believe I was using the original Bitstream Vera fonts).  With the font change, line-drawing characters line up much better--not perfectly, but close enough in most cases.  The main visible problem is now with U+2592 (checkerboard-filled rectangle), as shown in the earlier screenshot.

At the very least, I think it is useful to do our own rendering of U+2592 and maybe U+25AE.  Whether to draw the line-drawing characters ourselves depends on whether it is better to improve the rendering of these characters (marginally) at the cost of consistency with the unimplemented line-drawing characters, or whether it is worth it to add support for the currently-unimplemented characters.
Comment 7 Josh Triplett 2008-10-14 18:49:51 UTC
I can suggest one alternative which also appears to fix the problem.  The bad rendering of line-drawing characters seems to come from anti-aliasing them.  If I turn off all anti-aliasing in the system-wide Appearance preferences, the line-drawing characters look perfect, though everything else looks terrible. :)  So, if you turn off anti-aliasing when rendering line-drawing characters, they should look correct again.
Comment 8 Behdad Esfahbod 2008-11-29 06:54:36 UTC
Can you test with vte trunk?  We've switched over to pangocairo backend, so it may as well have been fixed by that.
Comment 9 Josh Triplett 2009-05-24 23:27:51 UTC
The problem still exists with vte 0.20.1 (Debian package version 1:0.20.1-1), which seems to use pango.
Comment 10 Josh Triplett 2009-05-24 23:32:07 UTC
Created attachment 135291 [details]
Screenshot of gnome-terminal with vte 0.20.1, demonstrating problem with line-drawing characters
Comment 11 Josh Triplett 2009-07-03 00:57:28 UTC
Ping?
Comment 12 Josh Triplett 2010-02-01 20:16:55 UTC
Re-ping?  Bug still exists with gnome-terminal 2.28.2 and libvte 0.22.5.
Comment 13 Kazuo Teramoto 2012-01-24 22:12:05 UTC
Ping? Any news on this? vte 0.30.1 still display bad rendering of line-drawing characters.

Someone have a workaround?
Comment 14 Behdad Esfahbod 2012-01-25 18:18:35 UTC
No one working on it AFAIK.
Comment 15 Lennart Poettering 2012-08-20 23:33:37 UTC
BTW, this is problematic when showing stuff like QR codes in a terminal using Unicode box drawing chars, like for example here:

https://plus.google.com/u/0/115547683951727699051/posts/g1E6AxVKtyc
Comment 16 Christian Persch 2012-08-21 11:20:57 UTC
Behdad: can you give me a hint what you think is the correct solution here:

- something like the attached patch, where we special-case those symbols,
- use a fixed font for these that we know works correctly,
- something with pango renderers?
- something else?

Also, I agree we shouldn't just do this for a few characters here and there but probably for the full blocks:

2500..257F; Box Drawing
2580..259F; Block Elements

currently we also specialcase parts of

2400..243F; Control Pictures

but I'm not sure that's required anymore.

Also, in case we do want to draw these symbols ourself, should we still be using vtedraw through vte_terminal_draw_rectangle/line or can we just use cairo directly?
Comment 17 Behdad Esfahbod 2012-08-21 15:39:06 UTC
If we end up drawing ourselves, cairo directly...

I was thinking that maybe using a tight font ascent/descent would fix this.  Probably would look too tight though.
Comment 18 Christian Persch 2012-08-24 19:18:04 UTC
Fixed on 0-34 and next.
Comment 19 Shawn Landden 2013-07-14 19:16:35 UTC
a developer should mark this fixed, which I can confirm
Comment 20 Christian Persch 2013-07-14 19:58:42 UTC
It'll be closed once vte-next lands on master.