adobe-fonts / source-code-pro

Monospaced font family for user interface and coding environments
https://adobe-fonts.github.io/source-code-pro/
SIL Open Font License 1.1
19.73k stars 1.62k forks source link

question: how much interest is there in coding ligatures a la Hasklig for SCP? #96

Open pauldhunt opened 9 years ago

pauldhunt commented 9 years ago

I guess this is an invitation for +1’s, even though I generally dislike them. GitHub should have a polling feature, hmmmmm...

Hasklig

Also, if you have any insights about what works and what doesn’t in terms of coding ligatures, please post here.

tommythorn commented 9 years ago

+1 That would be so awesome! I would REALLY appreciate this. EDIT: Hasklig support in particular, not just ligatures in general.

XenHat commented 9 years ago

Very much so. I did not know what this was, I searched, found it and fell in love. +1 for Hasklig-style ligatures. P.S. how did I survive coding without this until now?

artemgordinskiy commented 9 years ago

My primary IDE doesn't support these at the time, but in hopes that it will — +1 :smile:

mtelesha commented 9 years ago

This would be great also for me. Thank you in advance. +1

artcs commented 9 years ago

I don't like the idea, because in a monospace font I prefer to see exactly what I type. Especially if you use the font for documentation. So my vote is to keep a saparate Hasklig fork for those who really want to use it.

fitojb commented 9 years ago

I’d also rather keep those decorations off the official coding fonts… Maybe shipping them in separate “Alt” fonts?

ghost commented 9 years ago

+1 if there is a switch for this feature or another font file is provided.

ldmldmldm commented 9 years ago

@artcs Just to be clear, all pauldhunt is asking is if we want extra characters included in the official font. The automatic substitution of => to ⇒ is not a feature of the font, rather is requires a plugin for your text editor.

So I don't see why the inclusion of some extra ligatures in the font will be a concern (except for maybe size) as you don't have to ever actually use them and they are not substituted into your code by default.

artcs commented 9 years ago

@ldmldmldm You can add any glyph you want of course. It just shouldn`t be a default ligature feature in the font.

ldmldmldm commented 9 years ago

@artcs Well arguably it's a font designed for source code, so it kinda makes sense for it to posses programming relevant ligatures.

Maybe I miss understand the difference between ligatures and glyphs, but from my understanding '&' is a ligature for 'and', yet you are not forced to use either one, '&' is just another glyph right?

Or is ampersand a unique example (if it is more than just an extra glyph then I could understand having a version with and a version without)?

ruedigerha commented 9 years ago

I'd love to see these ligatures, too :+1:.

pauldhunt commented 9 years ago

what i’d like feedback on is which ligatures would be most useful. for those of you that are interested, if you could perhaps make a ranked list that would be enlightening to me. thanks.

ruedigerha commented 9 years ago

For me, a useful "very basic" set would be: /= == ++ :: -> => && || Very close after that: <- >> >>= (<< and =<< might be placed here, too, otherwise it might look strange to have ligatures for one "direction" but not the other if both are used in a piece of code, I personally just don't need them that often) Next up: <> <$> <+> <*>

I'll leave it to others to be greedy and request more :).

tommythorn commented 9 years ago

That's a good starting point, but certainly <- is in the critical list as it's essential syntax for monad compressions (do x <- f y; ...). (OT: but the /= looks rather ugly in Hasklig).

artemgordinskiy commented 9 years ago

Not sure if all of these are doable, but in my case the ranked list would look as follows: -> => && || :: === == [] ++ -- __

theevangelista commented 9 years ago

Definitely these -> <- :: >>= <<= => && ||

miguelsousa commented 9 years ago

An image I came across at http://sublimetext.userecho.com/topic/433445-/#comment-1286505 pragmatapro

bklebe commented 9 years ago

PragmataPro is a fantastic professional font. I used it for all of my Haskell programming before switching to SCP. I would love to see some of the ligatures included in a future release.

zengabor commented 8 years ago

Source Code Pro already looks great! I would only use ligatures if they are still recognizable, that is, close to the original character sequence. So I am mainly looking for fine-tuned kerning, better positioning and subtle beauty. :)

Anyway, here's what I often use (mainly in JavaScript, Go & templating):

// [] () {} {{ }} {{.}} == === != !== <- << ... := += -= <= >= ++ -- || && "" ''

i-tu commented 8 years ago

@pauldhunt , I would be more than happy to collaborate if you decide to make coding ligatures part of SCP. +1

There's work to be done in improving the coding ligature user experience, particularly in allowing the editor or user to pick the correct ligatures to show according to programming language. I don't know if this could be done with OpenType, or if several versions of the typeface need to be distributed for each programming language. Honestly, I don't know what OpenType is practically capable of. Some discussion: https://github.com/i-tu/Hasklig/issues/21

miguelsousa commented 8 years ago

Another coding font with ligature support: Fira Code (fork of Fira Mono)

srl295 commented 8 years ago

I'm -1 on this if it is on by default, part of the reason I use SCP everywhere is that I can tell what (printable) characters are there in my source. If these don't affect normal use in a terminal or other text editor, then I'm ±0 on it.

mohsen1 commented 8 years ago

I like ligatures support but I would like to see it as an option and not default.

joewalker commented 8 years ago

It seems that this is something that editors would have to opt into. (See http://blog.atom.io/2015/10/29/atom-1-1-is-out.html) - if that's right there doesn't seem much of a reason not to do this.

Monoid (http://larsenwork.com/monoid/) gets something right that Hasklig doesn't, editor support for placing the cursor in the middle of a ligature. From my use, it feels as though Hasklig uses a single wide ligature in place of the first character and zero-width blanks for the remaining characters, where Monoid splits the display evenly out among the characters.

I'm not a fan of the way Monoid looks, but it feels as though it's done the ligatures a better way. That said, Hasklig is still a step up on no ligatures at all.

benjamin-rood commented 8 years ago

Please do this. The plug-in support method to replace key combinations with ligatures is awfully broken, it would be much better as an extended version of an existing font.

pauldhunt commented 8 years ago

Does anyone want to take on the task of compiling a set of ligatures to be added to a future version of SCP? I’m afraid I do not want to sink the time into sussing out all the useful combinations. Ideally, a table that shows what ligatures would be needed for which programming languages would be best so that I can try to prioritize in what order to add things. Thanks.

sladiri commented 8 years ago

Hi, I hope you can use a public spreadsheet. I am primarily a JavaScript developer, so I added ligatures for this language. public google drive spreadsheet

harrisonrodgers commented 8 years ago

Hi. I was thinking of analyzing some large repositories of code in various languages to estimate the percentage use of the various ligatures in each language.

pauldhunt commented 8 years ago

@sladiri a very nice start! thanks for sharing.

@harrisonrodgers that would be greatly helpful. :smile:

srl295 commented 8 years ago

VS code insider builds seems to support ligatures as in Hasklig => https://github.com/Microsoft/vscode/pull/1510 - and, as noted above, they are opt-in.

harrisonrodgers commented 8 years ago

Hi. Here are my results after analyzing a pile of repositories. Currently it is helpful to determine the most common ligatures for each language, but not to compare languages.

pauldhunt commented 8 years ago

@harrisonrodgers this is somewhat interesting, are the number simply the number of times found in some unspecified amount of code? this data could be more interesting if it calculated the frequency as a percentage of the total amount of code queried.

harrisonrodgers commented 8 years ago

Yes, currently the numbers are simply the count of occurrences in whatever github repository I scanned. Rather than providing simply a ranked order of ligatures for each language I thought it might be useful to have the count to know at what point the ranked order starts to become meaningless.

Right now the results are only useful to determine, for example, what ten ligatures could be implemented for each language to have the most noticeable impact in each.

loxy commented 7 years ago

This would be great. I like SCP very much...

jianghaizhu commented 7 years ago

+1 ! I would love to see that. My question is what would be the difference comparing to Hasklig? Hasklig is basically SCP plus ligatures.

ben3000 commented 7 years ago

+1 from me, and Intellij IDEA now makes it possible to turn these on with a checkbox in preferences.

pauldhunt commented 7 years ago

@jianghaizhu so should we just leave the ligatures to Hasklig and not incorporate into SCP?

jianghaizhu commented 7 years ago

@pauldhunt If the implementation is the same as Hasklig, what is the point? However, personally I think the way MONOID did is better. An article by the author of MONOID explained some of the differences. I like the Editability feature very much. Of course you can design your own implementation.

srl295 commented 7 years ago

@pauldhunt I'm kind of +0 on this (but downloading haskelig to try)… since it's a fork, and ligatures are optional, would it be an option to merge hasklig back in? edit ok, ligatures do seem to be nice. If they are always on in safari though as monoid says, then that would not be good to include them.

jianghaizhu commented 7 years ago

Another problem in Hasklig is that it lacks the ligatures for <= and >= where most languages use them as less or equal and larger or equal. It is really inconvenient for people who are not using Hask.

vikky49 commented 7 years ago

+1 and all the ligatures that are supported by Fira code would make it awesome .especially != , => , ->, ++ , -- , <> and few more that already there in Hasklig and FiraCode

vikky49 commented 7 years ago

Agree with @jianghaizhu on this ..It would be really nice if we can get the following three atleast

<= and >= and != .As they are commonly used in all the programming languages . Fira code seems to support them

mpost commented 7 years ago

With all the IntelliJ based IDEs supporting ligatures nowadays there is definitely interest in them. With the recently launched AndroidStudio 2.4 preview, AS also supports ligatures so all the Android developers could benefit as well.

glennkidd commented 7 years ago

This would be great, most of the editors/IDEs I use can utilize these now.

hoffmael commented 7 years ago

+1

killua99 commented 7 years ago

+1 do it! FiraCode is a temp solution, but Source Code Pro ligatures is the way!

wavded commented 7 years ago

I'm with @killua99, using FiraCode but really wishing it would come to Source Code Pro!

dtpmalone commented 7 years ago

+1

Vinnie1991 commented 6 years ago

I would like to! I'm now using FiraCode for the ligatures, but I love (and miss) Source Code Pro!

jianghaizhu commented 6 years ago

@pauldhunt This seems to be a very desirable feature for SCP based on the reactions here. Any thoughts about if you would work on this?