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

Can we get a full "Nerd Font" version? #194

Closed
Jaykul opened this issue Nov 21, 2019 · 37 comments · Fixed by #720
Closed

Can we get a full "Nerd Font" version? #194

Jaykul opened this issue Nov 21, 2019 · 37 comments · Fixed by #720

Comments

@Jaykul
Copy link

Jaykul commented Nov 21, 2019

Description of the new feature/enhancement (with images if possible)

Basically, it should have the 3,000+ icons and glyphs that are added by the scripts over at nerd-fonts so that those of us generating or using tools like /devblackops/Terminal-Icons and /mnurzia/better-ls or /nick-bull/spaceship-prompt-nerdified can use Cascadia 😁

https://raw.githubusercontent.com/devblackops/Terminal-Icons/master/media/screenshot1.PNG

Proposed technical implementation details (optional)

Ideally, update the font with their patcher and distribute it here. Alternatively address ryanoasis/nerd-fonts/issues/373 and help everyone understand how they can make it happen without getting in trouble...

@mdtauk
Copy link

mdtauk commented Nov 21, 2019

Adding icons to the font can add its own questions and issues.

  • Does Cascadia use the icons as is, or does it develop its own iconographic language and style?
  • Can MDL2 glyphs substitute for the Nerd Fonts?
  • Are there copyright issues with some of the glyphs?

@Jaykul
Copy link
Author

Jaykul commented Nov 22, 2019

Well, NerdFonts maps specific glyph sets to specific code points. As with the "PowerLine" glyphs, if we using that name, it basically has to map the same glyphs the same way so it will work as a drop-in replacement ...

Hypothetically, I suppose you could customize them, but it's probably not necessary (certainly not expected). All the glyphs come from other github repos, you can check them and their licenses on that glyph set page.

@Jessidhia
Copy link

