You are not logged in.

#1 2021-04-07 08:24:04

Garzet
Member
From: Radoboj, Croatia
Registered: 2018-08-17
Posts: 8

Pango font configuration - can't get Nerd Fonts to display

Hey,

I'm trying to configure i3blocks with Nerd Fonts. I cannot get them to display. What I'm trying to display is a battery icon from the private use area (e.g. unicode \uf57b). This is the code that I use:

<span font='Symbols Nerd Font'>\uf57b</span>

I get \uf57b on the bar since it fallbacks to other font I guess. When I disable fallback, I get not-found-unicode-symbol icon for each character. pango-view shows the same behaviour with:

pango-view --font='Symbols Nerd Font' --markup --text='<span fallback="false">\uf570</span>'

I've used gucharmap to see if the icons exist there and, while they do, when I drag them to the text-box at the bottom ("Text to copy"), I get totally different symbol from the one I dragged. I'm very confused with how fonts work. Thanks for any help!

Last edited by Garzet (2021-04-07 08:24:40)

Offline

#2 2021-04-07 08:36:13

seth
Member
Registered: 2012-09-03
Posts: 19,799

Re: Pango font configuration - can't get Nerd Fonts to display

FC_DEBUG=4 pango-view --font='Symbols Nerd Font' -t "" | grep family:

Offline

#3 2021-04-07 09:49:54

progandy
Member
Registered: 2012-05-17
Posts: 4,235

Re: Pango font configuration - can't get Nerd Fonts to display

pango-view / i3bar do not interpret the \u notation. You'll have to give it the unicode symbol directly, or use your shell / printf to convert it:

symbol="" # symbol directly as utf8
symbol="$(printf '\uf570')" # posix portable
symbol=$'\uf570' # for bash / zsh

Edit: pango-view does interpret html entity numbers like '&#xf570;', i3bar should do that as well.

I've used gucharmap to see if the icons exist there and, while they do, when I drag them to the text-box at the bottom ("Text to copy"), I get totally different symbol from the one I dragged. I'm very confused with how fonts work. Thanks for any help!

Possibly gucharmap uses a different font in the text-box that has different symbols for the given unicode or falls back to another font that has a symbol with that codepoint.

Last edited by progandy (2021-04-07 09:56:05)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2021-04-09 06:14:58

Garzet
Member
From: Radoboj, Croatia
Registered: 2018-08-17
Posts: 8

Re: Pango font configuration - can't get Nerd Fonts to display

progandy wrote:

Edit: pango-view does interpret html entity numbers like '&#xf570;', i3bar should do that as well.

Aha, this is working! Thx, I'll considered this solved, but I'm still a bit confused with the fonts... but this is a discussion for another day!
Thanks again.

Last edited by Garzet (2021-04-09 06:15:41)

Offline

Board footer

Powered by FluxBB