i-tu / Hasklig

Hasklig - a code font with monospaced ligatures
SIL Open Font License 1.1
5.59k stars 153 forks source link

Requesting even more ligatures #12

Open Fresheyeball opened 9 years ago

Fresheyeball commented 9 years ago

I would really love to see all of the following

! @ # $ % ^ & * | ? . , / \ " : ~

as ligatures with all of the following

<.> <. .>

so...

<!> <! !>
<@> <@ @>
<#> <# #>
<$> <$ $>
<%> <% %>
<^> <^ ^>
<&> <& &>
<*> <* *>
<|> <| |>
<?> <? ?>
<.> <. .>
</> </ />
<\> <\ \>
<"> <" ">
<:> <: :>
<~> <~ ~>

as well as the rest of the common binders:

>=> <=<
<**>
>>^ ^<<
<<^ ^>>

It would also be nice if \ without < or > would be displayed as λ. So...

\x -> x + 1
--becomes
λx -> x + 1

Lastly (I promise), it would be nice to see forall get displayed as giant .

soenkehahn commented 9 years ago

The giant being six characters wide? ;)

bananu7 commented 9 years ago

Lambda can't be done reliably because it's a valid identifier IIRC.

ahammel commented 9 years ago

Lambda and forall (and compose) are better handled by a concealer in the editor than a typeface, IMHO.

+1 to all the rest, though.

i-tu commented 9 years ago

Good ideas here, though it will take time to work through them.

Some of these are already done for an upcoming version. Contextually changing \ to λ is one of those things I'm not entirely sure would be possible, since it would also be necessary to take into consideration the use of \ in strings as an escape character.

Fresheyeball commented 9 years ago

@ahammel what is a concealer?

i-tu commented 9 years ago

I suppose he meant something like this.

@Fresheyeball Can you explain briefly the typical meaning of using > or < with another symbol, say #? I'm tempted, for example, to replace ~> with a squiggly arrow, but I don't know if that would make any sense semantically.

ahammel commented 9 years ago

@Fresheyeball

What @i-tu said. It's an extension of syntax highlighting that replaces ascii characters with unicode in a context-sensitive way. Recent versions of Vim and Emacs can do that, and probably lots of other editors as well.

I think it makes more sense to use that feature when replacing characters one-for-one than to bake the replacements into the font.

Kronuz commented 9 years ago

What about ligatures for != and !== so it can be used in a number of other languages as well (JavaScript, Python, C/C++)

semaperepelitsa commented 9 years ago

@ahammel, could you tell me how are these extensions called? I can't find anything. Are they built-in?

ahammel commented 9 years ago

@semaperepelitsa: in vim, the feature is called 'conceal', and it's built in to recent versions. :h conceal will give you some general information. Extensions like vim2hs make extensive use of concealment for pretty-printing lambdas and composition, and for a few other things like hiding long {-# LANGUAGE #-} pragmas unless the cursor is on the line.

I believe emacs's font-lock mode can do similar things, but I can't dig up the right keywords at the moment (I'm not an emacs guy).

stebet commented 9 years ago

+1 for Kronuz suggestion.

I'd love to see ligatures for != >= (as the greater or equal to) and <= (as less than or equal to)

GauthierPLM commented 9 years ago

Same as @stebet, they are common in other languages and lot of people would appreciate it I think.

matthew-dean commented 9 years ago

What about some of the ligature examples in FiraCode? https://github.com/tonsky/FiraCode

I would be using it, except I think Source Code Pro is a better source font. And it supports ligatures for languages like JavaScript and PHP.

i-tu commented 9 years ago

Some of these glyphs will be included in 1.0, but I won't make any promises which ones.

dorian-marchal commented 9 years ago

What about ligatures for != and !== so it can be used in a number of other languages as well (JavaScript, Python, C/C++)

:+1:

Same thing for >=, <= and := (plpgsql)

yshavit commented 8 years ago

<?> is very common in Java, and would be great to ligaturize.

clayrat commented 8 years ago

+1 for <#>

laurentpayot commented 8 years ago

I created #72 for LiveScript --> ~> ~~> <-- <~ <~~ !-> !-> <-! <~! etc. arrows.