Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Braille character rendering issue with cpu and mem graphs #18

Open
dgrr opened this issue Apr 10, 2018 · 32 comments
Open

Braille character rendering issue with cpu and mem graphs #18

dgrr opened this issue Apr 10, 2018 · 32 comments
Labels
bug Something isn't working

Comments

@dgrr
Copy link

dgrr commented Apr 10, 2018

Gentoo.
x86_64.
st.
I do not use tmux xd.
go get.

screenshot from 2018-04-10 13-08-55

I solved deleting braille chars from your library but I want you to know about this.

@cjbassi cjbassi added the bug Something isn't working label Apr 10, 2018
@cjbassi
Copy link
Owner

cjbassi commented Apr 11, 2018

I'm getting the same issue when running gotop inside st, so it looks like st doesn't support braille glyphs, at least not natively. Not sure if there's a way to fix that, maybe something has to be compiled in at build time to add support, idk.

@dgrr
Copy link
Author

dgrr commented Apr 11, 2018

@cjbassi Right now I am using rxvt-unicode and (I don't know why) does not support unicode braille characters xd

@cjbassi
Copy link
Owner

cjbassi commented Apr 11, 2018

Yah same here, braille also doesn't show on xterm at least for me. :/

@cjbassi cjbassi changed the title Unsupported hipster dot Braille character rendering issue with cpu and mem graphs Apr 12, 2018
@cjbassi cjbassi added the wontfix This will not be worked on label Jul 31, 2018
@AarynSmith
Copy link

I was having a similar issue with the graphs until I installed the Symbola font. Worth a shot if you don't have it installed already.

@yydcool
Copy link

yydcool commented Nov 15, 2018

I'm using Archlinux, solved by install package ttf-ubraille

@Yrp
Copy link

Yrp commented Nov 19, 2018

Is this problem solved, I have the same problem, my system is manjaro, I use terminator

@cjbassi
Copy link
Owner

cjbassi commented Nov 20, 2018

ttf-ubraille didn't work for me on xterm or terminator unfortunately.

@Yrp
Copy link

Yrp commented Nov 20, 2018

By installing package ttf-ubraille and the Symbola font, and restart the terminator, the issue has be solved.
I don't quite know which of these two packages works.

@NoMod-Programming
Copy link

Still not working on xterm :(

Also, the Debian repositories don't seem to have ttf-ubraille, so that's not an option for me.

@duncanam
Copy link

I wanted to +1 this issue with urxvt. I have installed ttf-ubraille, did not make any changes. Is there a way I can change the symbol manually with something else? Like a period or * ?

@cjbassi
Copy link
Owner

cjbassi commented Dec 28, 2018

@robotdna Unfortunately not very easily atm. Gotop uses https://github.com/cjbassi/termui which uses https://github.com/cjbassi/drawille-go to draw the braille characters, and the logic is all hard coded there. I'm planning on fixing up https://github.com/gizak/termui and switching back to that, and once that happens then it should be easier to toggle the rendering character to something else.

@duncanam
Copy link

@robotdna Unfortunately not very easily atm. Gotop uses https://github.com/cjbassi/termui which uses https://github.com/cjbassi/drawille-go to draw the braille characters, and the logic is all hard coded there. I'm planning on fixing up https://github.com/gizak/termui and switching back to that, and once that happens then it should be easier to toggle the rendering character to something else.

Okay, that makes sense. I'm not too broken up about it, it's not like the graph provides exact information haha. Thanks for looking into it.

@deckardstp
Copy link

deckardstp commented Dec 30, 2018

screenshot from 2018-12-30 22-38-21
I have a somehow similar topic. Since yesterday I only see graphs like this. Tried different terminals and it occurs in any. Standard is kitty. Is this related?

The output of uname -a
4.19 & 4.20
Terminal shell (like zsh or bash)
zsh
Terminal emulator (like iTerm or gnome terminal)
kitty
Using tmux?
no

@cjbassi
Copy link
Owner

cjbassi commented Jan 2, 2019

@deckardstp Similar but different issue for sure. Looks like the braille characters are rending fine, but it's also showing the empty braille cells in addition to the filled in line.

@cjbassi
Copy link
Owner

cjbassi commented Feb 18, 2019

There was a reddit thread posted here where the OP was having this issue and he was able to fix it when using URxvt by installing the symbola font and loading it in the .Xresources file. Seems like installing symbola was working for some people but it looks like you also have to load it in .Xresources at least for URxvt. Hope that helps someone!

@cjbassi cjbassi removed the wontfix This will not be worked on label Mar 1, 2019
@duncanam
Copy link

There was a reddit thread posted here where the OP was having this issue and he was able to fix it when using URxvt by installing the symbola font and loading it in the .Xresources file. Seems like installing symbola was working for some people but it looks like you also have to load it in .Xresources at least for URxvt. Hope that helps someone!

This solved it for me! To try to help those who are on a similar platformgr as me with Arch+i3+urxvt:

  1. grab ttf-symbola from AUR
  2. fc-list | grep Symbola
  3. Place the name in .Xresources as a font import. I did this:
    URxvt*font: xft:Symbola:style=Regular:pixelsize=14
  4. don't forget to rebuild with xrdb .Xresources

This worked, thanks!

@andrewpavlenko
Copy link

I got the same issue with braille characters rendering after creating font configuration file (see fontconfig). Without that file all works fine. Here is how my fonts.conf looks. Maybe I should add any rules for braille fonts? Can't find any information about that.

@dgrr
Copy link
Author

dgrr commented Aug 8, 2019

I think it's just a matter of the font config you have. In Gentoo works fine using infinality.conf

@andrewpavlenko
Copy link

@dgrr I'm Ubuntu user. Also I'm using urxvt as my terminal emulator. Setting this line fixed rectangles in graphs

URxvt.font: xft:Fantasque Sans Mono:size=10:style=Bold, xft:symbola:size=11

I've just added xft:symbola:size=11, but seems like dots still not rendering correctly. Here is how it looks now: . It looks like graph dots have wrong spacing.

@jpmvferreira
Copy link

I'm having the same issues, i'm running Manjaro with kitty tho, so the fixes don't apply to me (i've tried), anybody know a workaround?

@jpmvferreira
Copy link

screenshot from 2018-12-30 22-38-21
I have a somehow similar topic. Since yesterday I only see graphs like this. Tried different terminals and it occurs in any. Standard is kitty. Is this related?

The output of uname -a
4.19 & 4.20
Terminal shell (like zsh or bash)
zsh
Terminal emulator (like iTerm or gnome terminal)
kitty
Using tmux?
no

Did you find a solution? The issue still persist on my setup.

@deckardstp
Copy link

Did you find a solution? The issue still persist on my setup.

My original installation was deleted in the meantime. I installed a version from AUR which didn't show the issue as far as I can remember. Also I switched to tilix due to the better window tiling. My new manjaro installation doesn't show this behavior. Sorry, that I can't help you any better.

@duncanam
Copy link

duncanam commented Oct 4, 2019

@Jpund Do you see any fonts I have in my config that you don't have enabled for your terminal? I got mine working, at least with the ones I have here.

@jpmvferreira
Copy link

@Jpund Do you see any fonts I have in my config that you don't have enabled for your terminal? I got mine working, at least with the ones I have here.

I've just realized that kitty can only use monospaced fonts, due to the way it renders text, and although i have those installed in my system, i cannot use them in kitty if they are not monospaced (it doesn't even show in the kitty command to list all available fonts).

