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
53.93k stars 3.63k forks source link

Caskaydia Cove introduces ligature issue not in Cascadia Code #1291

Closed Kissaki closed 5 months ago

Kissaki commented 1 year ago

Testing in Windows Terminal - font size 12, Windows 11, NF v3.0.2

I would expect the ligature for => to be the same and without visual artifacts.

Cascadia Code:

image

CaskaydiaCove Nerd Font Mono:

image

🗹 Requirements

Finii commented 1 year ago

Oh, sorry to hear that. Lets find the reason.

Works in Writer

image

phjordan commented 1 year ago

I see the same, in Windows Terminal as well as in VS Code, Nerd Fonts 3.0.2

image

Finii commented 1 year ago

Can not reproduce on Win10, VS Code 1.71.0, NF 3.0.2:

image

My settings:

image

Finii commented 1 year ago

The problem with Windows Terminal is that they bundle Cascadia Cove (VF) with it and one can not uninstall it, which I hate.

Installing that thing now, hold tight.

Finii commented 1 year ago

@phjordan Btw, please share a picture of your config.json and maybe a view of the font settings dialog with 'cas' as search term:

image

You see I have no Cascadia Code installed. I unpacked the Caskaydia zip file, select all, right click, install (for user) (is how I installed the fonts).

Finii commented 1 year ago

Can see it with Windows Terminal:

image

(:thought_balloon: Now I can not restart VS Code, great)

Finii commented 1 year ago

Windows is so easy, everything works out of the box!

phjordan commented 1 year ago

Here are my font settings, Both 'Cascadia Code' and 'CaskaydiaCove...' are installed for all users.

image

I noticed that the editor.fontSize-setting does have an effect. I don't know anything about font rendering and scaling, but maybe this observation is of help. With 'Cascadia Code' set as font, the arrows seem fine for all font sizes.

My original VS code settings.json: image

It looks fine with editor.fontSize commented out: image

It looks fine with font size 14: image

Font size 12: image

Font size 22: image

Edit: This is on Windows 10

Finii commented 1 year ago

Thanks for the input! There are indeed size-limits where the font switches rendering, I will check that. And maybe I can get VS Code repaired on that one machine, all other machines I have are Win11...

Edit: Ah, report was for Win 11 :woman_facepalming:

Finii commented 1 year ago

Ah, I have another hunch... Which concrete Cascadia Code did you compare with? (Best would be a details screenshot of the font settings thing, when opened Cascadia Code)?

I fear that it might be the hints 🙄

Finii commented 1 year ago

Which concrete Cascadia Code did you compare with?

This is the reason why I hate the bundling of Windows Terminal with Cascadia Cove, because they bundle the VF and one has to go through a lengthy operation to remove that if you want the otf or pure ttf ones instead.

The font-patcher can not work with VF, so we use some static ttf variant (see the readme)

phjordan commented 1 year ago

Which concrete Cascadia Code did you compare with? (Best would be a details screenshot of the font settings thing, when opened Cascadia Code)?

Yes, it seems to be the bundled version of Cascadia Code that I have installed. image

FrancescoLuzzi commented 1 year ago

Thanks for the input! There are indeed size-limits where the font switches rendering, I will check that. And maybe I can get VS Code repaired on that one machine, all other machines I have are Win11...

Edit: Ah, report was for Win 11 🤦‍♀️

Also reproducible on windows 10 👍🏼

azdanov commented 1 year ago

I also encountered this issue. Windows 11, Windows Terminal 1.17

image Can see that -- near git are of different sizes

image And it gets better with font size increase.

harshv5094 commented 1 year ago

I've Installed the latest version of Caskaydia Cove NF on my windows 10, and now I'm seeing this box icons, I need help regarding this issue

image

image

Finii commented 1 year ago

@harshv1741 This is no ligature Issue.

Please check out

Finii commented 5 months ago

I would need someone who can test the potential fix, good would be a thorough test like @phjordan with all the arrows.

Finii commented 5 months ago

It would be great if someone who sees the arrows problem can check this font:

