nerd-fonts icon indicating copy to clipboard operation
nerd-fonts copied to clipboard

The glyphs of CascadiaCode are slightly above the centerline.

Open myy1966 opened this issue 4 years ago • 21 comments

🎯 Subject of the issue

🔧 Your Setup

  • Font: All Caskaydia Cove Regular Nerd Font
  • Terminal emulator: Windows Terminal, buildin terminal of VSCode
  • OS: Windows 10 20H2

★ Optional

CaskaydiaCove NF in Windows Terminal, the glyphs are slightly above the centerline. wt_cc

MesloLGS NF in Windows Terminal, the glyphs are on the centerline. wt_m

myy1966 avatar May 08 '21 13:05 myy1966

I've noticed this issue when using the font in strange places, like Termux on my phone for example. Those > arrow blocks actually go above the background of the character behind them, so they really stick out... Screenshot_20211027-105200_Termux

Magicrafter13 avatar Oct 27 '21 17:10 Magicrafter13

There have been some updates to the patcher. if you are able to, could you try repatching yourselves? If not i'll follow up with changes in the release candidate 2.2

ryanoasis avatar Dec 11 '21 20:12 ryanoasis

I have tried, the CLI command I used is fontforge -script font-patcher CascadiaMono-Regular.otf -c. The version of CascadiaMono is 2110.31.

The result is shown in the image: cascadia It looks like the positions of the powerline symbols are correct. However, the windows icon and the python icon are slightly below the centerline. And compared to the original "CaskaydiaMono Nerd Font", the windows icon and python icon are slightly smaller. The image below uses the original version: cascadia_1

Now I am using another font, "MesloLGS NF". It is perfect under Windows: cascadia_2 Have you had any idea why MesloLGS is so different from CascadiaMono?

myy1966 avatar Dec 12 '21 03:12 myy1966

The icons look smaller, because it looks like a 'Nerd Font Mono' version (i.e. Caskaydia Mono Nerd Font Mono), where all glyphs are just 'one space' wide. In the 'original' version the icons are allowed to occupy up to 'two spaces':

image

I will have a look.

Edit: Add red circle to picture

Finii avatar Dec 12 '21 11:12 Finii

Can not reproduce.

$ fontforge font-patcher ~/Downloads/CascadiaCode-2110.31/otf/static/CascadiaMono-Regular.otf -c
$ fontforge Caskaydia\ Mono\ Regular\ Nerd\ Font\ Complete.otf

Windows icon u_F17A is wider than 'normal' (1902 vs 1200): image

Maybe you can copy and paste your text into a comment, so that I can see which codepoints you use exactly.

Can of course be a Windows problem. Can you reproduce it with something more common (not VScode) that I might have already on my Windows box?

Alternatively you could check the font yourself by opening the font in fontforge (there is a Windows executable available).

I guess there is some font substitution and/or installation problem on your machine ;-)