Sadly none of the fonts you have displayed, and i've installed on my system, are monospaced.

Should i take this issue to kitty?

@gkeep
Copy link

gkeep commented Oct 6, 2019

@Jpund There is a fix for kitty. As suggested, you need to install symbola font (ttf-symbola in AUR), then add symbol_map U+2800-U+28FF Symbola to your kitty.conf.

image

@jpmvferreira
Copy link

@gkeep Damn, how did i miss that? Anyways, it does in fact work, since it replaces the character that was giving me trouble with, thanks!

@omarkamalakis
Copy link

Hey I had a similar problem on my machine and I fixed it by removing gnu-free-fonts. Apparently, free-font-mono was overriding the other fonts with its own type of braille (the one with the empty circles). I deleted it and installed another braille font (Dejavu Sans works nicely, as does ubraille) and it worked. Use gucharmap to see where your problematic fonts are.

@arbaes
Copy link

arbaes commented Dec 2, 2019

Hey I had a similar problem on my machine and I fixed it by removing gnu-free-fonts. Apparently, free-font-mono was overriding the other fonts with its own type of braille (the one with the empty circles).

That's the issue I had, I would have preferred to find where to config the fallback font instead of uninstalling the one set. But it did the trick for me so thanks @omarkamalakis

@deckardstp
Copy link

