Nerd-fonts: Wrong codepoints for Octoicons

Created on 25 Sep 2015  Â·  19Comments  Â·  Source: ryanoasis/nerd-fonts

Hi again. ;)

This time the codepoints for octoicons seem to be wrong. Haven't found a pattern there. If I do an echo "\uF020" "\uF000" "\uF001" "\uF005" "\uF0B2", none of the correct symbols show up:
bildschirmfoto 2015-09-25 um 11 08 29
Ignore the wrong symbols in the theme..

Tested with NerdFonts 0.5.0 Knack Plus Nerd File Types Plus Font Awesome Plus Octicons Plus Pomicons with iTerm2 on OSX Yosemite.

☕ discussion ➤ future

Most helpful comment

I happened to notice a few things while playing around with my shell prompt.

While the readme links to the wiki page, the graphics on the wiki page are wrong. There's a broken/missing image under "Original Codepoints", and the image under "New Codepoints", I believe, actually shows the original ranges.

At the same time, it seems like some of the ranges on the correct image above are off, which I assume is due to changes that came about with more recent updates.

All 19 comments

Thanks. Looks like I have overlooked something when fixing font awesome. Will take a look.

@dritter Okay so the problem is both Font Awesome and Octicons start their glyph range at f000 so I had to pick one to take precedence. I chose Font Awesome and moved Octicons to a different range when _both_ sets of glyphs are in the patched font.

If you want to use the original unicode codepoints for Octicons you will have to use Knack Plus Nerd File Types Plus Octicons or one that does _not_ add Font Awesome

@ryanoasis so that means that the code points differ if I use a variant with or without Font Awesome? IMHO it is better to have consistent code points across different variants of the patched fonts. That would make life easier for 3rd party projects that rely on your fonts. And even for yourself: You than have to provide a correct icon/code point-table for each variant.

@dritter for Octicons yes that is correct.

You make a good point and it is worth considering. My thought was to try to keep all glyphs at their original position unless there are conflicts but you brought up the other side of it that there would be less consistently

I am unsure about this issue as well.
Either every project maintains a version for every different font, or for every version. Both are not very good. But now as you say it, maybe relocating is worse. It is better to provide interoperability between the font (that users choose once) and different projects (that users switch more frequently).

Example:
It is more likely for someone to use programs which require powerline-icons like a ZSH-theme, a VI-status bar and a tmux theme than to switch fonts. So the three different programs should rely on the "standard" code points for the powerline-icons than special settings the user must to for every program.

Man, I am really indifferent about that.. :grin:

Good points. Yeah it is a catch 22 in some sense :smile:

I will at least do an update for Octicons to https://github.com/github/octicons/releases/tag/v3.1.0

:+1:

Octicons now up to v3.2.0 so that'll be the one I include more than likely

Latest Octicons should now be included in v0.6.0 but the main point of this ticket is still to be discussed so leaving it open for now.

May I suggest an alternative solution (granted, there is no ideal one unless those fonts decide to change their glyph codepoints and that's unlikely)?
Current font map

Octicons:          ~165 in F000-27C
Font Awesome (FA): ~619 in F000-29E

If Octicons is a more popular font (with the GitHub support and all), it should have a higher priority.
So, would it not be better to leave Octicons as is, but add FA glyphs after Octicons range (so that in end you'd have first ~165 glyphs of FA overwritten by Octicons).
This way you could have full Octicons support and partial FA (except for the first ~165 glyphs), which might be better vs losing Octicons (I'd consider moved codepoint a lost one since all standard references would be incorrect).

P.S.
If you don't want to just discard those first FA glyphs, you could move them somewhere else, though don't see that would be of much help.

So just out of curiosity if I have font awesome and octicons installed how to I reference octicons?

@CrashyBang If you are using one of the patched fonts with both glyph sets (e.g. 'Complete') then the Octicons will be in a new range (f400 to f497) and _not_ their original range (f000 to f0db). This is due to a conflict of ranges with Font Awesome.

see below:

Original Range

octicon-original-range

New Range (when you have Font Awesome)

octicon-new-range

@ryanoasis awesome sorry I was not sure of the range number (4) i.e 4XXX if that makes any sense?

This is awesome thank you!

@CrashyBang No problem :smile: It should probably be clarified in the readme because I can see where it would be confusing right now :blush:

I happened to notice a few things while playing around with my shell prompt.

While the readme links to the wiki page, the graphics on the wiki page are wrong. There's a broken/missing image under "Original Codepoints", and the image under "New Codepoints", I believe, actually shows the original ranges.

At the same time, it seems like some of the ranges on the correct image above are off, which I assume is due to changes that came about with more recent updates.

@yarthur Thanks for pointing that out and reminding me. So I am still in the process of recovering my primary OS :cry: but looks like I had forgotten to upload that image to the wiki.

I will update them both sometime this weekend if I get back 100% up :smile:

@yarthur Wiki page has been fixed

@dritter Any strong objections on closing this issue? It seems we have settled on leaving the code points where they are in the Nerd Fonts Complete variations (the standard one 99.9% of users will use anyway)

If something changes at this point the major version would have to bump anyway due to breaking changes

Allright. Thanks @ryanoasis

Was this page helpful?
0 / 5 - 0 ratings

Related issues

logarytm picture logarytm  Â·  5Comments

Scrumplex picture Scrumplex  Â·  3Comments

blueyed picture blueyed  Â·  6Comments

boolim picture boolim  Â·  4Comments

laughedelic picture laughedelic  Â·  5Comments