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

nerdfont: add new backend #193

Closed
wants to merge 1 commit into from
Closed

Conversation

seanfarley
Copy link

This is the bare minimum to get NerdFont usable in all-the-icons. I'm
unsure if this is the right approach since NerdFont includes
Font Awesome, devicons, weather icons, octicons, material design, etc.


This is the bare minimum to get NerdFont usable in all-the-icons. I'm
unsure if this is the right approach since NerdFont includes
Font Awesome, devicons, weather icons, octicons, material design, etc.
@seanfarley
Copy link
Author

I seem to remember @seagle0128 wanting NerdFonts?

@wyuenho
Copy link
Collaborator

wyuenho commented Mar 24, 2020

This is likely not the way to do it. Firstly there's no such font called Nerdfonts, nerd fonts are patched fonts to existing open source programming fonts. Secondly, if you are going to use an all-in-one font, you should probably replace all the data files for all the fonts in this package.

@wyuenho
Copy link
Collaborator

wyuenho commented Mar 24, 2020

Is there anyway you can incorporate nerd-fonts.el as a dependency?

@seanfarley
Copy link
Author

This is likely not the way to do it. Firstly there's no such font called Nerdfonts, nerd fonts are patched fonts to existing open source programming fonts. Secondly, if you are going to use an all-in-one font, you should probably replace all the data files for all the fonts in this package.

Yeah, that's what I was thinking. I'm not sure what that would look like though.

@seanfarley
Copy link
Author

Is there anyway you can incorporate nerd-fonts.el as a dependency?

Oh, nice; I didn't even know that existed! What would be the relationship between this package and nerd-fonts.el?

@wyuenho
Copy link
Collaborator

wyuenho commented Mar 24, 2020

What would be the relationship between this package and nerd-fonts.el

This package will be just the front end to font data to maintain compatibility with the rest of the ecosystem.

@seanfarley
Copy link
Author

Ok! Would we keep a different entry point for nerdfonts as I've written? For example, I have (define-icon nf all-the-icons-data/nf-icon-alist "NerdFont Icons") but I don't think that's the best approach.

Would we keep all the current interfaces as-is, but make a new function for the set of icons NerdFont provides minus the set of pre-existing ones (font awesome, weather, material, etc.)?

@seanfarley
Copy link
Author

I guess, in general, I'm confused as to why there isn't a general all-the-icons function for "give me the set of icons that match 'search string'" where the order would be a pre-defined order of our choosing (but make it a plist so that users could filter as they want).

That's basically why I use Nerd Fonts: just give me a font with every icon enabled. Where-as this package wraps the magic of figuring out the correct font to apply to the face... which isn't needed with Nerd Fonts, correct?

Please correct me if my logic is wrong!

@wyuenho
Copy link
Collaborator

wyuenho commented Mar 24, 2020

Would we keep a different entry point for nerdfonts as I've written?

No, you will just use the default font as that will be the requirement of the emacs user to set their default font to the patched font.

I guess, in general, I'm confused as to why there isn't a general all-the-icons function for "give me the set of icons that match 'search string'" where the order would be a pre-defined order of our choosing (but make it a plist so that users could filter as they want).

This package provides 4 different ways to look up icons - by dir, file, mode and url. Each way is unique for their intended usage. Everyone of these all-the-icons-icon-for-[dir|file|mode|url] have some minimal logic to look up the actual icon glyphs from a bunch of all-the-icons-*-icon-alist variables. Each of these all-the-icons-*-icon-alist effectively maps a package-specific global search string to a specific glyph in a supported family. The font families are the "backends" that provide the specific glyphs.

With nerd fonts, you have an excellent opportunity to remove all these other font family backends. You just need to maintain the search strings, but redo the mapping. You have a good opportunity to massively simplify the code base here.

@seanfarley
Copy link
Author

With nerd fonts, you have an excellent opportunity to remove all these other font family backends. You just need to maintain the search strings, but redo the mapping. You have a good opportunity to massively simplify the code base here.

Aha, that's indeed what I was wondering about. Ok, that's a bit more work but I'll try to tackle it later this weekend :-)

@seagle0128
Copy link
Contributor

Yep, I tried integrating nerd fonts, but it seems some icons are missing.
The similar project is nerd-icons.el. Again, many icons are missing there.

BTW, I developed icons-in-terminal.el which is able to be used in both GUI and terminal. It doesn't leverage nerdfonts, and unfortunately the upstream icons-in-terminal is not active now.

@seanfarley
Copy link
Author

Oh no, that's bad :-( Which icons were missing, @seagle0128? Is there a way to programmatically find missing icons?

@seagle0128
Copy link
Contributor

@seanfarley For example, no emacs/elisp icons 😢

I worked with @twlz0ne and identified some but many are still missing. Please refer to
https://github.com/twlz0ne/nerd-fonts.el/blob/master/nerd-fonts-data.el
ryanoasis/nerd-fonts#342

@seanfarley
Copy link
Author

Fair enough, @seagle0128. I'll close this and follow those threads you mentioned; thanks!

@seanfarley seanfarley closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants