Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text list of nerdfont characters #448

Closed
ranebrown opened this issue Mar 2, 2020 · 17 comments · Fixed by #1137
Closed

Text list of nerdfont characters #448

ranebrown opened this issue Mar 2, 2020 · 17 comments · Fixed by #1137

Comments

@ranebrown
Copy link

Is there a full list of all nerdfont characters available similar to http://www.unicode.org/Public/UNIDATA/UnicodeData.txt? I'm looking for something that could be used with Unicode.vim. See chrisbra/unicode.vim#39.

@ryanoasis
Copy link
Owner

Hey, at first I was going to suggest https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/test-fonts.sh but that isn't for parsing just a formatted visually grep-able table.

https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib/i_all.sh is probably the closest script to get a list of characters but probably still not quite what you're looking for but likely needs to be tweaked as it's mostly a convenience for having variables represent the glyphs

@meased
Copy link

meased commented Mar 22, 2020

I was looking for this as well. I couldn't find it so I made a quick script that parses the files mentioned above and outputs a nicer file with just the icon and the name of the icon. I posted it at https://gitlab.com/dmease/nerd-font-dmenu.

You can generate the file yourself, or just grab nerdfont.map from my repo and be done with it.

@Jake-Gillberg
Copy link

Jake-Gillberg commented Sep 21, 2020

Done again at https://gitlab.com/jake.gillberg/nerd-fonts-glyph-list

formatted like:

e717 dev github full                                                                                      
e718 dev nodejs small                                                                                     
e719 dev nodejs                                                                                           
e71a dev hackernews  

@mochaaP
Copy link

mochaaP commented Jan 26, 2023

Wrote a quick dirty script by parsing the css:

https://nerd-fonts-glyph.deno.dev

If it's failing just ping me. (p.s. don't except much code quality, it's only 5 minutes of script-fu)

@Finii
Copy link
Collaborator

Finii commented Jan 26, 2023

?! Reminds me of #1059 (comment)

The next comments have the commands how to create the lists. Very easy. What do you need?
And of course with hex numbers ;-)

@mochaaP
Copy link

mochaaP commented Jan 26, 2023

Hey @Finii, I changed it to return the glyphs directly.

I'm wondering can we have a list (preferably csv) in the repository or in the releases? Currently the only stable way to do that is parsing the scripts in bin/scripts/lib/ or parsing the CSS. If those metadata could be provided, integrations can update their codepoints easily in case a future breaking change occurs.

@Finii
Copy link
Collaborator

Finii commented Jan 26, 2023

@mochaaP Creating such a list is very easy for Nerd Fonts (*). We just need to define how it shall look like. It can then be autocreated by the CI on any changes and be part of the Release packages.

Must admit did not read all the text above very carefully. Just define some format all people can live with. And then I also like csv but nowadays everyone uses jq and it does have its benefits, so maybe json? This all depends of course what the use of the list is :-D

Looking on the original poster above the UNIDATA list looks like this

00AC;NOT SIGN;Sm;0;ON;;;;;N;;;;;
00AD;SOFT HYPHEN;Cf;0;BN;;;;;N;;;;;
00AE;REGISTERED SIGN;So;0;ON;;;;;N;REGISTERED TRADE MARK SIGN;;;;
00AF;MACRON;Sk;0;ON;<compat> 0020 0304;;;;N;SPACING MACRON;;;;
00B0;DEGREE SIGN;So;0;ET;;;;;N;;;;;

Hmm, colon separated values ;-)

return the glyphs directly

I'm not sure if putting the glyphs directly into the file is a good idea 🤔 Otoh we have it in the i_*.sh also.

(*) I mean, we autocreate everything from the names stored in the font files: i_*.sh, css, cheat-sheet, ... It's a bit convoluted, but the data ORIGIN is the font files itselfs.

@Finii
Copy link
Collaborator

Finii commented Feb 4, 2023

@mochaaP

Is this a good format an data?

23fb nf-iec-power
23fc nf-iec-toggle_power
23fd nf-iec-power_on
23fe nf-iec-sleep_mode
2665 nf-oct-heart
26a1 nf-oct-zap
2b58 nf-iec-power_off
e000 nf-pom-clean_code
e001 nf-pom-pomodoro_done
e002 nf-pom-pomodoro_estimated
e003 nf-pom-pomodoro_ticking
e004 nf-pom-pomodoro_squashed
e005 nf-pom-short_pause
e006 nf-pom-long_pause
e007 nf-pom-away
e008 nf-pom-pair_programming
e009 nf-pom-internal_interruption
e00a nf-pom-external_interruption
e0a0 nf-pl-branch
e0a1 nf-pl-current_line
e0a1 nf-pl-line_number
e0a2 nf-pl-hostname
e0a2 nf-pl-readonly
e0a3 nf-ple-column_number
e0a3 nf-ple-current_column
e0b0 nf-pl-left_hard_divider
e0b1 nf-pl-left_soft_divider
e0b2 nf-pl-right_hard_divider
e0b3 nf-pl-right_soft_divider
e0b4 nf-ple-right_half_circle_thick
e0b5 nf-ple-right_half_circle_thin
e0b6 nf-ple-left_half_circle_thick
e0b7 nf-ple-left_half_circle_thin
e0b8 nf-ple-lower_left_triangle
e0b9 nf-ple-backslash_separator
e0ba nf-ple-lower_right_triangle
e0bb nf-ple-forwardslash_separator
e0bc nf-ple-upper_left_triangle
e0bd nf-ple-forwardslash_separator_redundant
e0be nf-ple-upper_right_triangle
[...]

