Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

81–90 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#81
post #12

Earlier quoted context omitted.

I happen to like them, but the only one I'd put forth as a definite improvement is that JS/PHP's triple-equal === operator gets turned into three horizontal lines that take up more vertical space than the double-equal does. That can be the cause of subtle bugs, so I think making that distinction more obvious is a win.

Personally, I'd probably find it easier to visually mix up the two-line and three-line versions than to mix up the two-char and three-char versions when skimming code - but to each their own.

You still get the same three-char width, the ligature just makes it three lines tall, also.

Re: Monospaced Programming Fonts with Ligatures

#82
post #66

Earlier quoted context omitted.

Why would it be sarcastic? The triple bar is also the operator for logical equivalence, which I guess is where the font authors got it.

I assume potential sarcasm would be related to the difficulty differentiating between similar symbols, based on length, with different lexicographic meanings. For example, dash vs endash vs emdash, etc: ‒ – — ― If those symbols were used in a programming language and had different meanings, differentiating quickly could be much more difficult than seeing the difference between -, --, ---, and so on at a glance.

But the point of the new triple-equals ligatures is that they're no longer only differentiated by length; they have three bars instead of two, as well.

Re: Monospaced Programming Fonts with Ligatures

#83

I figured I'd leave this here: I rebuild Iosevka with the Haskell ligature mode on default. I use this for a lot of things (although recently it's gotten no use as I've been working in Emacs). Since it's a bit of a process to rebuild Iosevka, I just bundled the artifacts: https://goo.gl/gsFm8P (Please excuse the redirection, this got a LOT of downloads and I have a big azure credit so I hosted it there and youw ould…

note you can kinda use ligatures in emacs by doing something like

https://gist.github.com/pcstl/2d9b28a74d6f9254586c2d58d54590...

Re: Monospaced Programming Fonts with Ligatures

#84
post #15

I like switching fonts every couple of years just to keep it fresh. My font right now is Iosevka: https://be5invis.github.io/Iosevka/ A font generated from its source code. You can build your own variant. It has ligatures as well. I like that it’s not as wide as many other monospace fonts.

I love Iosevka Term! My only issue with it is that there seems to be a problem in Emacs 25 that makes the screen flicker once in a while when I use it. For Emacs, I like to use Fantasque Sans Mono, another amazing font.

Re: Monospaced Programming Fonts with Ligatures

#85
post #80
post #76

Honeslty, this should be handled by the language itself. If a language supports unicode, why not support ≠ for not-equals instead of "!="? Then provide a pre-processor that will replace all your ugly "!=" with the correct mathematical symbol.

agree except for the pre-processor part which should belong to the editor macro or keyboard shortcut space.

Well, providing the replacement engine as part of the language compiler package as a simple command-line tool you can hook into your editor of choice as a hotkey so I can say "replace all the operators in this file with their appropriate mathematical unicode counterpart".

Re: Monospaced Programming Fonts with Ligatures

#86
post #66

Earlier quoted context omitted.

Why would it be sarcastic? The triple bar is also the operator for logical equivalence, which I guess is where the font authors got it.

I assume potential sarcasm would be related to the difficulty differentiating between similar symbols, based on length, with different lexicographic meanings. For example, dash vs endash vs emdash, etc: ‒ – — ― If those symbols were used in a programming language and had different meanings, differentiating quickly could be much more difficult than seeing the difference between -, --, ---, and so on at a glance.

> the difficulty differentiating between similar symbols, based on length, with different lexicographic meanings.

The very thing amk_ is praising is that this issue is fixed in both Fira and Monoid by the triple-equal being not just longer but represented using 3 horizontal bars rather than just 2.

Re: Monospaced Programming Fonts with Ligatures

#89
post #33

Apparently I'm one of the two users of proportionality spaced fonts for coding. I've used this now for five years and I don't understand why developers still see this need to code as if monospaced terminals is all that's available. Especially on large screens with high dpi it reads much faster. It also makes it less awkward to use editor unicode substitution for display purposes.

It could be a function of the kind of programming you engage in. When I write code that reads more like long-prose, then I do prefer proportionally-spaced fonts myself. This is generally characterized as code with a low density of variables and constants, and lots of control and data structure manipulation. However, when I write code with lots of objects, I tend to prefer monospaced fonts. This is because my personal…

Thanks for this interesting write-up on AST-based editors. Smalltalk has some of these ideas, and you might want to have a look at TexMacs (even though the project is abandoned). Like you, I feel that linear text-based editors are severely holding us back in communicating our intentions and inventions. I've had very similar ideas myself and even worked shortly on a Lisp which recursively forms an editor for itself (using a meta-object protocol).

Re: Monospaced Programming Fonts with Ligatures

#90
post #87

I switched to Source Code Pro font couple years ago and never look back. https://github.com/adobe-fonts/source-code-pro

As the very article notes, Hasklig is a fork of Source Code Pro with programmatic ligatures. In much the way Fira Code is a ligatured version of Fira Mono.
Post reply on HN