Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Can't get icons to show up #201

Open
syvanpera opened this issue Dec 19, 2020 · 8 comments
Open

Can't get icons to show up #201

syvanpera opened this issue Dec 19, 2020 · 8 comments

Comments

@syvanpera
Copy link

I just found out about this project and quickly tried out the sample bar provided. Seems to work as advertised, but for some reason the icons don't show up for me. I all the steps in the example (although I already had some of the icon fonts), mine are installed in .local/share/fonts instead of .fonts, but that shouldn't matter. But they don't show up.
Any ideas what I could do?

@soumya92
Copy link
Owner

The default sample bar assumes that icon fonts have been cloned to ~/Github/. Is that where you cloned the font repositories?

Having the fonts installed is not enough, because sometimes the fonts change which icons are assigned to which codepoints. So it's important to have the matching version of the codepoints file available as well. The simplest way to ensure that is to clone the font repository and install a symlink of the font, so that anytime the repo is updated, the installed font is automatically updated as well.

See https://barista.run/pango/icons#default-installation for more details. Hopefully that works for you.

@jokeyrhyme
Copy link

Would be neat to have an example of using Go 1.16's embed feature so the barista executable doesn't need runtime access to the font repository: https://golang.org/pkg/embed/

@soumya92
Copy link
Owner

soumya92 commented Mar 31, 2021

Technically barista doesn't need the font files, the status bar program does. There's no format for embedding icons in the i3bar protocol, so the best we can do is use pango fonts. But that requires the font to be available at runtime.

While we could embed the codepoint files, that would mean rebuilding the bar anytime the fonts update. Instead, I prefer to read the codepoints file at runtime so that fonts can be updated more frequently without issues. (The codepoint file must correspond to the version of the font being loaded by the status bar program)

@jokeyrhyme
Copy link

Ah, thanks for the explanation

At the moment I have the fonts themselves managed by my distribution's package manager, and I'm separately/manually using git to manage the codepoints repository, I'll be sure to make an effort to keep these synchronised in future

@taigrr
Copy link

taigrr commented Aug 8, 2022

I ran into this issue because I was using font-awesome 6. I have a fork where I've updated the fontawesome subpackage to use FA-6. Let me know if you want me to PR it and how. (I just changed the number, realistically we'd probably have to find a way to fallback and support both to avoid breaking changes.)

@soumya92
Copy link
Owner

soumya92 commented Aug 8, 2022

@taigrr If you send a PR that uses fa6- prefix, that would be simple to integrate. I probably should have versioned fontawesome anyway when I moved from 3 to 4 (or 4 to 5?, I don't remember), but we can do that going forward.

@taigrr
Copy link

taigrr commented Aug 8, 2022

Great, and I'll leave the fa- as-is, but should I also add fa-5 as syntactic sugar to make it easier for people to be explicit?

@soumya92
Copy link
Owner

soumya92 commented Aug 8, 2022

Up to you 😉
I think that's a good idea

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants