Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

vscode: update to stylistic sets using font ligatures with Fira Code

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...