microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.39k stars 803 forks source link

[Question] How can I use only light and light italic by default in vscode? #500

Closed WindSoilder closed 3 years ago

WindSoilder commented 3 years ago

I have tried to build my self based on main branch, and I just allow CascadiaMono-Roman_Light and CascadiaMono-Italic_Light-Italic font in my font setting. 图片

图片

But I have issue to make use of them in vscode, all fonts in vscode is italic.. 图片

If I enable CascadiaMono-Roman and CascadiaMono-Italic, this issue disappeared... But the weight is too high for me, so I just want to use a lighter version..

aaronbell commented 3 years ago

Ok, two things.

One is that you should use the PR that I submitted last week as that has necessary improvements to the name table (it should be pushed to main this week).

Two, it appears you’re trying to use the Variable font version of the fonts. So either you will need to set the font weight in VSCode to a lighter weight (say, 300), or switch to the stat instances (which the name table fix should help with).

WindSoilder commented 3 years ago

Hi, thanks for your quickly reply :-) But sorry it seems this doesn't working for me.

One is that you should use the PR that I submitted last week as that has necessary improvements to the name table (it should be pushed to main this week)

I have installed from this source. (I believe the code lays here: https://github.com/aaronbell/cascadia-code/tree/work)

Two, it appears you’re trying to use the Variable font version of the fonts. So either you will need to set the font weight in VSCode to a lighter weight (say, 300), or switch to the stat instances (which the name table fix should help with).

Here is the screenshort when no setting lighter weight: 图片

Here you can see that I'm using the source code from your PR (the italic font shape has changed.)

Here is another screenshort when setting lighter weight (everything goes into italic again): 图片


Oh, by the way, may I ask what's the meaning of salt or ss01 from here? https://github.com/microsoft/cascadia-code/issues/468#issuecomment-854196781 (I'm a big fan of this italic font version)

aaronbell commented 3 years ago

Can you zip up all of the fonts that you’re generating And attach them here so I can take a look at what might be going on?

As for salt / ss01, these are code functions in the font. See https://github.com/microsoft/vscode/issues/80577 for how to implement these in VS Code.

WindSoilder commented 3 years ago

Sure, here is the file. ttf.tar.gz

aaronbell commented 3 years ago

Hi, sorry for the delay in getting back to you. Finally had a chance to take a look at the files you sent over and, honestly, I don't see anything wrong with them.

I suspect that the issue might end up being something related to font conflicts in your font cache. I'd suggest removing all Cascadia Code fonts from your system, restarting, then reinstalling. Also, potentially clear the font cache. Sorry for the trouble!

spaceaardvark commented 3 years ago

I am seeing similar behavior with the latest release. If I set editor.fontWeight to "300", then everything is in italics. Is that what your PR is supposed to fix, @aaronbell? And thank you for your efforts!

Plot twist: Setting the font weight to anything other than 300 works fine. It's only 300 that makes everything italic.

WindSoilder commented 3 years ago

@spaceaardvark Hi, would you please try to use the ttf I upload from here can solve your issue?

https://github.com/microsoft/cascadia-code/issues/500#issuecomment-856376217

I have tried it again @aaronbell , it seems that it works on my windows machine, but failed in Mac machine, I will try to clear font cache in mac(If there is a cache) when I got it

After tried to clear cache, the problem still exists too.

Plot twist: Setting the font weight to anything other than 300 works fine. It's only 300 that makes everything italic.

Oh, I got the same behavior too.

spaceaardvark commented 3 years ago

@WindSoilder that doesn't fix the problem.

aaronbell commented 3 years ago

Hi! Please try the new release and let me know if it resolves your issues. Thanks!

https://github.com/microsoft/cascadia-code/releases/tag/v2106.17

WindSoilder commented 3 years ago

Yeah, I'm using Mac, I have tried both otf and ttf, it seems that otf is ok, but ttf doesn't.

aaronbell commented 3 years ago

Out of interest, can you provide a bit more information about the system / VS Code version that you're using? I feel like this is likely a platform-specific issue but want to make sure.

WindSoilder commented 3 years ago

System version: macOS Big Sur11.4

Vscode about information:

Version: 1.58.1
Commit: 2aeda6b18e13c4f4f9edf6667158a6b8d408874b
Date: 2021-07-13T06:22:33.013Z (20 hrs ago)
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 20.5.0
aaronbell commented 3 years ago

hmmmm. For fun, what happens if you set the font weight to 301.

aaronbell commented 3 years ago

Another thing I'd be interested for you to test out. Can you visit this site: https://vscode-web-test-playground.azurewebsites.net/ (ideally in Chrome)

Click the triple lines in the upper left File > Preferences > Settings and then enter in the code settings:

{
    "editor.fontFamily": "\"Cascadia Code\", Menlo, Monaco, 'Courier New', monospace",
    "editor.fontWeight": 300,
    "editor.tokenColorCustomizations": {
        "comments": {"fontStyle": "italic"}
    },
}

Does the issue repro there as well?

WindSoilder commented 3 years ago

hmmmm. For fun, what happens if you set the font weight to 301.

Every is still italic.

Does the issue repro there as well?

Yeah, I can reproduct it. (In chrome)

图片

aaronbell commented 3 years ago

Good news bad news time!

Good news: This issue is isolated to Big Sur, it seems Bad news: It is definitely something in the font because JetBrains Mono does not have the same problem Good news: I have identified what is causing the issue and can fix it Bad news: There appears to be a secondary issue that JetBrains Mono also suffers from wherein any weight value less than 400 becomes the lowest possible value (100 for JetBrains, 200 for Cascadia).

I will need to investigate further tomorrow.

s1eke commented 3 years ago

Same problem on win11 image

System Build:22000.65 VSCode Version:1.58.1 Cascadia Version:2106.17

WindSoilder commented 3 years ago

Thanks !.! I have checked the new build ttf in your pr, and it works!

WindSoilder commented 3 years ago

Oh, by the way , I found that SemiLight weight value in your pr is 350, but I have tried to set weight to 350 in vscode, but vscode is still using Regular weight rather than SemiLight, I don't know if it's the vscode's issue.

aaronbell commented 3 years ago

See https://github.com/microsoft/vscode/issues/128097

:/

avarayr commented 3 years ago

After some experimentation, I've found that In Vscode font-weight anything from 250 to 349 defaults to all-italic, including the whole number weight 300

I'm using variable TTF fonts on Mac OS Big Sur (11.5.2)

image