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.79k stars 3.62k forks source link

[CaskaydiaCove] Slashed zero has wrong height #1390

Closed Alecton4 closed 6 months ago

Alecton4 commented 10 months ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior:

Normal slashed zero has wrong height compared to other numbers, but italic slashed zero is fine. The original Cascadia Code 2111.01 doesn't have the issue. Also, the doted zero is fine. Update: Version 2.3.3 is fine, staring from 3.0.0 the height is wrong.

Expected behavior:

The regular slashed zero should have the same height as other numbers.

Example symbols:

0

🔧 Your Setup

★ Screenshots (Optional)

Using VSCode settings "editor.fontLigatures": "'liga', 'calt', 'ss03', 'ss05', 'ss08', 'ss20', 'zero'":

image

Using VSCode settings "editor.fontLigatures": "'liga', 'calt', 'ss03', 'ss05', 'ss08', 'ss20'":

image

Finii commented 10 months ago

Sorry to hear of your problem.

The problem seems to be a sublel one, both glyphs have the exact same height of 1440 units.

image

This could be the hinting. Do you still see it if you increase the font size?

Alecton4 commented 10 months ago

@Finii I tried adjusting "editor.fontSize" in VSCode, found that font size 14-16 have this issue, <=13 or >=17 not, size 8 and 9 also have this issue. And in size 8, zero is higher than other numbers instead of shorter. It seems that the slashed zero just behaves differently than other characters.

Finii commented 10 months ago

Thanks for the information. This really sounds like a hinting problem.

Unfortunately Cascadia Code hinting is done properly (by Aaron / "Microsoft") only for the variable font anymore. For the static font we have the choice of ttfautohint (which ~is bad~ differs a lot from the manually hinted original variable font) or at the moment we use VisualTrueType. I also looked into one other autohinter, but VTT seemed best.

I will check if the slashed-zero is somehow not hinted (it has a very high codepoint) and if so how to include it in the autohinting.

Alecton4 commented 10 months ago

@Finii Sorry I'm unfamiliar with the font design area, but I think the original Cascadia Code that works fine on my machine is not installed as "variable font". I installed the content in otf/static from the package folder.

Finii commented 10 months ago

The glyph zero.zero ('slashed zero') is hinted, but the program is far shorter...:

image


Regarding

I installed the content in otf/static from the package folder.

The static versions there are hinted via ttfautohint which results in a considerable height difference compared to the variable font. See cascadia-code/issues/371. As most? (at least a lot) people seem to have both (patched and unpatched) installed on their machine they all complain that the patched font (using the original static version, ttfautohint) and the unpatched font (variable font, manually hinted) do not look similar (because different hinting). For that reason we at NF re-hint the static fonts with VTT to get a better switch-over experience.

Finii commented 6 months ago

I again tried to fix this in VTT, but I did not find anything that would solve this.

As we depend on automatic / original hinting we can not do much here.

Finii commented 6 months ago

Strange, when I look into the antialiasing, the size is almost always the same, and if it differs the slashed-zero is bigger. And the italic version is identical.

:thinking:

image

Is the effect only in the VSCode thing? Maybe they use their own font renderer :grimacing:

Also the code is identical for zero.zero normal and italic (just the point numbers change).

Hmm, even on Windows there is no difference

Kooha-2024-03-14-13-34-17

This seems to be a one-off artifact. I have no idea what we possibly can do here. Sorry,