zed-industries / zed-fonts

The Zed Mono and Sans typefaces, custom built from Iosevka
624 stars 23 forks source link

Feature Request: Add Nerd Font Support #10

Closed humanbeeng closed 7 months ago

humanbeeng commented 10 months ago

Loving this font. Unfortunately I can't use this font in Neovim due to lack of Nerd Font. Please consider releasing a nerd font version. Thanks

nferhat commented 9 months ago

You can either:

iamnbutler commented 9 months ago

Feel free to add a PR with the patched version & instructions :)

cabrinha commented 9 months ago

Feel free to add a PR with the patched version & instructions :)

I'll give it a try: https://github.com/ryanoasis/nerd-fonts/pull/1504

Through the above PR, I've got all the NerdFont ZedMono fonts built. If we should include them in this repo, let me know where to place them and I'll open a PR. @iamnbutler

cabrinha commented 9 months ago

@humanbeeng @iamnbutler let me know if I should open a PR in this repo for these fonts.

iamnbutler commented 9 months ago

Sure - go for it 😊

cabrinha commented 8 months ago

Sure - go for it 😊

Hey, I see that *.ttf files are ignored: https://github.com/zed-industries/zed-fonts/blob/main/.gitignore#L32

Should I remove this line in order to add the ttf fonts I've got built?

danielzsh commented 8 months ago

Any updates on this? No nerd fonts are making my terminal prompt unusable 😅

cabrinha commented 7 months ago

Any updates on this? No nerd fonts are making my terminal prompt unusable 😅

Just updated my PR here: https://github.com/ryanoasis/nerd-fonts/pull/1504

Hoping they can merge it soon.

karimbenbourenane commented 7 months ago

Edit: the following post is now obsolete. there is an official brew cask font for zed mono nerd font and you should use that instead. I'm deleting my tap and formula from GitHub since the official font is now available

I created a tap and formula for this. You can install Zed Mono patched with Nerd Font using homebrew on macOS with the following:

brew tap karimbenbourenane/cask-fonts brew install font-zed-mono-nerd-font

These fonts have been patched with the --complete flag used by the docker method of font patching. And it includes all the font styles, so the font package is quite large when being installed by brew.

I hope this helps for those that use macOS and want to incorporate the Zed Mono font with the terminal.

Remember that Zed settings will need to be modified to include the following in the root configuration object to enable nerd fonts on the terminal: "terminal": { "font_family": "ZedMono Nerd Font" }

danielzsh commented 7 months ago

Just a quick note, this nerd font appears to be missing the up arrow indicator used to denote push:

image
Finii commented 7 months ago

Hoping they can merge it soon.

Ready to merge flag set. Nerd Font release will be the next days.

@karimbenbourenane

brew install font-zed-mono-nerd-font

Well, that will clash with the official Nerd Font cask :unamused: How shall we fix that?

Finii commented 7 months ago

Hmm, I can not find the cask (luckily)

image

Ah now I see it, it is @karimbenbourenane own tap.

brew tap karimbenbourenane/cask-fonts

Sorry I was too dumb. All good!

karimbenbourenane commented 7 months ago

Just a quick note, this nerd font appears to be missing the up arrow indicator used to denote push: image

I'm not sure what that glyph is supposed to look like, can you give an example? Also when the official nerd font release comes out I can remove mine from my tap, I did this just as a temporary solution until then (I didn't realize it's coming out in just a few days).

Finii commented 7 months ago

I didn't realize it's coming out in just a few days

Even for me its always a surprise if it comes out 'on time' :smile: Given that I 'determine' the next release date half a year in advance and it is just a hobby.

The 'up' arrow is probably

image

which is codepoint 2191 and not a Nerd Font patched glyph.

See some other examples in the images in this comment

Hmm, but it's there :thinking:

image

:woman_shrugging:

But there is another problem with patching

Done with Patch Sets, generating font...
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph HEAVY making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph POWER making the whole subtable invalid
Lookup subtable contains unused glyph HEAVY making the whole subtable invalid
   ZedMono Nerd Font
   \===> 'ZedMonoNerdFont-Regular.ttf'

See

Edit: Add link to Issue

karimbenbourenane commented 7 months ago

Hmm.. so is there anything I can actually do to get that glyph into my Zed Mono patched fonts? I used the --complete flag running the Nerd Font patcher in its docker container, so I'm unsure how I'd solve this problem of that glyph being absent. In @danielzsh 's screen capture, I see glyph 21e1 being used (the dotted up arrow), what does that normally denote if it's not the push glyph?

Finii commented 7 months ago

I guess Daniel needs to copy and paste (*) the glyph so that we can look up its codepoint. There is most likely nothing wrong with your patch (and if there is a problem its most likely someting Nerd Fonts needs to fix). I expect the missing glyph to be no Nerd Font patched in codepoint; several "Powerlines" and stuff depend on icons that are not part of the patchset. And/or Daniel uses a pre Nerd Fonts v3 codepoint that has been dropped.

(*) Copy and paste the glyph as text in a comment here

Finii commented 7 months ago

