• Need help with fonts in i3wm

    so today i wanted to change the i3blocks bar to some different font, so i installed ohsnap fonts from yaourt but its not working. i cant change the font to anything except awesome-fonts. so i did some troubleshooting:

    ~ grep /fonts ~/.local/share/xorg/Xorg.0.log
    [   488.066] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
    [   488.066] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
    [   488.066] 	(Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
    [   488.066] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
    [   488.066] 	(Run 'mkfontdir' on "/usr/share/fonts/75dpi/").

    i ran mkfontdir on /usr/share/fonts/100dpi and /75dpi, the folders are created in them now and there exists a font.dir file inside /100dpi and /75dpi with only value 0 in the files, and when i run <grep /fonts ~/.local/share/xorg/Xorg.0.log> again, i get the same “directory does not exist” error

    then i did:

    sudo fc-cache -fs
    sudo mkfontscale /usr/share/fonts/local
    sudo mkfontdir /usr/share/fonts/local

    as mentioned in github https://github.com/Elv13/Config_Files/tree/master/.fonts/ohsnap-1.8.0 of dev who created these fonts, but i dont think i needed to update the font cache because i got the fonts from yaourt, anyway

    then i added in .xinitrc:

    xset +fp /usr/share/fonts/local
    xset fp rehash

    but the fonts still dont work. i can see the font files present in the right locations that is:

    /usr/share/fonts/local    #.pcf files
    /usr/share/kbd/consolefonts    #.psfu files

    lastly: i created:

    Section "Files"
        FontPath  "/usr/share/fonts/local"

    after reading in https://bbs.archlinux.org/viewtopic.php?id=130562&p=5

    im not sure what im doing wrong or missing, because from some of the configs that ive seen all that needs to be done is in i3config add font pango: Monospace 9 and then in the bar block font pango: ohsnap, awesome 9

    Thanks for your help with this!

  • Marking this as solved. I believe there is something strange with the logs, since i see the logs stored in two locations, <cat /var/log/Xorg.0.log> gives current log and in it the font path has been set to location of fonts:

    [    25.277] (**) FontPath set to:
    [    25.277] (==) ModulePath set to "/usr/lib/xorg/modules"

    whereas <grep /fonts ~/.local/share/xorg/Xorg.0.log> shows very old logs with missing font.dir even though font.dir exists in the path and it shows build operating system 4.8.14 and current operating system 4.9.11, but in the /var/xorg/logs it shows build: 4.9.11 and current: 4.9.27 lts which is the kernel in use at the moment.

    but i still couldnt get ohsnap fonts to work, maybe something missing, anyway i found another good font, Iosevka, yaourt ttf-iosevka-term because in the other variants of iosevka, the ligations dont work in vim for example mathematical operators look broken like “==” appears without any gap inbetween and the “+” sign in “+=” is pushed inside the asignment operator but it looks fine in the “term” variant. although this font is also not working in i3bar but it works in the terminal and vim which is enough to make me happy! :)

fonts9 i3wm5 Posts 2Views 287
Log in to reply