You are not logged in.

#1 2022-03-27 07:26:45

Enrico1989
Member
Registered: 2018-07-05
Posts: 386

Inconsistent fonts sizes and/or horizontal overlap for glyphs in i3bar

(I know that several posts about this topic exists, but none of them helped me, or I haven't understood any of them to make use of the information contained therein.)

Long story short: glyphs that I use in i3 status bar don't work well.

I've been ingnoring this problem for months, so I don't remember when it originated. I vaguely remember that it happened from one day to another, without me messing around with config files. Indeed, at https://wiki.archlinux.org/title/I3#Ico … status_bar I read

Support for iconic fonts is built in since i3 version 4.20.

and for me

$ i3 --version
i3 version 4.20.1 (2021-11-03) © 2009 Michael Stapelberg and contributors

hence the mis-behavior of fonts might have happened with that update. Maybe because of a pre-existing wrong configuration on my side, entirely possible as I have understood X about fonts (nothing < x < nothing + epsilon, with epsilon as small as you like). Unfortunately, my memory is bad enough, so I don't remember how much time has passed since I first found icons mis-rendered.

Anyway, I have installed ttf-font-awesome and ttf-ionicons from the official repository and ttf-font-icons from the AUR.

Currently, here's the line which sets the font in

# in ~/.config/i3/config
font pango:DejaVuSansMono Nerd Font, Awesome 12

and the bar looks like this
i3bar-a.png
As you can see, all glyphs are correctly sized, but most of them are wrongly positioned (even the icon of the calendar is not correctly positioned, it's just that there's a manual space that I've forgot to remove before making the screenshot; same for the icons beside "system up to date" and "77G", for instance; on the other hand, the low volume icon beside 39% seems to have correct positioning without any manual handling of the spacing, as far as I can tell from the script in i3blocks-contrib).

If I change the line above according to the example at the linked page

font pango:DejaVu Sans Mono, Icons 12

I get this
i3bar-b.png
where I see that some glyphs have just fixed their horizontal spacing: camera, open lock, hard drive, down arrow, calendar (which I said had a manual space, so now it has too much space, accordingly), the clock (probably there's some manual space there as well); others have shrunk in size: spotify, wifi; and one has been completely screwd up: temperature.

How can I fix this mess?

Do I need to provide other information?

Oh, probably fc-list's output is important.

Offline

#2 2022-03-27 14:57:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,696

Re: Inconsistent fonts sizes and/or horizontal overlap for glyphs in i3bar

https://wiki.archlinux.org/title/I3#Ico … status_bar

ttf-font-icons — Non-overlapping and consistently sized mix of Awesome and Ionicons. This also avoids minor overlapping between DejaVu Sans and Awesome.
https://kageurufu.net/icons.pdf || ttf-font-iconsAUR.

?

On a guess, I'd say it's probably the monospace font that causes the overlap when a variable width font is added - do you get better results w/ "DejaVu Sans" (no mono)?

Offline

#3 2022-03-27 19:30:37

Enrico1989
Member
Registered: 2018-07-05
Posts: 386

Re: Inconsistent fonts sizes and/or horizontal overlap for glyphs in i3bar

Nope, this is what I get with

font pango:DejaVu Sans, Awesome 12

i3bar-c.png
It looks like the closed lock and the thermometer are the only glyphs which are the correct size.

Last edited by Enrico1989 (2022-03-27 19:36:01)

Offline

Board footer

Powered by FluxBB