JetBrains / JetBrainsMono

JetBrains Mono – the free and open-source typeface for developers
https://jetbrains.com/mono
SIL Open Font License 1.1
10.57k stars 299 forks source link

Ligatures and font-variant-ligatures settings #588

Open lostsatellites opened 1 year ago

lostsatellites commented 1 year ago

It seems that the ligature settings in CSS are limited. I'd expect the symbol changes to fall under font-variant-ligatures: discretionary-ligatures and not normal or common. Would it be possible to have more control of the ligatures in CSS?

See https://www.quackit.com/css/css3/properties/css_font-variant-ligatures.cfm for more information about the different types of ligatures.

lostsatellites commented 1 year ago

I've created this test to show how some settings have no effect. https://codepen.io/lostsatellites/full/wvxaWVd

philippnurullin commented 1 year ago

Hi @lostsatellites Thanks for the feedback. We will think about it. Right now I don't see how it will benefit the font or the user experience. Maybe you can add more examples and explain why you think it's important?

lostsatellites commented 1 year ago

@philippnurullin symbol changing ligatures would be something I'd want to control separate from common ones that relate more to text character combinations. For example, I'd expect to control the combination of "fi" independently of something like "->" turning into "→".

It's not a huge issue, nor is it inconsistent with some other mono typefaces, but just a more granular way to control the different types of ligatures.

sigtm commented 1 year ago

I second this. On the website, there are two separate use cases outlined for ligatures:

https://www.jetbrains.com/lp/mono/#ligatures

  1. "To reduce noise by merging symbols..."
  2. "To balance whitespace"

I love the ligatures that fall under #2, while the ones that fall under #1 are obviously more controversial to a lot of people.

It also prevents me from using it for apps and docs at work. Many of our end users are inexperienced with code and need to be able to copy and compare code from elsewhere and not wonder if their code is the same, or how to create a magic double arrow that's nowhere to be seen on their keyboards.

I would imagine this applies to lots of websites that would love to use JetBrains Mono, but need code snippets to be unambiguous to their users. Of course we can just disable ligatures completely, but it's a shame to miss out on objectively useful ones like ::, ..., etc.