Guake / guake

Drop-down terminal for GNOME
https://guake.github.io
GNU General Public License v2.0
4.39k stars 575 forks source link

White space character next to emoji icons are sometimes not rendered #1823

Open behrangsa opened 3 years ago

behrangsa commented 3 years ago

Guake version

➜ guake --version
Guake Terminal: 3.7.0
VTE: 0.60.3
VTE runtime: 0.60.3
Gtk: 3.24.20

Describe the bug

White space character next to emoji icons are sometimes not rendered or are rendered narrower than they should be (e.g. when on the right side of the emoji, there's a white space).

FYI, some other terminal emulators exhibit the same problem (e.g. GNOME Terminal 3.36.1.1).

Expected behavior

This text to be rendered with one white space on left, and one white space on the right side of the cloud emoji (font: Monospace Regular 12):

~/Downloads on ☁️ behrangsa

Actual behavior

The actual rendering is like this:

guake

Compare this to how xed renders the same string using the same font:

xed

To Reproduce


Please run $ guake --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting. And make sure you run the command OUTSIDE the Guake.

$ guake --support Guake Version: 3.7.0 Vte Version: 0.60.3 Vte Runtime Version: 0.60.3 -------------------------------------------------- GTK+ Version: 3.24.20 GDK Backend: GdkX11.X11Display -------------------------------------------------- Desktop Session: cinnamon -------------------------------------------------- Display: :0 RGBA visual: True Composited: True * Monitor: 0 - DEL DisplayPort-2 * Geometry: 2560 x 1440 at 2560, 0 * Size: 597 x 336 mm² * Primary: True * Refresh rate: 59.95 Hz * Subpixel layout: unknown * Monitor: 1 - DEL DisplayPort-4 * Geometry: 2560 x 1440 at 0, 0 * Size: 597 x 336 mm² * Primary: False * Refresh rate: 59.95 Hz * Subpixel layout: unknown
Davidy22 commented 2 years ago

If gnome terminal displays the exact same issue it's likely that the issue is inherited from GNOME VTE which is shared between our terminals. From a cursory test, it seems like this is happening because of art characters that are wider than a monospace character, but VTE is giving them regular monospace width and allowing trailing overlap. I think you'll find that if you replaced the whitespace to the left with any character, you'll see a little overlap.

Did a quick search on the VTE bug tracker and I found this issue where handling unusual character widths in unicode is discussed. Until that gets resolved upstream, we'll continue to see wonky rendering when trying to use characters that aren't a clean multiple of a monospace width in a monospaced terminal.