What would be the name for that list in the repo? Where to put it?

@Finii
Copy link
Collaborator

Finii commented Mar 2, 2023

@mochaaP Hmm, I believe your list at https://nerd-fonts-glyph.deno.dev/ is wrong? The 5 hex-digit nf-md-* entries have wrong codepoints?

Copy and pasted from the raw view

grafik

Or here:

grafik

Edit:
If I remember correctly for some formats you need to formulate the 5 digit codes as two UTF16 codes; but that is also not compatible because some other formats will complain that the individual UTF16 codes are wrong. So \u usually specifies a UTF16 code following, but 5 digits is beyond 16 bits and can not be expressed. Some have \U for UTF32, but not all. Using two UTF16 to express one 32 bit code is as I sayed sometimes possible, sometimes not.
I do not know how you fill the data, but it seems you use \u.

@mochaaP
Copy link

mochaaP commented Mar 2, 2023

Thanks for the feedback! On it.

@Finii
Copy link
Collaborator

Finii commented Mar 2, 2023

If you like we can put your generator into this repo and activate a workflow for it so that it is always automatically updated.
In this way I do not need to write my own ;-)

Finii added a commit that referenced this issue Mar 2, 2023
[why]
Somebody might want to have a file where all symbols we add are listed.
At the moment there are only the i_*.sh scripts and the CSS files. Both
are rather unwieldy.

[how]
Just create a json file with all symbol names, like the CSS file.

Fixes: #448

Signed-off-by: Fini Jastrow <[email protected]>
Finii added a commit that referenced this issue Mar 2, 2023
[why]
Somebody might want to have a file where all symbols we add are listed.
At the moment there are only the i_*.sh scripts and the CSS files. Both
are rather unwieldy.

[how]
Just create a json file with all symbol names, like the CSS file.

Fixes: #448

Signed-off-by: Fini Jastrow <[email protected]>
@Finii
Copy link
Collaborator

Finii commented Mar 2, 2023

The changes to the CSS script are so simple, I just added writing a json to that script.
Thanks for the comments and inspriation @mochaaP !

@Finii
Copy link
Collaborator

Finii commented Mar 2, 2023

Also add a bit of meta information, hope this is useful:

image

@mochaaP
Copy link

mochaaP commented Mar 2, 2023

Glad to hear that! 😀
I'm pointing nerd-fonts-glyph.deno.dev to that JSON now.

@Finii
Copy link
Collaborator

Finii commented Mar 2, 2023

I'm pointing nerd-fonts-glyph.deno.dev to that JSON now.

Note that I dropped the nf- prefix, so that is not 100% compatible.
Tell me if it would be better to have the prefix; I thought it is pointless.

@Finii
Copy link
Collaborator

Finii commented Mar 2, 2023

Unrelated comment...

This is so ridiculous:

image

The small arrows are in fact bigger than the non-small arrows, because all glyphs are individually scaled. Maybe we should fix that one group at least.

@Finii Finii mentioned this issue Mar 2, 2023
2 tasks
Finii added a commit that referenced this issue Mar 12, 2023
[why]
Just having the characters themselves as data for the name is convenient
in some cases; but sometimes the codepoint is also nice. And it
certainly improves the human interaction / check of the file.

[how]
Include the character and the codepoint in the glyph-name data. This is
a breaking change. But given that the json file is rather new I believe
we can get away with it.

Sorry for the inconvenience for all the early adaptors that already use
the old/previous format. But now we are more future proof and can add
even more data without breaking old json code.

Related:
#1140
kovidgoyal/kitty#2972
chrisbra/unicode.vim#39
#448
nvim-tree/nvim-web-devicons#192

Signed-off-by: Fini Jastrow <[email protected]>
Finii added a commit that referenced this issue Mar 12, 2023
[why]
Just having the characters themselves as data for the name is convenient
in some cases; but sometimes the codepoint is also nice. And it
certainly improves the human interaction / check of the file.

[how]
Include the character and the codepoint in the glyph-name data. This is
a breaking change. But given that the json file is rather new I believe
we can get away with it.

Sorry for the inconvenience for all the early adaptors that already use
the old/previous format. But now we are more future proof and can add
even more data without breaking old json code.

Related:
#1140
kovidgoyal/kitty#2972
chrisbra/unicode.vim#39
#448
nvim-tree/nvim-web-devicons#192

Signed-off-by: Fini Jastrow <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
Somebody might want to have a file where all symbols we add are listed.
At the moment there are only the i_*.sh scripts and the CSS files. Both
are rather unwieldy.

[how]
Just create a json file with all symbol names, like the CSS file.

Fixes: ryanoasis#448

Signed-off-by: Fini Jastrow <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants