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

Feature Request: Integrate NERD Font extra symbols #529

Closed
saumyajyoti opened this issue May 14, 2020 · 26 comments
Closed

Feature Request: Integrate NERD Font extra symbols #529

saumyajyoti opened this issue May 14, 2020 · 26 comments

Comments

@saumyajyoti
Copy link

  • Your font version: (Release 3.0.0 rc8)
  • Your font variant: All
  • Your operating system (Win10 2004):
  • Your application using Iosevka: (Windows Terminal, gVim)

Want to request for adding NERD font extra characters and symbols to IOSEVKA release.

@AndydeCleyre
Copy link

I don't know about Windows these days, but for anyone on Linux wondering: This can be achieved without any modifications to the fonts themselves, via fontconfig, with a simple personal configuration file, by including a block such as:

<match target="pattern">
    <test qual="any" name="family"><string>monospace</string></test>
    <edit name="family" mode="assign" binding="same"><string>Iosevka Term Custom</string></edit>
    <edit name="family" mode="append" binding="weak"><string>Symbols Nerd Font</string></edit>
    <edit name="family" mode="append" binding="weak"><string>JoyPixels</string></edit>
</match>

This will, for each glyph, try to use the one from each font, in turn.

The only disadvantage I've noticed so far is that I can't force the other font glyphs to be the same width as those of Iosevka Term; apps like Konsole will truncate/overlap the extra wide ones. I don't think that would change with the usual patching method anyway, but maybe if @be5invis packaged a patched Term variant, they would put the squeeze on those symbols.

There are fixed width variants of the symbols font, but I think Iosevka by default is half that width. I need to look into the procedure for rebuilding those, maybe building them to match isn't so hard.

@be5invis
Copy link
Owner

be5invis commented May 25, 2020

Even if I include NERD glyphs, the unicode will be different from the original "NERD" fonts, as NERD already overflows PUA's capacity (ryanoasis/nerd-fonts#469, ryanoasis/nerd-fonts#478).
Mark as needs justification.

@saumyajyoti
Copy link
Author

saumyajyoti commented May 28, 2020

Thanks for the info.
As NERD font has different glyphset option, instead of doing a complete set can we exclude few of them?
If I see current nerdfont glyphs. The last one in PUA is 'nf-mdi-pi_box'.
So, I guess material icon set is coming at the end. Need to see if we can merge rest of the font categories or any other combination possible or not.

options:

