Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The glyphs of CascadiaCode are slightly above the centerline. #623

Closed
myy1966 opened this issue May 8, 2021 · 22 comments
Closed

The glyphs of CascadiaCode are slightly above the centerline. #623

myy1966 opened this issue May 8, 2021 · 22 comments

Comments

@myy1966
Copy link

myy1966 commented May 8, 2021

🎯 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

@Magicrafter13
Copy link

Magicrafter13 commented Oct 27, 2021

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

@ryanoasis
Copy link
Owner

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

@myy1966
Copy link
Author

myy1966 commented Dec 12, 2021

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?

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

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
Copy link
Collaborator

Finii commented Dec 12, 2021

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)

@myy1966
Copy link
Author

myy1966 commented Dec 12, 2021

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.

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

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
Copy link
Collaborator

Finii commented Dec 12, 2021

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.)

@myy1966
Copy link
Author

myy1966 commented Dec 12, 2021

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.

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

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...

@myy1966
Copy link
Author

myy1966 commented Dec 12, 2021

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.

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

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 ;-)

@myy1966
Copy link
Author

myy1966 commented Dec 12, 2021

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

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

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

@Finii
Copy link
Collaborator

Finii commented Dec 12, 2021

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

@myy1966
Copy link
Author

myy1966 commented Dec 12, 2021

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.

@Finii
Copy link
Collaborator

Finii commented Jan 7, 2022

Ah this is another case of #731 (comment)

Need to open a proper Issue number and or PR.

@Jaykul
Copy link

Jaykul commented May 12, 2022

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

@Finii
Copy link
Collaborator

Finii commented May 12, 2022

@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

@Jaykul
Copy link

Jaykul commented May 13, 2022

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

@Finii
Copy link
Collaborator

Finii commented May 13, 2022

Good to hear πŸ˜… Thank you.
Hopefully @ryanoasis will merge #723 into the RC, before it is released.

@Finii Finii closed this as completed Oct 11, 2022
@github-actions
Copy link
Contributor

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 github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants