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

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

Open pauldhunt opened this issue 10 years ago • 67 comments

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.

pauldhunt avatar Jun 09 '15 18:06 pauldhunt

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

tommythorn avatar Jun 09 '15 18:06 tommythorn

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?

XenHat avatar Jun 09 '15 19:06 XenHat

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

artemgordinskiy avatar Jun 10 '15 07:06 artemgordinskiy

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

mtelesha avatar Jun 11 '15 11:06 mtelesha

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.

artcs avatar Jun 19 '15 09:06 artcs

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

fitojb avatar Jun 19 '15 12:06 fitojb

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

ghost avatar Jun 19 '15 19:06 ghost

@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 avatar Jun 19 '15 20:06 ldmldmldm

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

artcs avatar Jun 19 '15 23:06 artcs

@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)?

ldmldmldm avatar Jun 20 '15 03:06 ldmldmldm

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

ruedigerha avatar Jul 07 '15 10:07 ruedigerha

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.

pauldhunt avatar Jul 07 '15 16:07 pauldhunt

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 :).

ruedigerha avatar Jul 07 '15 18:07 ruedigerha

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).

tommythorn avatar Jul 07 '15 22:07 tommythorn

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

artemgordinskiy avatar Jul 08 '15 03:07 artemgordinskiy

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

sleepiecappy avatar Jul 08 '15 05:07 sleepiecappy

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

miguelsousa avatar Jul 08 '15 10:07 miguelsousa

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.

bklebe avatar Jul 08 '15 12:07 bklebe

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):

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

zengabor avatar Jul 19 '15 20:07 zengabor

@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-tu avatar Sep 07 '15 15:09 i-tu

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

miguelsousa avatar Sep 28 '15 06:09 miguelsousa

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.

srl295 avatar Sep 28 '15 21:09 srl295

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

mohsen1 avatar Nov 06 '15 17:11 mohsen1

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.

joewalker avatar Nov 12 '15 10:11 joewalker

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.

benjamin-rood avatar Nov 13 '15 04:11 benjamin-rood

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.

pauldhunt avatar Jan 08 '16 03:01 pauldhunt

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

sladiri avatar Feb 10 '16 16:02 sladiri

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.

harrisonrodgers avatar Feb 10 '16 23:02 harrisonrodgers

@sladiri a very nice start! thanks for sharing.

@harrisonrodgers that would be greatly helpful. :smile:

pauldhunt avatar Feb 11 '16 00:02 pauldhunt

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.

srl295 avatar Feb 16 '16 21:02 srl295