CaskaydiaCove_arrows.zip Version 3.2.1-10

(Probably you need to uninstall the old Caskaydia first, then reboot, then install the font given in this comment.)

Without reports it is hard to see if this will fix it or not... Help needed.

FrancescoLuzzi commented 5 months ago

Thanks for the update, i'll give it a try as soon as I can!

FrancescoLuzzi commented 5 months ago

It seems to be 99.9% resolved!

In some font sizes the "=>" ligature has a really small defect (there is a really small gap between the "equal" sign and the "greater than" sign image

This is the "correct" arrow on a different size: image

Same thing with: image

Finii commented 5 months ago

Hmm, this is maybe also a hinting problem, this is most visible at 12 pt / 96 dpi.

image

The advance width is 9.4 pixel, and so the last pixel is only filled less than half, so it is rendered half-grey. Of course this will vary with the number of characters in front of it.

The situation is comparable with FiraCode unpatched:

image

Just here other sizes show that same problem.

Are you sure Cascadia Code unpatched does not have the same problem at some sizes? Maybe you can try. I need to fire up Glyphs3 to examine it. Or was there not a tool on Linux to show the subpixel rendering of variable fonts on Linux :thinking:

I can check, but I believe this is a principle problem that can not be solved without 'massive' manual intervention.

Affected are a high number of glyphs (the font-patcher reports it auto-adjusts 88 glyphs), so that would be quite some work to do, manually edit the hints to extend more to the outside. Well, and famous FiraCode has the same, so why should we be better ;-)

FrancescoLuzzi commented 5 months ago

Are you sure Cascadia Code unpatched does not have the same problem at some sizes? Maybe you can try.

Just uninstalled Caskaydia Cove, rebooted and tried using Cascadia Code, the issue is still there image

Well... your patch worked just fine, it seems that Cascadia Code is the problem now. Thanks!

Finii commented 5 months ago

Thank you for testing all that stuff! I will do some final tests with the PR (because it completely changes how the configuration works), and then merge the fix.

Finii commented 5 months ago

@allcontributors please add @FrancescoLuzzi for bug

allcontributors[bot] commented 5 months ago

@Finii

I've put up a pull request to add @FrancescoLuzzi! :tada:

nguyenlephuc2108 commented 1 month ago

Oh! == is don't work, or my computer have problem?

Phoenix- commented 2 weeks ago

Hi, I've got exactly the same problem with -> and => ligatures. Actual on all font sizes and font weights, but severity differs from size to size. image

Win11 22631.4037 NF 3.2.1 Screenshot is from Windows Fonts Manager, but actual for any text editor. Tried VS Code and Windows Terminal

feliperomero3 commented 2 weeks ago

Hi, first, thank you for this nerd font, I've been using for four years now.

I'm experiencing the same ligature 'tearing' issue as @Phoenix-

(screen capture below)

image

In the --> ligature the 'tearing' is barely noticiable

In the ==> ligature, the 'tearing' is much more noticiable

These are the fonts shown in the screen capture (screen capture below)

image

My versions

CaskaydiaCove NF: Version 2111.001; VTT 6.35;Nerd Fonts 3.2.1

Finii commented 1 week ago

The problem is the hinting.

The possibilities here are:

  1. Use Cascadia Code static with ttfautohint (which I assume do not have this problem, but not checked)
  2. Hand-hint the problematic ligature glyphs
  3. Rewrite font-patcher to patch VFs 😁

Then I obviously did something here with commit b2cf801989 font-patcher: Allow to rehint some Cascadia glyphs Ah, this is

That has been merged mid April 2024, just after the v3.2.1 release:

Screenshot 2024-09-08 at 13 37 34

So probably your problems will (mostly) go away after the next release, which is v3.3.0, which is scheduled to happen this month (https://github.com/ryanoasis/nerd-fonts/discussions/1705). So please be patient a bit more. The fix is not 100% perfect but at least better (see notes / feedback above).

Phoenix- commented 1 week ago

Thanks for the explanation and for your work. Great fonts :)