(At first I thought you forgot the --complete ... because it is the last option you give (I usually give it as first argument - not that it matters. BUT maybe you first patched it without --complete, installed it, repatched it and reinstalled it - often it will not work because of the font handling blah of Windows)

Finii avatar Dec 12 '21 11:12 Finii

When patching the font, I haven't added the "-s" flag, and the patcher generates the glyphs as double-width. I found that it has something to do with what terminal emulator is used. In the previous comment, I was using the windows terminal. However, when I change to the Tabby, the windows icon and the python icon are rendered correctly: cascadia_3 But with the Tabby, a vertical line appears in the triangle symbol of the powerline symbols.

myy1966 avatar Dec 12 '21 11:12 myy1966

~~If you are willing, can you try if the vertical lines are still there on Tabby when you also give --careful?~~

Sorry hold on

Finii avatar Dec 12 '21 11:12 Finii

something along the lines of

$ fontforge font-patcher ~/Downloads/CascadiaCode-2110.31/otf/static/CascadiaMonoPL-Regular.otf -c --careful

(i.e. give --careful and use a Cascadia PL variant. The result is that you do not use 'our' powerline triangular thing, but Cascadia's original powerline triangular thing.)

Finii avatar Dec 12 '21 11:12 Finii

The vertical line seems to be a common problem. Many terminal emulators under Linux, such as Konsole, Gnome Terminal, and Alacritty, will render vertical lines. The only one I found under Linux that does not render vertical lines is Kitty.

myy1966 avatar Dec 12 '21 11:12 myy1966

Hmm, you seem to be right ;) I never noticed them, but I have them on the left one (not on the right): image

My font is --careful with the Cascadia Code PL symbols...

Finii avatar Dec 12 '21 11:12 Finii

something along the lines of

$ fontforge font-patcher ~/Downloads/CascadiaCode-2110.31/otf/static/CascadiaMonoPL-Regular.otf -c --careful

(i.e. give --careful and use a Cascadia PL variant. The result is that you do not use 'our' powerline triangular thing, but Cascadia's original powerline triangular thing.)

Tabby will render vertical lines when using the original Cascadia Mono PL font. This should not be a problem with nerd-fonts, but a problem with the way tabby renders the font.

myy1966 avatar Dec 12 '21 11:12 myy1966

I use Tilix btw.

Well, I guess the vertical lines are very hard to get right and/or depend on the terminals or font rendiering engine and how good the rounding (of glyph points) is in each.

I do not know what to do now, shall I try something on Windows regarding your too small icons? I have Visual Studio installed, which is maybe similar to VS Code? Or do you mean that? I never used that for work. If I should try something there I would need a hint what I need to click ;-)

Finii avatar Dec 12 '21 11:12 Finii

I use Tilix btw.

Well, I guess the vertical lines are very hard to get right and/or depend on the terminals or font rendiering engine and how good the rounding (of glyph points) is in each.

I do not know what to do now, shall I try something on Windows regarding your too small icons? I have Visual Studio installed, which is maybe similar to VS Code? Or do you mean that? I never used that for work. If I should try something there I would need a hint what I need to click ;-)

Thanks!I have already tried it on the Visual Studio 2019 and the Cmder, it seems they render the double-width icon currently. I think this is a problem with the Windows Terminal, I should go to the GitHub repo of the Windows Terminal to raise a new issue.

Visual Studio 2019: cascadia_4 Cmder: cascadia_5

myy1966 avatar Dec 12 '21 12:12 myy1966

Windows terminal ... I remember on that one had to set the Panose stuff (which font-patcher does not) ... ponder

Finii avatar Dec 12 '21 12:12 Finii

Ah, or maybe Terminal was the thing that allows only strictly monospaced fonts (i.e. one space for one glyph). Where is the Panose commit ;-) need to read my comments

Finii avatar Dec 12 '21 12:12 Finii

Ah, or maybe Terminal was the thing that allows only strictly monospaced fonts (i.e. one space for one glyph). Where is the Panose commit ;-) need to read my comments

I think the Windows Terminal can support double-width glyphs. Now I use "MesloLGS NF" with the Windows Terminal, and all glyphs are rendered correctly.

myy1966 avatar Dec 12 '21 13:12 myy1966

Ah this is another case of https://github.com/ryanoasis/nerd-fonts/issues/731#issuecomment-1003071050

Need to open a proper Issue number and or PR.

Finii avatar Jan 07 '22 13:01 Finii

I was having a problem with the block characters (0x2588..0x258f) of CaskadiaCove NF being center-aligned, and this evening I downloaded the 2.2.0-RC CascadiaCode.zip and replaced my font with those .otf versions ...

The block characters are right, but the PowerLine characters there are a total mess...

Not only are many of them too high, all the extended ones are ... shrunken: image

I tried the mono version, and it's stretching the extend characters, but still putting them all too high and cutting off the tops: image

Jaykul avatar May 12 '22 04:05 Jaykul

@Jaykul This looks bad. What is your terminal?

I must say I have forgotten about this issue. But maybe you can try the hidden "2.2.0-RC", which is here, instead. A lot of fixes go into that. https://github.com/Finii/nerd-fonts/tree/feature/cascadia-2111.01-patched/patched-fonts/CascadiaCode

Finii avatar May 12 '22 05:05 Finii

that one looks a lot better, @Finii solves both my problems with the previous 2.1 and the previous RC

Jaykul avatar May 13 '22 03:05 Jaykul

Good to hear :sweat_smile: Thank you. Hopefully @ryanoasis will merge #723 into the RC, before it is released.

Finii avatar May 13 '22 06:05 Finii

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

github-actions[bot] avatar Apr 17 '23 00:04 github-actions[bot]