It seems this is planned, or at least the build script does support nerdfonts (it's the "NF" variant), but it doesn't support using nerdfonts' dataset as-is, it needs to be in the ufo format (?) while nerdfonts ships pre-compiled .ttf/.otf glyphs and a handful of .svg without any indication of how those sources are built or acquired.

There was a dataset committed to this repository (8d3a90a) which later got silently deleted (6ed2bab); but the refactored build script will still try to build the "NF" variant if the dataset is restored.

Unfortunately, building with Cascadia's script using that dataset (if restored with git checkout 6ed2bab^ -- sources/nerdfonts/NerdfontsNF.ufo) produces a buggy font that has the glyphs but they render at the wrong size; the font is also not detected as monospace. This latter problem is also present on nerd-fonts' own patcher (ryanoasis/nerd-fonts#374 (comment)) which should be fixed by ryanoasis/nerd-fonts#394 over there.

@aaronbell
Copy link
Collaborator

Yes, the script does support building Nerd Fonts. There's some things with the full set of characters that are still being sorted out, so only the Powerline version was released for now.

For your reference, UFO is a font source format. Rather than building from a miscellaneous collection of font files and vector formats, it made sense to coalesce the various symbols into a single source file, with everything placed where it should be. That also means less risk of font editors leaving their thumbprint on the font export (as is seen with Font Forge in the issues listed above). In the process of producing the UFO, I looked to normalize the characters within the font's advance width (so all characters fit within the 1200 funit limit). And in general, I tried to modify glyphs from the same origin in the same way. That way they'd look similar in weight and size.

In terms of the question regarding "not detected as monospace", there's a lot of discussion around this point. Under the Unicode standard, Combining marks are considered "nonspacing", which is to say, they are zero width. However, since these codepoints still contain outlines, some code frameworks may not detect the font as monospace. We have an issue posted related to this (#118). However, I have not observed contemporary applications appear to have this problem, nor has there been sufficient complaint of the font not working to justify breaking with the Unicode standard.

Hope that helps!

@Gorthog
Copy link

Gorthog commented Apr 13, 2020

Someone patched Cascadia font and added the missing glyphs / icons. It worked for me for exa icons:

image

https://github.com/adam7/delugia-code/releases/download/v1911.21.3/Delugia.Nerd.Font.Complete.ttf

@Jaykul
Copy link
Author

Jaykul commented Apr 13, 2020

Yeah, NerdFonts.com forked it too, and they finally patched their monospace issue, so the version they're shipping under the name "Caskaydia Cove" works pretty well..

@Gorthog
Copy link

Gorthog commented Apr 13, 2020

Actually I tried it first, but it didn't work for me. For this specific usage (using exa) not all icons were shown.

@MN-83
Copy link

MN-83 commented Apr 17, 2020

I downloaded it, looks good, the name is: CaskaydiaCove Nerd Font
https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/CascadiaCode/complete/Caskaydia%20Cove%20Regular%20Nerd%20Font%20Complete.ttf

@schuelermine
Copy link

Adding icons to the font can add its own questions and issues.

* Does Cascadia use the icons as is, or does it develop its own iconographic language and style?

It might be a good compromise to offer a version with the icons as is while developing Cascadia's own style

@phil-scott-78
Copy link

Looks like the latest version of oh-my-posh is using the full set of Nerd Font characters for all their themes. Their recommendation is just to not use Cascadia due to the missing characters.

I'm honestly not sure what the official repo can do about this, but I wanted to document for others that run into this in the future.

Right now the work arounds aren't great

  • Official NF version which is already behind the release cycle, and with the NF releases only happening every few years now it seems this will only get worse
  • The delguia version which doesn't support the different weights, which isn't great because the light version is the obviously superior weight
  • Patch it yourself. Not terrible if you know your way around linux, but...

@felipecrs
Copy link

Is there anything blocking this to happen?

@trallnag
Copy link

trallnag commented Oct 1, 2021

Just as a heads-up: The currently available patched Nerd Font of Cascadia doesn't just add glyphs but also somehow alters the font itself. For example some letters look thicker. I (as a total noob) patched a newer version of Cascadia, but it resulted in basically all characters becoming taller

ryanoasis/nerd-fonts#673 (comment)

ryanoasis/nerd-fonts#519 (comment)

@aaronbell
Copy link
Collaborator

@trallnag this is due to the patcher inherently needing to alter the hinting of the font. I have not spent the time (nor do I have the expertise in ttfautohint) to figure out the settings to change this.

@trallnag
Copy link

trallnag commented Oct 1, 2021

@aaronbell, interesting, thanks for the answer. for me fonts are more or less a total black box. So it doesn't matter what file type I patch? static vs variable, OTF vs TTF?

@aaronbell
Copy link
Collaborator

@trallnag, the static instances should work better since I believe they’re currently autohinted so it should be the same with or without the patch.

The variable font will definitely not work. But the patcher wouldn’t have worked anyway on a variable font.

@aaronbell
Copy link
Collaborator

But I should add that, per #371, the statics already don’t align well with the variable font. :(

@trallnag
Copy link

trallnag commented Oct 1, 2021

Ok I understand it better now, thanks again

@Finii
Copy link

Finii commented Oct 9, 2021

@phil-scott-78

  • The delguia version which doesn't support the different weights, which isn't great because the light version is the obviously superior weight

Well, it does, since June 2021 (adam7/delugia-code@c1339ee)

@phil-scott-78
Copy link

@phil-scott-78

  • The delguia version which doesn't support the different weights, which isn't great because the light version is the obviously superior weight

Well, it does, since June 2021 (adam7/delugia-code@c1339ee)

Oh happy days! I missed that. Thanks for the heads up!

@Finii
Copy link

Finii commented Oct 9, 2021

I just wanted to note, that some codepoints used by Nerd Fonts are misused, and it is impossible to keep the 'usual nerd font codepoints' and some Arabic / Hebrew glyphs.

(for ref: adam7/delugia-code#64 (comment))

Also noticed that these Arabic / Hebrew glyphs are only existing in Cascadia Code non-italic (at least when looked at the static font files).

Maybe better description of the problem here: adam7/delugia-code#64 (comment)

Edit: Add last paragraph

@Finii
Copy link

Finii commented Oct 9, 2021

@aaronbell

The variable font will definitely not work. But the patcher wouldn’t have worked anyway on a variable font.

Well, the patcher (or rather fontforge) does work with the variable font (sort of), and Delugia used the variable fonts until people ... demanded the light weight.

@aaronbell
Copy link
Collaborator

@Finii I recalled people saying that the patcher crashes when trying to parse the variable fonts. Sounds like that has been resolved, but like you said, people also want the non Regular weights :).

And no, Arabic and Hebrew are not included in the italic as those languages do not usually employ italics.

@MattBDev
Copy link

MattBDev commented Sep 8, 2022

I wish there was an update to if this is actually something that will happen in the future or if users should just rely on the CaskaydiaCove font as an alternative.

This was referenced Apr 7, 2024
DHowett pushed a commit that referenced this issue Apr 8, 2024
Font has been reviewed by the devs and the NerdFonts folks

Closes #194
Closes #210
@tristan957
Copy link

Now that Nerd Fonts support has been added, could we get a new release? Looks like neither a tag nor release has been done since 2021 in this repository.

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

That would be the logical next step for us maintainers, eh?

@tristan957
Copy link

Thanks Dustin! Then I can try and help package it in Fedora 😄

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

(FWIW: The release build failed last night, so I'm digging in today to see why 😄)

There's a couple other good pull requests backed up in here, so it'll be good to finally land those too!

@aaronbell
Copy link
Collaborator

@DHowett I’m afraid that something has changed in the dependent libraries since the last build and I may need to rewrite the build system to fix it… 😂

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

@aaronbell eh, I wouldn’t go that far yet. It fails even with the same version of Python (3.9) and all of the dependencies pinned to the versions from the last build. 🙂

I’ll let you know if more work is required!

@aaronbell
Copy link
Collaborator

Hmm. Interesting. Well let m know what you uncover!

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

@aaronbell I think you were the killer!

  File "/home/duhowett/cascadia-code/lib/python3.11/site-packages/fontTools/feaLib/parser.py", line 134, in parse
    raise FeatureLibError(
fontTools.feaLib.error.FeatureLibError: The following glyph names are referenced but are missing from the glyph set:
 uniE0A0 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:580:5)
 uniE0A0.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:580:16)
 uniE0B0 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:581:5)
 uniE0B0.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:581:16)
 uniE0B1 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:582:5)
 uniE0B1.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:582:16)
 uniE0B2 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:583:5)
 uniE0B2.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:583:16)
 uniE0B3 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:584:5)
 uniE0B3.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:584:16)
 uniE0B4 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:585:5)
 uniE0B4.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:585:16)
 uniE0B5 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:586:5)
 uniE0B5.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:586:16)
 uniE0B6 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:587:5)
 uniE0B6.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:587:16)
 uniE0B7 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:588:5)
 uniE0B7.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:588:16)
 uniE0B8 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:589:5)
 uniE0B8.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:589:16)
 uniE0B9 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:590:5)
 uniE0B9.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:590:16)
 uniE0BA (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:591:5)
 uniE0BA.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:591:16)
 uniE0BB (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:592:5)
 uniE0BB.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:592:16)
 uniE0BC (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:593:5)
 uniE0BC.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:593:16)
 uniE0BD (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:594:5)
 uniE0BD.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:594:16)
 uniE0BE (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:595:5)
 uniE0BE.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:595:16)
 uniE0BF (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:596:5)
 uniE0BF.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:596:16)
 uniE0C0 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:597:5)
 uniE0C0.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:597:16)
 uniE0C1 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:598:5)
 uniE0C1.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:598:16)
 uniE0C2 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:599:5)
 uniE0C2.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:599:16)
 uniE0C3 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:600:5)
 uniE0C3.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:600:16)
 uniE0C4 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:601:5)
 uniE0C4.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:601:16)
 uniE0C5 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:602:5)
 uniE0C5.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:602:16)
 uniE0C6 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:603:5)
 uniE0C6.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:603:16)
 uniE0C7 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:604:5)
 uniE0C7.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:604:16)
 uniE0C8 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:605:5)
 uniE0C8.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:605:16)
 uniE0CA (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:606:5)
 uniE0CA.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:606:16)
 uniE0CC (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:607:5)
 uniE0CC.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:607:16)
 uniE0CD (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:608:5)
 uniE0CD.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:608:16)
 uniE0CE (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:609:5)
 uniE0CE.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:609:16)
 uniE0CF (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:610:5)
 uniE0CF.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:610:16)
 uniE0D1 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:611:5)
 uniE0D1.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:611:16)
 uniE0D2 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:612:5)
 uniE0D2.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:612:16)
 uniE0D4 (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:613:5)
 uniE0D4.stypo (first found at /home/duhowett/cascadia-code/sources/CascadiaCode-Regular.ufo/features.fea:613:16)
