ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
52.86k stars 3.6k forks source link

Add font Zed Mono #1504

Closed cabrinha closed 3 months ago

cabrinha commented 5 months ago

Description

Added a new font: "Zed Mono"

Requirements / Checklist

What does this Pull Request (PR) do?

Adds a new font

How should this be manually tested?

Any background context you can provide?

https://zed.dev/

https://github.com/zed-industries/zed-fonts/issues/10

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

Screenshot 2024-02-01 at 6 38 35 PM

cabrinha commented 5 months ago

I will add some screenshots once I get this working, right now the script is giving me an error:

❯ NERDFONTS='--debug 2 --makegroups 4 --dry' ./gotta-patch-em-all-font-patcher\!.sh -j "/ZedMono"
# [Nerd Fonts]  Filter given, limiting search and patch to pathname pattern '/ZedMono'
# [Nerd Fonts]  Total source fonts found: 0
# [Nerd Fonts]  Invalid release timestamp SOURCE_DATE_EPOCH: 1706817961

Anything wrong with my PR? I did add many subdirectories under src/unpatched-fonts/ZedMono, including Bold, Light, etc... There is just nothing in them because the script hasn't run.

Edit: Seems like this is the issue: https://github.com/ryanoasis/nerd-fonts/issues/1505

Using the docker method now:

docker run --rm -v "${PWD}/src/unpatched-fonts/ZedMono:/in:Z" -v "${PWD}/patched-fonts/ZedMono:/out:Z" nerdfonts/patcher --complete --makegroups 4

I'm not sure of the correct way to arrange these subfolders, so let me know if anything needs to change.

cabrinha commented 5 months ago

@Finii let me know if there are any changes I need to make here.

rafa-hover commented 4 months ago

@cabrinha Thanks for working on this!

Blankeos commented 4 months ago

@cabrinha Thanks for working on this! Still waiting for this to be released haha. Zed Mono has become my favorite font. I'm planning to just use this PR and install the fonts from there. Do I need to run anything (run a build or something) or will the patched .ttf work out-of-the-box?

arlyon commented 4 months ago

I downloaded this and don't see any difference between iosevka.

Screenshot 2024-03-15 at 16 24 28 Screenshot 2024-03-15 at 16 24 34 Screenshot 2024-03-15 at 16 24 42

Notice how the bundled font in zed looks wider

Blankeos commented 4 months ago

@arlyon So it works. Even works for the native MacOS Terminal (It has no fallback fonts unlike VSCode). Also got it to work on VSCode.

By the way, "Zed Mono" by itself does look 'weird' in my opinion because it looks too thin. I prefer the "Extended" version because it makes it have almost the character spacing as JetBrains.

image

Steps I did to get this:

  1. I clicked on @cabrinha's remote forked repo.
  2. I went to nerd-fonts/patched-fonts/ZedMono/Extended (I only download the Extended)
  3. I copied the URL and went to a third-party app to download the directory.
  4. Installed the fonts.
  5. And just put them on VSCode and my Terminal.
  6. Notice how on VSCode, I'm only using "ZedMono Nerd Font" and not "ZedMono Nerd Font Extended". A little weird yeah but I guess it helps that I didn't really install the regular, thinner patched Zed Mono font? If I would have, it might have the same result as yours @arlyon.
Finii commented 4 months ago

@Finii let me know if there are any changes I need to make here.

Thanks for the PR!

Well, what is special with this font, as we have some Iosevkas already?

image

arlyon commented:

I downloaded this and don't see any difference between iosevka.

And

So it works. Even works for the native MacOS Terminal (It has no fallback fonts unlike VSCode). Also got it to work on VSCode.

Better be! If the patch would not work that would be a bug in the Nerd Font patcher that needs fixing :->

This font seems to have some interest, but to consider it someone should point out the advantages/differences to a regular Iosevka.

Btw 'extended', iirc there is a feature request to include some Iosevka extended for the same reason as Blankeos'.