Baah... fontforge bites us again :-(

image

Not that I had not fixed several of these problems in ff already. This might take a while, I will report the progress only in the NF Issue (see above) to not spam zed users.

danielzsh commented 7 months ago

I'm not sure what that glyph is supposed to look like, can you give an example? Also when the official nerd font release comes out I can remove mine from my tap, I did this just as a temporary solution until then (I didn't realize it's coming out in just a few days).

Here's how it looks in JetBrains Mono (as you can see, it's now positioned much better within the brackets):

image

And the actual glyph itself is ⇡

Finii commented 7 months ago

That is 21E1

image

Which is in the font

image

Hmm, and there is a lookup table...

image

But that glyph is also ok:

image

Maybe that is because fontforge breaks the subtables. Will investigate later.

Finii commented 7 months ago

This looks fishy...

21E1 is uni21E1 will be replaced by uni21E1.NWID which will be replaced by uni21E1

image


This is the same in the unpatched Iosevka. Is that working?

danielzsh commented 7 months ago

The glyph renders oddly in unpatched Iosevka as well, it might just be an issue with Iosevka then?

Finii commented 7 months ago

Can you try this patch?

IosevkaNerdFont-Regular.ttf.zip

danielzsh commented 7 months ago

It's still rendering like this for me:

image

(btw, I noticed that character width is no longer as large as Zed Mono, is this intended?)

Finii commented 7 months ago

Thanks for testing! The character width is just what ordinary Iosevka has. The only thing I changed is removing the double-width arrows.

Hmm, the arrow seems to be the uni21E2.WWID :thinking: (which is 2 cells wide)

image

Ah, I removed the NWID (narrow character) to WWID (wide character) rule, but the WWID are already the standard variant.

We already had that at Nerd Fonts as Issue (without solution), let me think a bit.

Finii commented 7 months ago

Ok, this is all working as intended by Iosevka and/or the person who created the build plan for Zed-Mono.

The dashed-up-arrow is supposed two be two cells wide.

If you do not want that, change the Zed build plan like this:

--- a/private-build-plans.toml
+++ b/private-build-plans.toml
@@ -7,9 +7,10 @@

 [buildPlans.zed-mono]
 family = "Zed Mono"
-spacing = "normal"
+spacing = "term"
 serifs = "sans"
 no-cv-ss = false

   [buildPlans.zed-mono.variants]
   inherits = "ss08"

When Zed updates to a newer upstream (i.e. Iosevka) the better build instruction could be enableNwidWwid = false but that is not available yet in Zed's Iosevka.

I believe this change should be applied to the Zed repo here, but then, I do not know what the authors intend. Maybe you want to raise an Issue. But then, that directly opposes this information about Zed Version 1.1.0 (from the CHANGELOG):

Version 1.1.0

Updated build plans – Mono and Sans now build with the same characters, weights and widths

The Sans should probably keep the 2 cell wide up-arrow, but for term it is problematic, but someone decided to have all width the same :woman_shrugging:

This is not my expertise, the information in this comment might or might not be correct.

Finii commented 7 months ago

Ah here, the documentation snipped, forgot that:

image

https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md#configuring-custom-build

Finii commented 7 months ago

https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.2.0

Finii commented 7 months ago

@karimbenbourenane https://github.com/Homebrew/homebrew-cask-fonts/blob/master/Casks/font-zed-mono-nerd-font.rb

karimbenbourenane commented 7 months ago

@Finii Thanks for getting this into homebrew, I'm now going to go delete my repo and tap. And I'm going to install the official formula after deleting my own. Thanks again and good work!

cabrinha commented 7 months ago

@humanbeeng I think this issue can be closed as completed, with NerdFonts officially supporting ZedMono.

Finii commented 7 months ago

Just wanted to add that Nerd Fonts does not include all weights, I think thin and extra-light has been omitted for being not useful for terminal use (maybe).

Edit: Correction:

Included is Regular italic oblique light* medium* bold* extrabold*

~~

#!/usr/bin/env bash

FONT_VERSION=1.2.0
TMP_DIR=$(mktemp -d)

set -e

curl -LOf "https://github.com/zed-industries/zed-fonts/releases/download/${FONT_VERSION}/zed-mono-${FONT_VERSION}.zip" --output-dir "${TMP_DIR}"
unzip -d "${TMP_DIR}" "${TMP_DIR}/*.zip"

ls -alh "${TMP_DIR}"

typefaces=( "" "Extended" )

# weights=( regular italic oblique \
#     thin* extralight* light* medium* semibold* bold* extrabold* heavy* )

weights=( "" Regular italic oblique \
    light* medium* bold* extrabold* )

for face in "${typefaces[@]}"; do
    echo "Processing ${face} ..."
    dest=${face}
    if [ -z "${face}" ]; then
        dest=Normal
    fi
    mkdir -p "${dest}"
    for weight in "${weights[@]}"; do
        find "${TMP_DIR}" -iname "zed-mono-${face}${weight}.ttf" -exec mv "{}" "${dest}" \;
    done
done
Afrowave commented 4 months ago

Beautiful work. Thanks guys.👏🏾