You are not logged in.

#1 2015-07-27 04:46:12

rapturemachine
Member
Registered: 2015-02-22
Posts: 4

[SOLVED] Unicode icons are different between panel and terminal

I'm trying to get a config of lemonbar running, and I'm seeing some really weird behavior in the icons.  This particular config uses what I assume are Unicode icons in the bar - for example, "\ue205" for a beamed sixteenth note icon.  When I try to echo "\ue205" in my terminal, though, I get a blank box.  When I look up the Unicode information for that icon, I find this page, which tells me that the Unicode value for that icon is 266c, not e205.  If I look up Unicode information about e205, I find that apparently it's not a valid character.  If I try to use "\u266c" in the script for the panel, no icon at all shows up in the panel, not even a blank box.  But "\u266c" shows up in my terminal as the correct icon.

I'm using the same font in the panel as in my terminal (terminus font).  The script is written in sh, and I've tried sh -c with the echo.  Why is there a discrepancy in the icons I'm seeing in the panel and my terminal?  How can I use Unicode icons in the panel?  At the very least, how can I make sense of what icons the panel is using so I can pick from those?

Last edited by rapturemachine (2015-07-28 02:07:01)

Offline

#2 2015-07-27 05:55:33

ayekat
Member
Registered: 2011-01-17
Posts: 1,591

Re: [SOLVED] Unicode icons are different between panel and terminal

rapturemachine wrote:

If I look up Unicode information about e205, I find that apparently it's not a valid character.

Unicode has reserved a Private Use Areas (range E000-F8FF), which are slots that are guaranteed to never be assigned an official Unicode glyph. This allows users to create their own custom glyphs without having to overwrite existing Unicode glyphs.

The author of your linked config has most probably patched the font he is using, and has added a custom symbol in the private range, and is using that one - if you want exactly that symbol, you'd probably need to ask him.

rapturemachine wrote:

I'm using the same font in the panel as in my terminal (terminus font).  The script is written in sh, and I've tried sh -c with the echo.  Why is there a discrepancy in the icons I'm seeing in the panel and my terminal?

If your terminal encounters a glyph that has not been implemented in the font it has been configured to use (in your case terminus), it will search other fonts for that glyph - if it finds it, that font's symbol is used. So it is very likely that the beamed sixteenth note glyph is not provided by the terminus font, but in fact by some other font installed on your system, and your terminal is simply doing a font fallback.

As for the problem at hand, and from a quick (and unreliable) glance at the lemonbar source, it does not seem to do anything fancy like that, so if a glyph is not found in a font, it simply doesn't display the corresponding symbol.

The author of your linked configuration has probably encountered the same issue as you, and thus patched the font he is using.

EDIT

mfin/dotfiles/README.md wrote:

dependencies from AUR

rxvt-unicode-256xresources, dmenu2, lemonbar-xft-git, stlarch_font

... so lemonbar-xft-git probably implements font fallback - have you tried that one? (and I guess stlarch_font is the font in question that provides the symbols)

Last edited by ayekat (2015-07-27 06:10:27)


pkgshackscfgblag

Offline

#3 2015-07-28 02:06:19

rapturemachine
Member
Registered: 2015-02-22
Posts: 4

Re: [SOLVED] Unicode icons are different between panel and terminal

Turns out I had the stlarch font installed, and you were right, it was doing a font fallback.  I downloaded xfd to look at the full table for stlarch and got the icons in my panel sorted.  Thank you so much for the help!

Offline

Board footer

Powered by FluxBB