@Jpund There is a fix for kitty. As suggested, you need to install symbola font (ttf-symbola in AUR), then add symbol_map U+2800-U+28FF Symbola to your kitty.conf.

image

thanks! worked great for me on manjaro. ttf-symbola is now outdated and the successor is ttf-symbola-free.

@markuspeloquin
Copy link

markuspeloquin commented Apr 1, 2020

tl;dr I have a real solution for anybody who needs it :). Get rid of gnu-free-mono-fonts (fedora) fonts-freefont-ttf (I think? debian).


So I found a solution-ish here, which I modified to be easier and specific: https://unix.stackexchange.com/questions/247108/how-to-find-out-which-unicode-codepoints-are-defined-in-a-ttf-file

#!/usr/bin/env python3

import os
import sys
from fontTools.ttLib import TTFont

def find(root: str) -> None:
    print(f'Looking for U+2800 in {root}')
    for dirpath, dirnames, filenames in os.walk(root):
        for name in filenames:
            base, ext = os.path.splitext(name)
            if ext.lower() not in ('.ttf', '.otf'): continue
            pathname = os.path.join(dirpath, name)
            try:
                font = TTFont(pathname)
                for cmap in font['cmap'].tables:
                    if cmap.isUnicode() and 0x2800 in cmap.cmap:
                        print(f'Found in {pathname}')
                        break
            except Exception as e:
                print(f'Failed to read {pathname}: {e}')

for dir in [os.path.join(os.environ['HOME'], '.fonts'), '/usr/share/fonts']:
    if os.path.isdir(dir):
        find(dir)

pip install fonttools and run it. It showed which fonts actually provide Braille symbols, because there's only a few. I see UBraille and Symbola (a couple attempts of mine to fix this), unifont, FreeMono, and DejaVu Sans/Serif fonts. That grubby GNU FreeMono font was the problem. Get rid of it. In Fedora, it was gnu-free-mono-fonts, and nothing required it.

Then restarting the process fixed it.

@dosssman
Copy link

dosssman commented Jun 2, 2020

Greetings.

Maybe a little bit too late, but the following steps happened to solve the issue with gotop's CPU lines not showing up correctly, as described in the first messages.

The OS is Arch Linux, and the terminal is termite.

  1. Installing the Braille font package (ttf-ubraille on the AUR. Will likely differ for other distributions).
  2. Regenerate the font cache with fc-cache -fv, or equivalent.
  3. Edit the ~/.config/fontconfig/fonts.conf according to the font used by the terminal. The goal is to set the Braille font as a fallback option, in case the character gotop needs to display is not found in the default font. In my case, termite was set to use the Monospace font, so the file looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <!-- -->
 <fontconfig>
   <!-- Generic name aliasing -->
   <alias>
     <family>monospace</family>
     <prefer>
       <family>Liberation Mono</family>
       <family>Braille</family>
    </prefer>
  </alias>
</fontconfig>

After this, gotop's line are displayed properly.

@xxxserxxx
Copy link

Thanks @dosssman. gotop (active development) lives over at xxxserxxx/gotop now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests