-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ligatures #25
Comments
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
so that all glyphs still have the same width. |
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 #25 (comment) |
@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 |
👍 |
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, <= 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 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 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! |
@plgruener I think the ~ will get too condensed + it looks ok now because it's not "end-to-end" so it's easier to tell them apart if there are many |
Yeah, priorities! 👍 @ ~~ I just wanted to throw in the idea. |
It's how it's designed "notequal + type" "≠=" Any other ideas as to how it could/should look? |
@cabralRodrigo yep, I deliberately didn't do like e.g. fira mono because I don't want there to be any confusion between !== and != |
@larsenwork Thanks for your time anyway :) |
In gEdit ">==>" is rendered like a " ==>" (with leading space) : not that I know of programming language that uses it. |
Also "foo <- bar" is rendered as "foo - bar" |
Correttion on the previous comment, regarding "foo <- bar". It renders incorrectly with the Retina face but renders correctly with the Regular one. ">==>" renders incorrecly in both of them |
@luben cheers, "<-" is fixed in next update |
@larsenwork The Semantically, identity equals is a three line equals sign (≡) and with a strikethrough it would be equivalent to If keeping the current one is something you feel strongly about, could the more semantically correct version perhaps be available as an optional font feature? |
I agree with @blixt. The first time I saw that |
@blixt a good idea, I will look into it this christmas 👍 |
A belated note of thanks for this idea. That's how I did it in https://github.com/marnen/borg-sans-mono, and I think your work was where I found the technique. |
@marnen cheers, I've recently changed my opinion about this a bit though so I think I'll make more ligatures that span multiple letters 🤷♂️ 😉 |
@larsenwork Does that mean that you're now doing something like this? sub a_b.left_half b' by a_b.right_half
sub a' b by a_b.left_half (If you're curious, here's what I did: https://github.com/marnen/borg-sans-mono/blob/master/BorgSansMono.fea.) |
@marnen essentially yeah, because more and more editors and terminals support this kind of ligatures now (didn't do that when I created Monoid) Thanks for the link btw 👍 |
Right. I don't especially like the idea of the left and right halves being separate glyphs in the font, so I probably wouldn't do it that way unless there were some overwhelming advantage. |
@marnen they actually aren't in Monoid either — if it's a ligature that spans three letters then the first two are substituted to empty letters and the third one has the entire ligature. But it's complicated to maintain so normal ligatures is obviously they way to go now that editors support it. |
Does that work in a monospaced font, though? I wouldn't expect it to, at least not with proper caret positioning, hence the space trick that I use in Borg Sans. |
that's how all my "ligatures" have been created so far but it's annoying having to substitute with 3 characters instead of just one. |
Like e.g. https://github.com/tonsky/FiraCode
I'm still trying to figure out how best to solve it technically though
The text was updated successfully, but these errors were encountered: