-
Notifications
You must be signed in to change notification settings - Fork 191
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
Use Nerd Font css class names instead of hardcoding #192
Comments
That sounds fantastic, more robust references are always desirable. Perhaps you could create a sample lua file with the table. We can plan this change from there. |
I made a quick script that always returns the latest glyph data as JSON at https://nerd-fonts-glyph.deno.dev/. Hope that helps :-) |
That's great. I'll see what I can do with it. Not sure how we'll handle 2/3 compatibility; any guidance? |
Only MDI's glyph will be moved. Other icons are fine. |
Thank you! |
I don't know if that helps as they seem to rename the icons from Last release (2.3) is old around 3 weeks and already features new codepoints, but is compatible. If you don't want to maintain two versions (maybe selectable via setup()) I'd think just tag last commit with <=2.2 support and start migration. |
oh my. |
What kind of css name database would you prefer? |
Following @mochaaP 's lead Nerd Fonts now has a json file with the glyph names and glyphs themselves. https://github.com/ryanoasis/nerd-fonts/blob/-/glyphnames.json The Also add a the creation date and version to the file, so that one can more easily see if it is up to date or not. |
Regarding the codepoint movement; I compiled a list of old-to-new codepoints to aid replacing... ryanoasis/nerd-fonts#1059 (comment) (open 'details') Regarding |
This is great, thank you @Finii Once everything is settled down we will add the new mechanisms. |
[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]>
[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]>
Unfortunately needed to breaking change the json file... Now also the codepoint number not only the character is available. Multiple people said that would ease the workflow, and in fact I concede. {
"METADATA": {
"website": "https://www.nerdfonts.com",
"development-website": "https://github.com/ryanoasis/nerd-fonts",
"version": "2.3.3",
"date": "2023-03-12 18:51:14+00:00"
},
"cod-account": {
"char": "",
"code": "eb99"
},
"cod-activate_breakpoints": {
"char": "",
"code": "ea97"
}, |
Hey no worries; best to get it correct now... |
Another option for this is to use nerdfix. |
[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: ryanoasis#1140 kovidgoyal/kitty#2972 chrisbra/unicode.vim#39 ryanoasis#448 nvim-tree/nvim-web-devicons#192 Signed-off-by: Fini Jastrow <[email protected]>
Some work in progress: #376 (comment) |
A test command like
|
Background
Nerd Fonts plans to introduce a breaking change in v3.0.0:
Hardcoding glyphs are very fragile to those changes. Moreover, if a user choose to use custom codepoint ranges (due to conflicts, etc.), it's a hassle to manually replace all icons in every plugin.
Solution
Fortunately, Nerd Fonts do have methods for getting glyphs via name, one via CSS class names, one being work in progress.
I suggest we could made the glyph table into a single .lua file and reference that and additionally, sync upstream with CI.
The text was updated successfully, but these errors were encountered: