source-code-pro
source-code-pro copied to clipboard
question: how much interest is there in coding ligatures a la Hasklig for SCP?
I guess this is an invitation for +1’s, even though I generally dislike them. GitHub should have a polling feature, hmmmmm...
Also, if you have any insights about what works and what doesn’t in terms of coding ligatures, please post here.
+1 That would be so awesome! I would REALLY appreciate this. EDIT: Hasklig support in particular, not just ligatures in general.
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?
My primary IDE doesn't support these at the time, but in hopes that it will — +1 :smile:
This would be great also for me. Thank you in advance. +1
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.
I’d also rather keep those decorations off the official coding fonts… Maybe shipping them in separate “Alt” fonts?
+1 if there is a switch for this feature or another font file is provided.
@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.
@ldmldmldm You can add any glyph you want of course. It just shouldn`t be a default ligature feature in the font.
@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)?
I'd love to see these ligatures, too :+1:.
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.
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 :).
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).
Not sure if all of these are doable, but in my case the ranked list would look as follows:
-> => && || :: === == [] ++ -- __
Definitely these -> <- :: >>= <<= => && ||
An image I came across at http://sublimetext.userecho.com/topic/433445-/#comment-1286505

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.
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):
// [] () {} {{ }} {{.}} == === != !== <- << ... := += -= <= >= ++ -- || && "" ''
@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
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.
I like ligatures support but I would like to see it as an option and not default.
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.
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.
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.
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
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.
@sladiri a very nice start! thanks for sharing.
@harrisonrodgers that would be greatly helpful. :smile:
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.