Closed saumyajyoti closed 3 years ago
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.
Even if I include NERD glyphs, the unicode will be different from the original "NERD" fonts, as NERD already overflows PUA's capacity (https://github.com/ryanoasis/nerd-fonts/issues/469, https://github.com/ryanoasis/nerd-fonts/issues/478). Mark as needs justification.
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)
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.
@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.
@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.
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.
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.
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?
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?
@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 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)
You need to download the glyph fonts...
@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.
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 :)
@wimstefan you can clone a subdirectory using svn actually, but yeah nerdfonts need to release a package for patching
[Suggestion] Improve icons-only "Symbols Nerd Font" · Issue #479 · ryanoasis/nerd-fonts
re; is Stuck on 12.1.0
nerd-fonts/src/unpatched-fonts/Iosevka at master · ryanoasis/nerd-fonts
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
@pagerc Iosevka already supported IEC Power Symbols and Symbols for Legacy Computing block.
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.
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
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.
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.
@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 😜
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
Want to request for adding NERD font extra characters and symbols to IOSEVKA release.