question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Font rendering issue in Graphs (MesloLGS NF)

See original GitHub issue

Describe 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

Screenshot_20200831_173332

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:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
XenHatcommented, Sep 16, 2020

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:

 echo $PS1
\[\e[0;32m\]\u\[\e[0m\]\[\e[0m\]@\[\e[1;34m\]\h \[\e[0;35m\]\W\[\e[1;33m\] ⠅ \[\e[0m\]

You can then run a terminal emulator with “simplistic” font fallback, such as alacritty,termite, st, xst or kermit. This was my result out of the box (issue is present): image

And this was the result after removing gnu-free-fonts:

image

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

4reactions
sgleizescommented, Aug 31, 2020

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 provides FreeMono and its weird-looking braille patterns. This had changed the fallback font used to display the braille patterns to FreeMono, which was previously resolving to Verdana. 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Font rendering issue returned again - Blizzard Forums
And font rendering issue returned again, but now hero stats section in scoreboard. Maybe corrupted font atlas while calling draw?
Read more >
Why are Font Awesome characters not rendered or replaced ...
fontFamily in the search box and set the value to MesloLGS NF . GNOME Terminal (the default Ubuntu terminal): Open Terminal → Preferences...
Read more >
nerd font github
Nerd Font GithubGenerating font manifests Execute bin/generate-manifests. Patched programming fonts, such as Nerd Fonts…. Install Nerd Fonts On Linux ...
Read more >
Hi, the problem is from the font, try Hack nerd or MesloLGS NF ...
Hi there, The developers always use the terminal, but it is boring and has no colors or shapes. Today...
Read more >
812695 - [Read comment #414] [D2D] Text Rendering Issues ...
Firefox rendering bug screenshot from iGoogle page. ... [D2D] Text Rendering Issues due to Windows 7 Platform Update KB2670838 (MSIE 10 Prerequisite) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found