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

Nerd Font data and extractor #64

Merged
merged 3 commits into from
Dec 28, 2020
Merged

Nerd Font data and extractor #64

merged 3 commits into from
Dec 28, 2020

Conversation

reeseovine
Copy link
Contributor

I've written an extractor for Nerd Fonts so users can easily insert icons from various icon sets into their projects. Closes #54 (sort of).

How it works

  1. Download the cheat sheet page: https://www.nerdfonts.com/cheat-sheet
  2. Parse the data with beautifulsoup
  3. Generate list of icon/classname pairs
  4. Write to file

Concerns

  • Contrary to my previous claim, Font Awesome codepoints do appear to be the same in Nerd Fonts and their source font. However some of the other icon sets are moved to avoid conflicts within the font, meaning if someone wants to use the source icon font rather than a Nerd Font this data set may not work for them.
    • Nerd Fonts also don't include any of FA's pro icons, for obvious reasons. But also, NF has ~736 FA icons whereas FA 5 free has 1,609. Might be using an older version.
  • Icon fonts aren't Unicode standard (they reside in private use blocks) and may be confusing to people who see them when they specify --files all. I think one way to work around this is to have a non-standard/ directory inside data/ which is not indexed by --files all but it is when specifying a filename directly. This proposed solution can decrease clutter for when others decide to contribute data sets like this one.

@polyzen
Copy link
Contributor

polyzen commented Dec 27, 2020

But also, NF has ~736 FA icons whereas FA 5 free has 1,609. Might be using an older version.

ryanoasis/nerd-fonts#221

Copy link
Owner

@fdw fdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, thanks.

extractors/nerdextractor.py Outdated Show resolved Hide resolved
extractors/nerdextractor.py Outdated Show resolved Hide resolved
@fdw
Copy link
Owner

fdw commented Dec 28, 2020

Looks good, thank you!

@fdw fdw merged commit 19e070a into fdw:main Dec 28, 2020
@polyzen
Copy link
Contributor

polyzen commented Dec 28, 2020

For some reason a large number of the nf-mdi icons appear on the right-hand side of rofi.

@fdw
Copy link
Owner

fdw commented Dec 28, 2020

I think that is because the code point used for these symbols is reserved/used in a RTL language. I don't think there's a better solution than #62. Or do you have an idea?

@polyzen
Copy link
Contributor

polyzen commented Dec 28, 2020

Oh, I see. Perhaps the extractor should automatically apply the left-to-right mark to the affected characters in nerd_fonts.csv.

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.

Font Awesome Icons?
3 participants