gabrielelana / awesome-terminal-fonts

Tools and instructions on how to have awesome symbols in a terminal with a monospace font
MIT License
2.45k stars 230 forks source link

There's a better way #3

Closed pirj closed 10 years ago

pirj commented 10 years ago

I think there's a better way for fontawesome to be used in terminal. Just install FontAwesome.otf file and fix .Xresources:

*faceName: inconsolata, font-awesome

No need to patch existing fonts. No need to support them all (there are ~30 popular terminal fonts).

gabrielelana commented 10 years ago

Thank you, I didn't know that you could have fallbacks I will try that for sure :smile:

However there's a problem: many symbol fonts share the same unicode section (mainly the E000-F8FF aka the "Private Use Area") and so the fallback strategy wouldn't work :disappointed:

Of course if you want to use only one symbol font, or if you create your symbol font with something like http://fontello.com, your solution will work better than patching

Questions: do you use that strategy? Are you happy with the result? Symbol glyphs are rendered "correctly"? Can we see a screenshot?

pirj commented 10 years ago

Here you go http://oi41.tinypic.com/153wbja.jpg I've removed that stuff from .Xresources and it still works. Yep, clashes may happen, but font-awesome plays well with your Pomicons font (thank you for that font BTW!). I have found all this couple hours ago, but pretty happy with how it goes.

Check out screenshot's bottom right, that's a modification of Font Awesome's cheatsheet page: http://sprunge.us/eFTc (check out @font-face), it needs a link to TTF file. Probably it makes sense to add this to Pomicons's readme so that people may cut'n'paste chars from readme to wherever they want.

gabrielelana commented 10 years ago

I've removed that stuff from .Xresources and it still works.

I (finally) found out how things works. Yes you're right xft does have a fallback mechanism but by default you don't know witch font will be selected as a fallback for a particular code point (that's why some glyphs are not displayed in your screenshot). I found a complete solution here, you can read the conversation that led to the solution here

I will update the README with this informations, I guess that the merge it's pretty useless (I've always felt it like a bit of an hack) but maybe I can turn it in a relocation script for glyphs to avoid clashes

Yep, clashes may happen, but font-awesome plays well with your Pomicons font (thank you for that font BTW!).

You're welcome, glad you like it :smile:

Check out screenshot's bottom right, that's a modification of Font Awesome's cheatsheet page: http://sprunge.us/eFTc (check out @font-face), it needs a link to TTF file. Probably it makes sense to add this to Pomicons's readme so that people may cut'n'paste chars from readme to wherever they want

I will do that

Thank you again for your contribution :smile:

pirj commented 10 years ago

Thanks for digging for an explanation how that works!

gabrielelana commented 10 years ago

Implemented the fallback strategy in place of the patching strategy

pirj commented 10 years ago

Wicked!