[BUG] Font rendering issue in Graphs (MesloLGS NF)
See original GitHub issueDescribe the bug
I hadn’t used bashtop in a while and just recently migrated to bpytop. First of all thank you for this amazing piece of software. Upon trying out the new version, the braille characters are no longer displayed properly in graphs. This used to work in past bashtop versions, and the issue occurs with the latest bashtop and bpytop. I didn’t change fonts in the mean time.
I’ve tried using a different font, and it seems the graphs only display properly when I select a Bold font style. So it works with MesloLGS NF Bold, but not with the Regular variant. Same thing for Fira Mono, etc.
Expected behavior
Graphs should display properly regardless of the font style used.
Screenshots
Info (please complete the following information):
- bpytop version: 1.0.21
- psutil version: 5.7.2
- Linux distribution and version: Arch (latest)
- Terminal used: Konsole
- Font used: MesloLGS NF Regular
- Python version: 3.8.5
For reference the font used is the one recommended for powerlevel10k
(https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k)
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
related: https://github.com/cjbassi/ytop/issues/79
TLDR: remove
gnu-free-fonts
as mentioned above, or create a font configuration to replace `GNU FreeFont with another font.It is easy to test if you are affected by this issue by using a braille character in your shell prompt. I used
⠅
here:You can then run a terminal emulator with “simplistic” font fallback, such as
alacritty
,termite
,st
,xst
orkermit
. This was my result out of the box (issue is present):And this was the result after removing
gnu-free-fonts
:P.S. An interesting note is that gnome-terminal can render braille correctly, while kermit, st and termite does not. All those terminal emulators are built using the VTE library, so there must be something specific to them which causes this font selection issue.
In short, I can confirm that removing
gnu-free-fonts
works. Someone more versed in the arts of freefont could create a config file that pushes those fonts at the very end of the lookup list… I tried and I haven’t succeeded yet.EDIT: Typos and such
Alright just found it. It’s actually not a konsole issue but a font fallback/configuration issue.
I installed the package
gnu-free-fonts
(on arch) a while ago, which providesFreeMono
and its weird-looking braille patterns. This had changed the fallback font used to display the braille patterns toFreeMono
, which was previously resolving toVerdana
. The following command allows to diagnose which font is being picked to display a braille character:FC_DEBUG=4 pango-view --font="MesloGLS NF" -t "⠁" | grep family:
Removing the package restored the original rendering properly. An alternative solution would be to change the font configuration to specify the font fallback explicitly. This thread has some information about how to do this, but I can’t confirm since removing the package was an acceptable resolution in my case. The arch wiki could be helpful as well.