Answer a question

See October, 2019 Release Notes - stylistic sets.

Font feature settings

There is now more fine grained control over the font features. When configuring "editor.fontLigatures": true, VS Code would turn on liga and calt. But some fonts have more settings, such as stylistic sets used by Fira Code.

We now allow these font features to be explicitly controlled, for example:

"editor.fontFamily": "Fira Code",

"editor.fontLigatures": true,

"[javascript]": {  
   "editor.fontLigatures": "'ss02', 'ss19'",
},

This is what stylistic sets can do. (See https://github.com/tonsky/FiraCode#stylistic-sets.)

Fira Code v2 stylistic sets.

I was already using Fira Code, so I thought I could download version 2 of the font and add the following lines to the editor settings.

  "editor.fontFamily": "Fira Code",  
  "editor.fontLigatures":"'zero', 'ss02', 'ss03', 'ss04', 'ss05', 'calt'",

I was getting strange results: The zero style would work, but previously working ligatures stopped working; other sets didn't work at all.

How do I get Fira Code version 2 stylistic sets working in Visual Studio Code?

Answers

I noticed that the stylistic sets would work better, but not perfectly, if I disabled this setting:

"editor.letterSpacing": 0.2,

I filed an issue with vscode, https://github.com/microsoft/vscode/issues/84018 where I learned that you should add the calt set to your ligature settings ala

"editor.fontLigatures":"'zero', 'ss02', 'ss03', 'ss04', 'ss05', 'calt'",

Thanks to alexandrudima.

And then I noticed a number of people were having similar issues, https://github.com/microsoft/vscode/issues/84917

Two important points to get stylistic sets working:

  1. In your OS font manager, uninstall older versions of Fira Code if you were using it before first, and then install Fira Code v2. And restarting the OS and vscode afterwards is probably necessary.

  2. You will almost certainly need to add calt to your list of whatever new sets you wish to use just to get other sets working.

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