"""

@aaronbell
Copy link
Collaborator

Huh. That's weird. I didn't think I made any changes to that. I'll have to look into it.

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

I suspect it might be this:

@@ -50,9 +51,16 @@ def step_set_font_name(name: str, source: ufoLib2.Font) -> None:


 def step_merge_glyphs_from_ufo(path: Path, instance: ufoLib2.Font) -> None:
+    unicodes = []
+    for glyph in instance:
+        unicodes.append(glyph.unicode)
     ufo = ufoLib2.Font.open(path)
     for glyph in ufo:
-        if glyph.name not in instance:
+        if glyph.unicode:
+            if glyph.unicode not in unicodes:
+                newName = str(hex(glyph.unicode)).upper().replace("0X","uni")
+                instance.layers.defaultLayer.insertGlyph(ufo[glyph.name],newName, overwrite=False, copy=False)
+        else:
             instance.addGlyph(ufo[glyph.name])

I imagine that we have some powerline glyphs that we convert to uniXXXX even if they're already present in the instance.

@DHowett

This comment was marked as off-topic.

@aaronbell
Copy link
Collaborator

Can you give me a requirements file with the pinned dependencies so I can do some test builds on my end?

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

Oh, the one checked into the repo should be A-OK as long as you don't regenerate it with pip-compile.

@DHowett
Copy link
Member

DHowett commented Apr 9, 2024

Alright, I actually think the thing I'm seeing comes from concurrent (?) modification of the designspace document. Serializing the build process (which slows it down immensely, yes) makes that a bit more obvious, and switching to deep copies of the designspace for every processing operation solves it. I'll prepare a PR after a bit more validation...

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

Successfully merging a pull request may close this issue.