source-code-pro icon indicating copy to clipboard operation
source-code-pro copied to clipboard

Is any chance to support ligatures?

Open zkcloud opened this issue 3 years ago • 24 comments

Recently, found that ligatures in code is very useful, it's more readable and friendly.

So, if ,is any plan?

zkcloud avatar Apr 12 '21 04:04 zkcloud

I have thought about it a bit but as I don’t use any languages where for me ligatures would be particularly useful, it's hard to know which actually help improve legibility and which are simply stylistic preferences of individual coders. Since you are proposing this feature, can you please give me more context? what language are you using? which ligatures do you find particularly useful? having a better understanding of this type of information would make it more likely for me to include coding ligatures sooner rather than later.

pauldhunt avatar Apr 12 '21 04:04 pauldhunt

@zkcloud You can download a patched version of this font that includes ligatures from the Ligaturizer project:

https://github.com/ToxicFrog/Ligaturizer/releases/tag/v4

jonesnc avatar Apr 22 '21 15:04 jonesnc

@jonesnc Based on the terms of the Source fonts license, will you please also change the name of the patched version to NOT use the name Source? the license allows for modification and redistribution, but retains the name Source Code for Adobe’s official version. I’ll post this comment also on the Ligaturizer project page.

pauldhunt avatar Apr 22 '21 22:04 pauldhunt

This is probably a duplicate: https://github.com/adobe-fonts/source-code-pro/issues/198

DarrienG avatar Apr 26 '21 18:04 DarrienG

I have thought about it a bit but as I don’t use any languages where for me ligatures would be particularly useful, it's hard to know which actually help improve legibility and which are simply stylistic preferences of individual coders. Since you are proposing this feature, can you please give me more context? what language are you using? which ligatures do you find particularly useful? having a better understanding of this type of information would make it more likely for me to include coding ligatures sooner rather than later.

I use Java more. A few of the usual ones will suffice. Like, ==, !=, ===, >=, <=, ->, :=, <!--. You may refer to JetBrains Mono, as a reference. But I still used to Source Code Pro. If it's supported, I'm sure most people would be very happy. :)

zkcloud avatar Apr 29 '21 12:04 zkcloud

Generally, in most languages, these would be enough:

zkcloud avatar Apr 29 '21 16:04 zkcloud

I assume the above is a screenshot of Jetbrains font test scratch pad with the following non-ligatured characters:

abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
 0123456789 (){}[]
 +-*/= .,;:!? #&$%@|^

<!-- -- != := === >= >- >=> |-> -> <$>
</> #[ |||> |= ~@

jwkohnen avatar May 11 '21 08:05 jwkohnen

@jonesnc Based on the terms of the Source fonts license, will you please also change the name of the patched version to NOT use the name Source? the license allows for modification and redistribution, but retains the name Source Code for Adobe’s official version. I’ll post this comment also on the Ligaturizer project page.

I'm not a maintainer on that project. I was merely linking to it in an effort to be helpful.

jonesnc avatar May 11 '21 16:05 jonesnc

Actually, the name of the patched font is LigaSrc. Is Src different enough from Source?

jonesnc avatar May 12 '21 20:05 jonesnc

@jonesnc Yes, I think so. Thanks for reporting back.

pauldhunt avatar Jun 30 '21 06:06 pauldhunt

Then I wonder if you are going to add the ligature feature to the font.

yvvt0379 avatar Jul 02 '21 15:07 yvvt0379

@CodeCrazy-ywt 🚧

pauldhunt avatar Jul 06 '21 09:07 pauldhunt

But I just don't know what you mean by just an emoji...😟Could you explain your ideas more clearly?

yvvt0379 avatar Jul 06 '21 10:07 yvvt0379

@CodeCrazy-ywt coding ligatures are under construction.

pauldhunt avatar Jul 06 '21 10:07 pauldhunt

OK, I see. Best news I've ever heard of! Big thanks!👍🏻

yvvt0379 avatar Jul 06 '21 11:07 yvvt0379

@CodeCrazy-ywt just for my info, which set of ligatures in particular are you wanting to see supported?

pauldhunt avatar Jul 07 '21 01:07 pauldhunt

You can refer to Fira Code or Jetbrains Mono as a reference.

yvvt0379 avatar Jul 07 '21 02:07 yvvt0379

Do you know the Hasklig? Is one of the most famous font with ligatures for coding. It's literally the Source Code Pro, but with ligatures added. The repository is here in GitHub.

Source Code is my favorite monospaced font, and i use Hasklig as well.

Scemist avatar Jun 11 '22 21:06 Scemist

But, we need general, not specific to just one programming language. Hasklig is specifically designed for Haskell language.

yvvt0379 avatar Jun 12 '22 04:06 yvvt0379

I see that in the latest release also there is no ligature support. Is this issue being tracked in any other release?

cc: @pauldhunt

yashLadha avatar Apr 06 '23 12:04 yashLadha

@pauldhunt Sorry to ping you, but is there an update on this? Or any other action items we are currently working on?

Again, I appreciate all the work that you and your team have put into this project. 😄

yashLadha avatar Feb 07 '24 07:02 yashLadha

If this font adds support for ligatures at some point, may I suggest being conservative? Many fonts that support ligatures go crazy, supporting all kinds of weird glyph pairs that aren't relevant for the most popular languages, and whose aesthetics are questionable. I'm talking about stuff like #{. (Fira Code is the prime example.)

Also, I strongly dislike the tendency of fonts to join a pair of underscores __ into one "mega-underscore". IMO this doesn't look better; it just obfuscates the number of underscores. Most fonts don't join -- into a "mega minus", and it would be preposterous to suggest joining .. into a "mega dot", so I don't see the rationale for joining underscores together. (In most programming languages, underscores are used in the same manner as a letter; they aren't used as underlines.)

In comparison, ligatures such as <= (inequality) and -> (right arrow) are much more justifiable, because they replace "ASCII art" with a semantically-correct symbol.

If others are interested in having access to the long tail of questionable ligatures, I would propose hiding these behind stylistic sets. This would allow people to choose the combination of ligatures that they like best.

Also, I'd love to see "texture healing" (discussed here) as a stylistic set.

nmsmith avatar Mar 29 '24 08:03 nmsmith

@yashLadha this project is currently on hold while I finish up some other projects. sorry for the delay.

pauldhunt avatar Apr 02 '24 02:04 pauldhunt

How about if we slip you a dollar? ;)

Merovex avatar Apr 29 '24 09:04 Merovex