font ligatues with stylistic sets not fully working with `editor.letterSpacing` setting
ArturoDent opened this issue · 3 comments
With these settings:
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": "true",
"[javascript]": {
"editor.fontLigatures": "'zero', 'ss02', 'ss03', 'ss04', 'ss05'",
},
I get this in a javascript file:
So all is good (the red squiggly is just about the experimental decorators support).
But if I add this setting:
"editor.letterSpacing": 0.2,
I've lost the `ss02' set and the triple equals ligature.
And just for completeness here is what I get for just fontLigatures
set to true with no stylistic sets included: (as expected)
Should letterSpacing
have this effect?
Version: 1.40.0-insider (user setup)
Commit: 515f496
Date: 2019-11-05T14:32:05.211Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.19013
Does this issue occur when all extensions are disabled?: Yes
I've noticed this works in combination with letter spacing only when enabling calt
as well:
"editor.fontLigatures": "'zero', 'ss02', 'ss03', 'ss04', 'ss05', 'calt'",
I am confused then. From the current release notes: "When configuring "editor.fontLigatures": true, VS Code would turn on liga and calt." So that no longer happens (if other stylistic sets are used), that 'calt' for instance is turned on when fontLigatures
is true
?
After v1.40 we will need to manually include 'calt' if we use other stylistic sets? Or are you just recommending that as a temporary workaround? If so, not many people will realize that.
Or is this an upstream issue?
@ArturoDent This is how it works:
"editor.fontLigatures": false
=>font-feature-settings: "liga" off, "calt" off;
"editor.fontLigatures": true
=>font-feature-settings: "liga" on, "calt" on;
"editor.fontLigatures": "customstring"
=>font-feature-settings: customstring;
So true
and false
are basic options for most users to enable ligatures. The advanced users that want full control over the font-feature-settings
can gain full control by writing a string instead of a boolean.
I think it is best that we don't massage the provided string or try to append stuff to it. In other words, I would leave it as it is, if you want to use letter-spacing
and advanced custom font-feature-settings
, then you need to manually enable 'calt'
in the font-feature-settings
. I think this is good enough. If lots of people run into this we could try implementing a parser for font-feature-settings
, and giving a warning if 'calt'
is forgotten, but I wouldn't go there just yet.