javascript - Is ≤ a legit less than equals char? - Stack Overflow

I was reading the release notes of Visual Studio Code and a particular caught my eye.As you can see, th

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
Add a ment  | 

4 Answers 4

Reset to default 3

It 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 to true.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744030845a4546527.html

相关推荐

  • javascript - Is ≤ a legit less than equals char? - Stack Overflow

    I was reading the release notes of Visual Studio Code and a particular caught my eye.As you can see, th

    9天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信