-c, --complete Add all available Glyphs
--fontawesome Add Font Awesome Glyphs (http://fontawesome.io/)
--fontawesomeextension
Add Font Awesome Extension Glyphs (https://andrelzgava.github.io/font-awesome-extension/)
--fontlinux, --fontlogos
Add Font Linux and other open source Glyphs (https://github.com/Lukas-W/font-logos)
--octicons Add Octicons Glyphs (https://octicons.github.com)
--powersymbols Add IEC Power Symbols (https://unicodepowersymbol.com/)
--pomicons Add Pomicon Glyphs (https://github.com/gabrielelana/pomicons)
--powerline Add Powerline Glyphs
--powerlineextra Add Powerline Glyphs (https://github.com/ryanoasis/powerline-extra-symbols)
--material, --materialdesignicons, --mdi
Add Material Design Icons (https://github.com/templarian/MaterialDesign)
--weather, --weathericons
Add Weather Icons (https://github.com/erikflowers/weather-icons)

@VladimirMarkelov
Copy link

There is a separate project that adds NERD icons to a lot of fonts(nerdfonts.com). What if they add a few more NERD icons? Or fix bug in a single character? In this case, all font creators must keep an eye on the project and rebuild their fonts? To me, it looks like a waste of font-creators time. I think, it is better when it is done in one place instead of in every font repo.

@be5invis
Copy link
Owner

be5invis commented May 29, 2020

@VladimirMarkelov
Is the font patcher (official) NERD using still based on FontForge? AFAIK FontForge does not support Reverse Chaining Contextual Single Substitution (which is used to build up many ligations in Iosevka) so using their patcher will make Iosevka broken.

@VladimirMarkelov
Copy link

@be5invis
Sorry, but I do not know. I just think that it would be good to have all NERD'ed fonts in one place: e.g., if now one googles "iosevka nerd font", I guess google shows NERD page instead of Iosevka repo. All I remember that when I tried a font from official NERD page, my editor was not happy: some characters had invalid width(wider than others) and the text in the editor looked ugly.

@saumyajyoti
Copy link
Author

Yes, that was main reason for my request here. That Nerd fpont does not pick up font releases very frequently and the patched fonts are buggy too. Not all consoles accept, those, having characters in here might have better support. The glyphs in nerd font has not been updated in last 2/3 years, so we need not keep too much monitoring here if we add them once or to some possible extent. But the reverse is not true , as all mu favorite fonts are having much frequent releases than how NERD font.com picks them up yearly once even less frequent. I tried patching IOSEVKA with their patcher script but that is not bug free either, so finally settled with the IOSEVKA latest release for GUI editors and FiraCode NF for consoles.

@xsrvmy
Copy link

xsrvmy commented May 29, 2020

I use the nerd font patcher on the fixed version of Iosevka for terminals, because legations just tend to make a mess in a terminal. The result is very nice. I did have to change the script because the patcher does not change the WWS family name and I had to remove them.

There is one complaint though. The way the nerd font patcher decides the font name is outputing the font name "Iosevka Nerd Font" instead of "Iosevka Fixed Nerd Font", because the field used to determine the name reads "Iosevka-Fixed" instead of "Iosevka Fixed-Regular" as the patcher expects.

@saumyajyoti
Copy link
Author

I use the nerd font patcher on the fixed version of Iosevka for terminals, because legations just tend to make a mess in a terminal. The result is very nice. I did have to change the script because the patcher does not change the WWS family name and I had to remove them.

There is one complaint though. The way the nerd font patcher decides the font name is outputing the font name "Iosevka Nerd Font" instead of "Iosevka Fixed Nerd Font", because the field used to determine the name reads "Iosevka-Fixed" instead of "Iosevka Fixed-Regular" as the patcher expects.

Good to know. Do you have link for your repo' or script?

@wimstefan
Copy link

I use the nerd font patcher on the fixed version of Iosevka for terminals, because legations just tend to make a mess in a terminal. The result is very nice. I did have to change the script because the patcher does not change the WWS family name and I had to remove them.

There is one complaint though. The way the nerd font patcher decides the font name is outputing the font name "Iosevka Nerd Font" instead of "Iosevka Fixed Nerd Font", because the field used to determine the name reads "Iosevka-Fixed" instead of "Iosevka Fixed-Regular" as the patcher expects.

So you first convert the build ttf files to otf to be able to use the font-patcher script? Or do you have a more elegant way?

@xsrvmy
Copy link

xsrvmy commented May 31, 2020

@wimstefan you can patch the ttf directly.
@saumyajyoti actually, I use another script first to remove the WWS family names, then run it through the patcher.

import fontforge
import sys

font = fontforge.open(sys.argv[1])

new_sfnt = [(a, b, c) for (a, b, c) in font.sfnt_names if "WWS" not in b]
font.sfnt_names = tuple(new_sfnt)

font.generate("out.ttf")

@wimstefan
Copy link

wimstefan commented May 31, 2020

@wimstefan you can patch the ttf directly.

Hmm that's strange ... I always get this error when I try to run the
font-patcher script with font-patcher -c ./iosevka-artesanal-tailed-regular.ttf:

The requested file, original-source.otf, does not exist
Traceback (most recent call last):
  File "/home/swimmer/bin/font-patcher", line 924, in <module>
    main()
  File "/home/swimmer/bin/font-patcher", line 919, in main
    patcher.patch()
  File "/home/swimmer/bin/font-patcher", line 88, in patch
    symfont = fontforge.open(__dir__ + "/src/glyphs/" + patch['Filename'])
OSError: Open failed

Version: Nerd Fonts: font-patcher (2.1.0)

@xsrvmy
Copy link

xsrvmy commented May 31, 2020

You need to download the glyph fonts...

@saumyajyoti
Copy link
Author

@wimstefan you can patch the ttf directly.
@saumyajyoti actually, I use another script first to remove the WWS family names, then run it through the patcher.

import fontforge
import sys

font = fontforge.open(sys.argv[1])

new_sfnt = [(a, b, c) for (a, b, c) in font.sfnt_names if "WWS" not in b]
font.sfnt_names = tuple(new_sfnt)

font.generate("out.ttf")

Thanks for the details.

@wimstefan
Copy link

You need to download the glyph fonts...

Thanks - it works now. I was reluctant to clone the whole repository which is above 5Gb with all the patched fonts and the .git directory itself!!! I'll see whether it's worth keeping it or not but at least I know it works that way :)

@xsrvmy
Copy link

xsrvmy commented Jun 1, 2020

@wimstefan you can clone a subdirectory using svn actually, but yeah nerdfonts need to release a package for patching

@ChiefMikeK
Copy link

@ChiefMikeK
Copy link

Request a PR @ ¿fork?

re; is Stuck on 12.1.0
nerd-fonts/src/unpatched-fonts/Iosevka at master · ryanoasis/nerd-fonts

@pagerc
Copy link

pagerc commented Jun 10, 2020

Folks asking for NERD fonts need to reconsider what they're asking for. Terminal lovers love glyphs, but we've got a standard for them in Unicode+Emoji. Proposing that every font patch/embed NERD glyphs is asking for long-term problems. Also, there's a set of fonts (IEC Power Symbols) in NERD that successfully became part of Unicode by a community project effort:
https://unicodepowersymbol.com/

The driving feature that's almost a defacto standard are the powerline symbols, and everyone's effort would be better spent getting a proposal out for powerline symbols to extend the Unicode Symbols for Legacy Computing which was just released as Unicode 13. There's 40 code points available, and since powerline uses 38 symbols, seems like a perfect fit to finish out that code page table.
https://en.wikipedia.org/wiki/Symbols_for_Legacy_Computing

@be5invis
Copy link
Owner

@pagerc Iosevka already supported IEC Power Symbols and Symbols for Legacy Computing block.

@chrish42
Copy link

Yes. I'd be lovely to get the Powerline symbols into a release of Unicode, and that would be a better solution than "nerd-patching" every font. I have absolutely no clue how to mount a community effort to make that happen, though.

@pagerc
Copy link

pagerc commented Jun 11, 2020

This is meant as an honest approach to proceed with a "Powerline symbol" proposal:
Step 1: Find like minded folks.
Step 2: Write a proposal
Step 3: Create a website
Step 4: Request comments on proposal
Step 5: Submit proposal for unicode review/inclusion

@pagerc
Copy link

pagerc commented Jul 25, 2020

Yes. I'd be lovely to get the Powerline symbols into a release of Unicode, and that would be a better solution than "nerd-patching" every font. I have absolutely no clue how to mount a community effort to make that happen, though.

It appears an enterprising individual made this proposal (only for the basic powerline glyphs and not extended glyphs):
http://www.unicode.org/cgi-bin/GetMatchingDocs.pl?L2/19-068R
https://www.unicode.org/L2/L2019/19068r2-powerline-syms.pdf

I've opened a new ticket that addresses the powerline symbols that Unicode is looking to standardize #649.

@stale
Copy link

stale bot commented Oct 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 4, 2020
@be5invis be5invis closed this as completed Dec 9, 2020
@trallnag
Copy link

trallnag commented Oct 2, 2021

@pagerc, maybe we could learn from emoji people that managed to add several thousand of them into Unicode in all variants one can think of 😜

@trallnag
Copy link

trallnag commented Oct 2, 2021

Also one big issue with adding "code stuff" to Unicode is that many glyphs are symbols of programming languages, tools, and so on. Let's say Kubernetes dies out. You are now stuck with a Unicode symbol that has no use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants