Bug 393607 - Background colour on unusual unicode characters looks weird
Summary: Background colour on unusual unicode characters looks weird
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 18.04.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-28 13:20 UTC by Salvo "LtWorf" Tomaselli
Modified: 2021-03-10 19:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot of the issue (611.37 KB, image/png)
2018-04-28 13:20 UTC, Salvo "LtWorf" Tomaselli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvo "LtWorf" Tomaselli 2018-04-28 13:20:51 UTC
Created attachment 112295 [details]
screenshot of the issue

Look at the screenshot. You can see that the bus character has 1 pixel outside of its background, and the background of the ferry character is just wrong.


The characters that I use are those:
self.TRAM: '🚋',
self.BUS: '🚌',
self.WALK: '🚶',
self.BOAT: '⛴',

If it's any consolation, at least konsole is handling properly the vertical size of the ferry one. Every other thing makes larger rows for it (which means that kwrite overlaps the row with the next).

I have those packages installed (debian Sid):

fonts-dejavu
fonts-dejavu-core
fonts-dejavu-extra
fonts-noto-hinted
fonts-symbola
fonts-wine
xfonts-utils
Comment 1 Egmont Koblinger 2018-04-28 19:32:49 UTC
Note that while the tram, bus and walk symbols are "wide" according to Unicode 10.0 [1], the ferry symbol is of "ambiguous width". Such characters are handled as narrow by most terminal emulators, and also by glibc's wcwidth() function. The rest of the tabulation is also incorrect in its line, so your utility seems to assume it's also a wide character, whereas konsole handles it as narrow, i.e. taking one cell only (hence the weird background). It's another story that the actual glyph is so wide that it overflows a lot (and the bus also overflows by 1px).

I'm not sure if konsole has an option to show ambiguous characters as wide, I couldn't quickly find it. But even if it has, while enabling it might fix the ferry, it probably breaks plenty of other things in other apps.

(What's this tool by the way? Looks quite useful! Is it specific to Göteborg, or can it be used with any GTFS, and/or some online provider such as Google Maps?)

[1] ftp://ftp.unicode.org/Public/10.0.0/ucd/EastAsianWidth.txt
Comment 2 Salvo "LtWorf" Tomaselli 2018-04-28 22:47:06 UTC
The terminal application (which I wrote) does no special handling of unicode at all. Just expects every kind of vehicle to have length = 1 character. It has no idea of widths. So that's more likely konsole's doing.

It uses the API from västtrafik, so only works on this county.
https://github.com/ltworf/pysttrafik