Open larsenwork opened 9 years ago
So I think I've figured out how to do some of it. I'm trying to keep this a strictly monospaced font so hack job like combining two characters in to one wider character isn't kosher. Instead I'm thinking about using contextual substitution like this
feature calt {
sub less hyphen' by ligaarrowleft;
} calt;
feature calt {
sub less' ligaarrowleft by space;
} calt;
so that all glyphs still have the same width.
I've added these so far but having some issues with "calt" and Atom (editor I'm primarily using)
I wonder if this is going to work in Visual Studio on Windows. Pragmata Pro and Hasklig ligatures seem to work there. In case they work, it would be great to have =>, // and /// for C# in addition to the ones above. Also, for F# (which is cross-platform) |>, <|, <||, <||| (* *), (| |), ::, :>, :=, <<<, >>>, [| |], [< >] etc. would be great. The full list: https://msdn.microsoft.com/en-us/library/dd233228.aspx
@glebd can you check the latest version and see if it works on windows with these ligatures https://github.com/larsenwork/monoid/issues/25#issuecomment-111757957
@glebd should => be an arrow like this: ⇒ or what is it used for? I have added // and /// (not pushed yet)
Yes, I think so: => turns into ⇒ across 2 character widths. Thanks!
@glebd cheers, did you get to test it on Windows?
Not yet, will do next week
:+1:
Compared to
Niiice
@glebd I don't know haskell but is this something I should fix (comment about >→) https://news.ycombinator.com/item?id=9718099
And are there other similar issues?
These are lovely!
I'm writing in a language where => and <= are both arrows, and at the moment it's a bit confusing as:
Unfortunately, some of this is language and context dependent. For me there are times when <= is an arrow, and times when it is less that or equal to.
Could the download page (which is great, btw) allow a choice of ligatures as well as just on and off?
@mo-seph cheers, => should be a ligature. What editor + OS are you using?
<= vs ≤ could be a choice, the easiest (and best thing) would be to add it as an stylistic alternate, but that only works if your editor allows you to add your own stylesheet.
It could also be a downloadable choice but problem is we're currently generating all possible versions (current 3200) so adding it as downloadable choice would require it replacing one of the existing options.
What language uses <= as arrow?
An obscure one ;) It's called LCC, and represents messages sent to ( => ) and from ( <= ) agents (https://bitbucket.org/mo_seph/scalsc/wiki/Representing%20Interactions)
Here's a screenshot, using Eclipse on OSX 10.10
The <= on line 7 has been changed to leq as expected, the => on line 8 is un-liga'd, and the <- on line 9 is great ;)
(BTW, these arrows are clearly an edge case, and I suspect your approach works for 99% of the time ;) )
@mo-seph => should be a ligature. What editor + OS are you using?
Eclipse, OSX 10.10.4
Ligatures are not working here :( (IntelliJ OSX 10.10.4)
@larsenwork It seems like Java doesn't support ligatures, at least not on OS X. Eclipse and IntelliJ are both Java-based.
EDIT: Turns out that IntelliJ's rendering engine doesn't support ligatures, Eclipse does in fact.
Crud, I guess that holds true for PHPStorm 9 as well (built on Java).
@mikebronner Since it is a derivative of IntelliJ, I'd say that's safe to assume.
@mikebronner @chase Eclipse is supporting ligatures, just checked. IntelliJ doesn't - they've changed rendering engine. They are working at this. SublimeText too.
@rkurbatov Thanks for looking into it!
Please add your findings to the readme #67
@glebd About the // ligature: would it make sense to only activate it if it's preceded/followed by a "space" ?
I want to turn it off for at least http:// which currently look a bit odd with the ligature
Not really, as C-like languages use // for comments which may start at the beginning of the line.
@glebd space after?
Hmm, some people don't leave space after //comments.
Hmm...they should, looks messy:) Well I can easily "filter out" http:// so I'll just take that approach instead.
Cool.
suggested/requested ligatures (mostly from Java and Groovy, see full list here ) ++ (maybe same as with == and --) operators += -= = /= %= * *= =~ ==~ <=> "Spaceship-operator", currently this is broken into <= and > for comments (without the spaces) / * , / * * , / (similar to //) also cool would be ?: ?. !! *. ..<
One could do the same as == and -- for ++ but not sure. Plus signs have a vertical line making it easy to tell them apart so not sure the ligature is necessary Spaceship: We could go crazy and do something like this but I'm more inclined to do something like this As for the operators we could do narrower +-= signs but not sure it's needed
Spaceship: that indeed looks crazy somehow :D But I'd also go with the (sane) second version. ++ and \ : right, probably not needed. But it looked slightly strange because all others (==, --) have these little gaps.
Same goes for *= %= etc. Not really necessary, but I think a little gap (narrower = signs) would make it prettier (just my personal opinion, you're the font expert ;)
Been looking at it and I might just change the default =+- to the narrower versions
So it'd be like so:
Well, that'd save you some work with the ligatures. However, I don't quite like that asymmetrical plus sign, looks a bit odd to me. I don't know about your build process, but maybe you can offer an alternate version with narrow +-= signs, so some more people can test it (at different sizes).
Yeah...I actually like the narrower equalsign as default and then keeping the + and - unchanged but have the ligature for --
Yes, sounds like a good solution. Do the unligatured versions of >= => etc. still look good with the narrow equal-sign?
@plgruener I think so - they look like the spaceship (3rd pic): https://github.com/larsenwork/monoid/issues/25#issuecomment-125159686
Ah right. Looks great. (Except the -= has some unfamiliar proportions, but one should get accustomed to it pretty fast.)
The - in -= could be a hybrid between - and the - in --
Moving the first asterisk to the left and the second up and to the right to make more room for the comment
@plgruener what are ?: ?. !! *. ..<
used for? I need some context examples to see what ligatures (if any) will be fitting.
Keep in mind one often formats comments like this:
/**
*
*/
So I don't know about left/right shifting the asterisk…
It will look a bit weird but the gain in /Comment/ cases should be worth it.
Well, actually comments like /* ... */ in one line are very discouraged (at least in Java & co.). But we could try it first.
In css they're everywhere :)
I actually think it works ok:
Like e.g. https://github.com/tonsky/FiraCode
I'm still trying to figure out how best to solve it technically though