arlyon commented 4 months ago

The font bundled in zed does look nicer (imo) than iosevka. It's a little wider but I have not managed to get them to look the same in my editor.

For a comparison compare the first screenshot in my first comment with the others.

Blankeos commented 3 months ago

@cabrinha I'm getting this issue with the font currently. Italic variant of ZedMonoNF-Extended doesn't seem to use ZedMonoNF-ExtendedItalic.

It seems to use ZedMonoNF-Italic instead.

⚠️ The issue:

image

🤔 Ideally italics should look like this when using ZedMonoNF-Extended

image

🥳 EDIT (FIXED!): If you're running into this issue too and wondering how to fix it:

JUST USE ZedMono NF Extended. I was freaking wondering why it wasn't working for VSCode but it worked fine on my terminal lmfao.

❌ My mistake: When I was opening the font on Font Book, I just saw ZedMonoNF-Extended on PostScript Name and used that. But actually it should be Unique Name that I'd use. (The MacOS terminal also uses that)

image

✅ Here's the final VSCode setting I have for this:

image
cabrinha commented 3 months ago

Resolved conflicts. Let me know if there is anything else I need to do to get this merged @Finii

Finii commented 3 months ago

Zed seems to be a bit more roundish, at least compared to our regular Iosevka:

image

Finii commented 3 months ago

Rebase on master, force push.

There are some errors in the font database file fonts.json, fixed en passant.

Are really all these versions needed?

image

Edit:

I must admit I'm not very convinced that this font should be included. It is 'just another' Iosevka clone. It has a commercial background. It is not on programmingfonts (albeit in the initial PR it said it is, but that false information obviously).

Finii commented 3 months ago

@Blankeos

But actually it should be Unique Name that I'd use

Well, you need to specify the Family Name of the font, as it says in the option.

Finii commented 3 months ago

Upstream has not even the version right in the font file :sob: This is supposed to be 1.2.0?

One times, work with professionals...

image image

Finii commented 3 months ago

Unfortunately we got a Cask clash...

My mistake, there is no problem

Finii commented 3 months ago

Hmm, I don't get it

before the commit above:

here the order is ok

./Noto/Serif/NotoSerifNerdFont-ExtraCondensedExtraBoldItalic.ttf

and here it is not

DEBUG: =====> Filename 'ZedMonoNerdFont-ExtraBoldExtendedOblique.ttf'

Need to investigate that more...

Finii commented 3 months ago
======== NotoSansMono_Condensed-ExtraBold.ttf ========
SFNT Fullname      ID 4     Noto Sans Mono Condensed ExtraBold
SFNT Family        ID 1     Noto Sans Mono Condensed ExtraBold
SFNT SubFamily     ID 2     Regular
SFNT Pref Family   ID 16    Noto Sans Mono Condensed
SFNT Pref Styles   ID 17    ExtraBold
SFNT PS Name       ID 6     NotoSansMonoCondensed-ExtraBold
======== zed-mono-extendedextrabolditalic.ttf ========
SFNT Fullname      ID 4     Zed Mono Extrabold Extended Italic
SFNT Family        ID 1     Zed Mono Extrabold Extended
SFNT SubFamily     ID 2     Italic
SFNT Pref Family   ID 16    Zed Mono
SFNT Pref Styles   ID 17    Extrabold Extended Italic
SFNT PS Name       ID 6     Zed-Mono-Extrabold-Extended-Italic

Hmm.

    known_widths = { # can take modifiers
        'Compressed': ('Cm', 'Comp'),
        'Extended': ('Ex', 'Extd'),
        'Condensed': ('Cn', 'Cond'),
        'Narrow': ('Nr', 'Narrow'),
        'Compact': ('Ct', 'Compact'),
    }

All other fonts we patch that have a width specifier have that width first in their name. Only Zed has not. Adding the sorting changes the name for Zed and nor for any other. :+1:

Examples

Counterexample

Finii commented 3 months ago

image

:sob: