admin 管理员组文章数量: 1086019
I was reading the release notes of Visual Studio Code and a particular caught my eye.
As you can see, there is a javascript file with the ≤ symbol. I can't figure out how it works, if I try to use it in my code I get a "Invalid or unexpected token" error (which I was expecting), and I can't find if it's only a VSCode configuration that shrinks <= into ≤ for aesthetic purposes.
How does it work?
I was reading the release notes of Visual Studio Code and a particular caught my eye.
As you can see, there is a javascript file with the ≤ symbol. I can't figure out how it works, if I try to use it in my code I get a "Invalid or unexpected token" error (which I was expecting), and I can't find if it's only a VSCode configuration that shrinks <= into ≤ for aesthetic purposes.
How does it work?
Share Improve this question edited Apr 13, 2018 at 8:16 Nisarg Shah 14.6k6 gold badges38 silver badges57 bronze badges asked Apr 13, 2018 at 8:16 bimbo1989bimbo1989 8221 gold badge10 silver badges22 bronze badges 3- 2 Might be github./tonsky/FiraCode – tkausl Commented Apr 13, 2018 at 8:17
- 1 it IS only a VSCode configuration that shrinks <= into ≤ for aesthetic purposes. – Kajbo Commented Apr 13, 2018 at 8:19
- Going to check out FiraCode, looks like it's the answer :) – bimbo1989 Commented Apr 13, 2018 at 8:20
4 Answers
Reset to default 3It looks like a monospaced font with ligatures, which makes <=
looking as one sign.
Some sources:
- https://github./tonsky/FiraCode
- https://github./i-tu/Hasklig
- https://github./be5invis/Iosevka
This is just due to the font ligature. The actual characters are 2: <=
but the ligature renders them as one.
Some fonts support ligatures such as Fira Code and most likely you need to enable ligatures on your IDE if you want to use them.
I have worked with Ligatures for a while. These are called Monospaced Programming Fonts with Ligatures and it's just not FiraCode, there are several others out there. For example -
Monoid
Hasklig
Also these are supported by a LOT of editors and not just VS Code.
Perhaps worth to mention that for working ligatures in VSC you need:
- Locally installed font with ligatures support (Monoid / Iosevka / Fira Code)
editor.fontFamily
set to given font,editor.fontLigatures
set totrue
.
本文标签: javascriptIs ≤ a legit less than equals charStack Overflow
版权声明:本文标题:javascript - Is ≤ a legit less than equals char? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744030846a2521470.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论