microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.1k stars 793 forks source link

Ligatures that DON'T deform shape #716

Open charlesroper opened 3 months ago

charlesroper commented 3 months ago

0xType's excellent 0xProto contains ligatures that do not fold sequences such as === and != into one symbol such as and . It instead keeps the characters visually distinct, but still positions and aligns them. This is the best of both worlds: the usability of distinct characters with the aesthetic appeal of ligatures. I'd love to see a set of alternative ligatures in Cascadia Code that does this.

See here: https://github.com/0xType/0xProto?tab=readme-ov-file#4-ligatures-that-dont-deform-shape

As Fira Code suggests, sequences such as := or => function as single logical tokens, even though they are composed of two characters on the screen. However, many programming fonts, such as Fira Code, use ligatures, for example, to change the appearance of != to change its appearance to ≠ and other ligatures. Although != is commonly used to represent ≠ in many programming languages, in my view, ligatures that alter the original meaning do not truly fit the definition of "ligatures".

From a functional or usability standpoint, ligatures that transform the meaning of ≠ or other overly distorted ligatures make it challenging to anticipate their meaning if any part of the string is erased.

aaronbell commented 3 months ago

Sadly, it is impossible to serve everyone's needs in one font (and only so many stylistic sets available!). And I am not planning any further modifications to the ligatures in Cascadia Code's current form.

That is to say that I am working on a new version of Cascadia which will rework how the ligatures are implemented and have stylistic sets for particular major coding languages (at least, that's my current thought). Ideally, I am also planning a website where users can customize the ligature set to get exactly what you want and nothing you don't. That's the only real way to provide the level of fine tuning that coders expect.

Anyway, that's all still in the air, but the direction I'm planning to head.

tats-u commented 2 months ago

Cascadia Code is now used in code blocks in Teams. Not a few of CJK users are not used to such ligatures due to existences of MS Gothic, GulimChe, and SimHei, which do not support such ligatures. Those in Cascadia Code confuse such users a lot and must be changed to be as modest as 0xProto by default. (The current ones can be an additional style set.)

Programming fonts that support CJK languages are either of:

These mean no official font supporting both CJK languages and ligatures at the same time. Source Han Mono is not easy to use because the width of han is not twice as wide as alphabets.

Also, the current ligatures confuse newbies too. I wonder who can find out === from at first sight.