I'm a font-aholic and reading Hacker News, I get the impression I'm not the only one.
My first adventure down the font hole started with Bit Stream Vera Sans Mono followed by Source Code Pro. Stuck with Source Code Pro for many years and even today, not sure any other aliased font looks and works as well as Source Code Pro at almost every size, from the smallest onward. It just looks clean to me.
After reading on here how great it was, switched to Fira Code for a while. It was nice, but never blew me away. The ligatures were a nice change I guess.
Then I tried out Iosevka and was happy. Kept using it for a while.
Then it was Input Mono, again happy and used it for a while.
I was later introduced to Operator Mono and thought I had found code font bliss (pay).
Ended up going back to SF Mono (I'm on macOS) and feel content. Finally. Again. I don't think I'm switching anymore. I might try for a day or a few minutes something else, but I can't see myself sticking with it like SF Mono. It will have to blow my mind.
As an aside, I love no antialias Monaco at about 10 pt on hi dpi/retina displays (MacBook Pro 2017 and LG 5k with non-decimal scale, e.g. 2x). Something about it seems perfect to me. It usually seems to require special configuration and sometimes is difficult or not supported at all in many tools and editors, so I have stuck with SF Mono, typically 11 pt or 13 pt depending on the display and time of day and how much sleep I got.
> Stuck with Source Code Pro for many years and even today, not sure any other aliased font looks and works as well as Source Code Pro at almost every size, from the smallest onward. It just looks clean to me.
This has easily been my favorite font for a long, long time.
I know what you’re talking about. I have tried a seemingly endless number of fonts. I really liked Hack and IBM Plex Mono, especially the latter. For a short period, I even coded with F25 Bank Printer - what a fun!
Currently I use the Golang fonts (monospaced serifs).
Iosevka for me, you can custom build it with the letter designs you want, it supports ligatures and it's condensed without been cramped (also has Term, non-term and Slab variants in the same build).
It's replaced my mono font everywhere, Fira Code is lovely but it feels way too wide once you've used Iosevka.
The only font that comes close is Pragmata Pro but that's not free.
I paid for the original Pragmata font in 2004, and he has kept sending updates surprisingly often ever since. I suppose I upgraded to Pragmata Pro in 2011, so only 8 years of updates on that. Money well spent for 40 hours a week of use
I wasn't knocking Pragmata Pro and the dude has the right to charge for his work.
That said for my needs Iosevka and Pragmata are pretty much a dead heat and one is free and open.
If you prefer Pragmata then sure the the cost per hour over a decade is irrelevant (the same reason I pay out of pocket for intellij ultimate at work, work would pay for it but I use it outside of work and it's not worth the hassle).
I have never really liked any of the other popular coding fonts and it really comes down to one thing: They are all stupid sans-serif fonts.
I have found, ever since displays grew out of the garbage 100 dpi age, that serif fonts are vastly more enjoyable to look at and easier to quickly visually discern.
As a result, Iosevka Slab is basically the only code-optimized font I can even consider.
Beyond that, I prefer a narrower font for monospace text. Monospace is already such an awful layout for readability, but, making it narrower at least helps reduce the horizontal scan range without imposing insane limits like 72 character lines.
> Monospace is already such an awful layout for readability...
So why code in a monospaced font then? There's no rule that says you have to write code in a monospaced font. I've used proportional fonts for many years, and almost every programmer's editor supports them.
I'm currently using a slightly modified version of Trebuchet MS (I replaced the tilde with a better one). Another example is Input Sans, one of the three fonts today's thread is about.
Reasons: I haven't found a proportional code font I like very much and, more importantly, many—MANY—existing code files include text arranged with the expectation of monospace fonts and if you use proportional, they become a mess.
All respect to those who like proportional fonts, to each their own, but I think of code as a 2d grid.
Same reason I use syntax highlighting: color is another dimension that helps me see what I’m doing. This is particularly notable in Lisps, where turning on rainbow parens can be like switching on a light switch, immediately helping me understand the shape of the forms.
It seems the weirdest thing to me that fonts – especially monospaced fonts – vary by width.
I'm working on a forum redesign at the moment. Picking a font took a surprising while, because the font the forum had used – Source Sans Pro – is naturally narrow. Put something wider in, and it's entirely not the same.
I have, similarly, replaced monospaced fonts everywhere with Fira Code. Characteristically, Iosevka looks too narrow to me. :)
I think Mononoki has reasonably similar proportions to Source Sans (matches better than Source Code), and is pretty and highly legible. Only issue is "bold is taller than normal" and vertically misaligned parentheses.
I'm fond of Iosevka as well - but the downside to the narrow font is that it uses very slightly more vertical space than say Bitstream Vera Sans which is my other "go to" font.
As cool and readable as ligatures are in print design and typography, I find them to be unhelpful and even sometimes downright confusing when it comes to code. For me they violate a general (unspoken) principle of monospaced fonts, which is not just that each character is the same width, but that each character is discrete. It can be difficult to tell _how many_ characters the ligature comprises.
When do you need to tell discrete characters apart? Is it personal, rather than professional – something about the way things ought to be, from your perspective?
I find Fira Code to have too harsh serifs and unnecessary details like the open lowercase g. Given my love for Input, I emailed DJR (the designer) about including ligatures but he wasn't interested, so I drew a set of my own: https://pasteboard.co/HWhfhsE.png
You know what I never expect to do? Use a VPN just to access the websites my Internet provider is too slow to reach. Tried to do that with the link you posted, still to no avail.
Could you repost your image to, say, Imgur? I'd like to see how you'd implemented ligatures.
(Turned out I remember Input because I saw Output, a font by the same author, and thought "Oh, that's nice! I could use that on my webs-- oh, it's not cheap. Bugger".)
I'm not a programmer. I'm a writer and a designer. Coding is what I do when I don't do either – less as a hobby and more a way to vent my creative frustration.
Aesthetics is important to me. Being in an ugly environment brings me down. Fira Code brings positive aesthetics with it. And ligatures are cool.
I'm the kind of a person that does things simply because they're cool.
I used Fira because I felt the same about ligatures, until I found Hasklig. It has similar ligatures, but the overall font is better imo. https://github.com/i-tu/Hasklig
Oh god, that website though. How many CSS animations do I have to suffer through before it lets me scroll down to any actual information? Make it stop!!
Man, you weren't kidding! That is literally the most useless website I've ever seen. I spent over two minutes on it and still couldn't find a simple table of examples.
The examples on the IBM site had zeros without slashes or dots. And the character set showed a slashed zero exists, but it isn't the default zero. I believe you if you're using it, but I'm not sure where your dotted zero came from.
I've looked at it just now. Found it too... skrawny? The lines are too thin and too jagged – the latter probably a consequence of the former. You can see how it differs from other proposed fonts in this thread.
To be honest, I never understood all these discussion about "coding fonts". They pop up every now and then here on HN but it always seems like bikeshedding to me.
Don't get me wrong - I'm aware that there are some folks who may have a vision impairment or some other reason where it really matters. But apart from that, I've been programming for decaded on many different computer systems with many different fonts, and frankly, it really doesn't matter too much to me.
Of course, you want something monospace, and something that looks nice might make an 8-hour day job (subconsciously?) more pleasant. But to me(!), most of the "programmer font" discussions are a waste of time, just choose the first one on your system and off you go.
I call it Font Disease. Once afflicted, you will start noticing fonts, and for anything written you can control, you desperately want to find the best font possible--the default will not suffice. When you find a good font, it's very satisfying, and the action of you choosing that font is like scratching an itch.
Oddly, I caught Font Disease around the time I also caught Old Age and my previously perfect vision became less perfect.
The symptoms are: first fiddling with font size, suddenly 10pt was too small! Then I frobbed colour scheme for a bit, then boom, I'm downloading fonts. And trying others (eg: eval over a weekend project) and spending hard-money on font libs. By the time I realised I had it, twas too late! (Also, I'm using Hack, 16, Atom Dark)
It's just subjective, but many people are genuinely sensitive to it, some aren't. I find Input visually hard to read, and prefer something like Fantasque Sans Mono (https://fontlibrary.org/en/font/fantasque-sans-mono). Different strokes.
There are instances where font matters, and I go back to TurboC on my 8086 and Fortran 'scards' on a VMS mainframe + terminal, so I'm not a whiny mod-crazy hipster.
> Fonts Creating Bugs:
Some fonts are more prone to errors. Lower case L vs number one, zero vs. capital O, braces vs parens, lowercase g vs 9. Go look at old Unix fixed fonts, and even courier and you can see how hard it is to distinguish. (Unix '10x7' was my favorite until horz resolutions crossed the 1600px.)
> Readabilty vs. Coding Style causing (literal) Headaches:
Staring at code 10+ hours a day, eyes fatigue. Some fonts are noisier than others, some fonts read faster than others, some fonts have more space than others.
And, if the coding style of the person you are reading does not use spaces between '=' or '()', or ample newlines, Courier can be a very taxing font due to all the serifs.
Lucida Mono provides a nice way out of this, but not all systems have it. Consolas solved the problem for a very long time.
> Ligature Bling
The addition of ligatures is mostly bling. I tried Firas cuz the => glyphs were nifty, but ultimately a big fat triple equals looks worse than '===' and I'd rather not waste time tweaking my goddamn font!
> Proportional
What kind of savage codes with a proportional font?
> Portability
I switched to Consolas because I can use it on Vi on macOS, Win, and *nix, and it saves my eyes from dense programming style.
> What kind of savage codes with a proportional font?
I did for some time. I only switched back because our coding standard limits the length of a line and that is hard to check with a proportional font.
I honestly don't get why source code needs a fixed character grid.
My prefered code formatting doesn't require lining up things using spaces in the middle of the line. If things need to be lined up, then I put them in the beginning of the line with the apropriate indentation. This way anyone can choose any font they like and make use of the increased readability of proportional fonts.
I honestly don't get why source code needs a fixed character grid.
> Alignment of blocks and assignments. It's that simple.
The benefits from the increased legibility and clarity can be quite tangible. Code that is the same looks the same, and it's easier to scan for anomalies.
> What kind of savage codes with a proportional font?
I have, for more than a decade. Why do you call me a savage? ;-)
I know you're kidding, of course, but now you owe me (and yourself) a favor.
Go to the linked test page. Pick a color theme you like, change the language if you want and leave the other settings alone. Now do some reading and editing in the source code box.
Don't worry about whether you like or dislike this particular font, Input Sans. I'm not much of a fan of it [1], but it will serve to make the point.
Does the code look OK and editing it works OK?
Now switch the font to Input Mono and take another look. Switch back and forth between Sans and Mono a few times to compare.
(Skip Input Serif for this comparison as it's a rather different style of font. The cursor keys are handy here: click on Input Sans and then use the up arrow to go directly to Input Mono, and down arrow to go back to Input Sans.)
To my eyes the code looks pretty similar in the Sans and Mono variants, how about you?
But Input Sans is a proportional font, not monospaced!
As stkdump noted, proportional fonts only break down if you use column alignment. Take this line in the Python code for example:
The parameters will line up only if you're using a monospaced font. In a proportional font the last two parameters will appear to be shifted to the left.
But you don't have to do it that way! This kind of column alignment has many disadvantages even in a monospaced font. (What if you rename the function or output variable?) Like stkdump, I would use indentation here:
Now you don't have to re-align if you change those names, and the code will be perfectly readable in any font, proportional or monospaced.
Don't get me wrong, I'm not trying to persuade you to start using proportional fonts. I am hoping to persuade you and other developers to be more tolerant of those of us who like proportional fonts, and to avoid column aligned coding styles regardless of the font you prefer. Fair enough?
[1] My favorite coding font right now is Trebuchet MS. It renders beautifully on high-DPI displays, much nicer to my eyes than Input Sans, and it has easy-to-distinguish glyphs for the common mixups like Il|. It does have a wimpy tilde, so I used a font editor to copy in a better tilde from another font.
No need to realign manually after renaming variables, we are programmers after all. Use a beautifier for your code. Wrote my first one in STOS Basic on the Atari when I was tired of forced line numbering and wanted to code with function names instead of Gosub 950.
Now the beautifier is often already built into the editor.
I get a lot like this:
$data = array(
'a' => 5,
'boom' => 25,
)
And having the values nicely aligned makes it much easier to read when it's 15 variables in that array.
I see this as the weakest and most permissible of bikeshedding, especially because it happens in spare time as nobody would ever seriously distract a project with a debate about IDE font choice.
Way too many stock monospace fonts make it hard to distinguish between lowercase ell, capital eye, numeral one, and pipe. All of those except pipe should have different serifs.
(I feel like this is a problem even in proportional fonts, incidentally. I like sans-serif as much as the next guy, but if the word "Ill" looks like chicken-scratches then something is wrong.)
And yet, as I mentioned in my original post, I've been coding and using the shell etc. for decades and never ran into that problem in practice.
I would bet that more production time has been wasted on a global scale with discussions about and fiddling with font options than with a wrong l, I, 1, | in a place where it shouldn't be.
Likewise, but I have just come to accept that although I don't care what font I code in (just disambiguate the look-alikes), lots of others do, in nauseating detail. So I just lurk on the conversations as I might on plenty of other nuanced tech fascinations that don't fascinate me.
For those who are interested, I can recommend the talk “Cracking the Code” given by the creator of Input, David Jonathan Ross, in which he talks about coding font history and some amazing things you can do with them in modern development environments: https://vimeo.com/166161405
Happy to see this here again. Input Mono has been my favorite programming font for the last years. This is saying quite a bit, as I tend to be very picky and regularly test other programming fonts.
There is nothing else that is as readable and comfortable to use in the long term (my next-best font, and previous favorite, was Inconsolata).
I tried Input Mono and it looks and feels very "tall", taking up vertical space. Obviously, I don't know whether this is just a optical illusion or objectively true.
I've found SF Mono from Apple to be the best coding font. It has a beautiful "r", slashed 0, l1 disambiguation and great rendering on MacOS. For Windows, I used FontForge to increase hinting and create .ttf versions - I am pretty sure this is violating Apple's TOS :-)
Hmm. That's strange. I find Input Mono to actually be a bit on the wide side, and I often switch to Input Mono Narrow in order to fit more on the screen. Now, Input Mono Narrow does feel "tall" (which is the point).
The nice thing is that you still have Condensed and Compressed if you want things even tighter :-)
Yeah, ever since they released those I've been using Go Mono in my terminal (and thus in Vim for coding). I'm not even particularly particular about fonts—I do care a little though—but this one just sat really well with me.
Couldn't agree more. I like Serif fonts, but they are hard to find in monospace form.
I've known about the Input fonts, but their license is too restrictive. Recently I discovered two that are open source: Courier Primer and Go Mono.
I have switched to Go Mono as soon as I found out about it, even though I was a long time Source Code Pro user
I think this font deserves to be more widely known.
There also is awesome-terminal-fonts (https://github.com/gabrielelana/awesome-terminal-fonts). I feel if this was somehow standardized we would see much more vim and emacs plugins and cli tools support icons in the terminal.
This is so cool. Really interesting how much visual noise is removed by eliminating the hard baseline serif elements of letters like lowercase-L and lowercase-I.
I like lower case parentheses, for Scheme and Lisp coding. The ligatures in Hasklig gave me this idea.
I'm currently using Courier Prime Code with 60% parentheses, vertically centered around the lower case "o", and moved a bit left and right to open up expressions, and for better spacing trailing )))'s after a letter. This is easily accomplished using the demo version of Glyphs Mini, and it puts focus back on the text, without interfering with tools that expect parentheses. (I used a preprocessor for years that inferred most parentheses. It can be done, but then standard editor tools for Lisp don't work.)
There are deep reasons one might prefer Scheme to Common Lisp, particularly as a mathematician. Not liking Common Lisp's default "GET OFF MY GRASS" upper case is a shallow reason. Call me shallow. It was a revelation to realize that I didn't like Lisp parentheses because they were also upper case, and they should also be lower case.
Been using Deja Vu for such a long time, hard to change. Seeing as this has a slashed or dotted zero really makes this a contender. So many “code” fonts don’t seem to get the zero right.
It's the Unicode coverage that keeps me with DJV Mono - working a lot with document-focused XML, the fewer little white boxes turn up in my editor the better. DJV Sans ended up leaking into my desktop over the years and now I can't imagine going without it.
The first TTF link doesn't display anything on my machine (no characters display in the font install dialogs). Second version looks pretty rough scaled up imo.
I've been using Input for years. Specifically, I've been using Input Sans Compressed. Yes, it's a proportional font. I've gotten so used to it that monospaced fonts feel like there's just way too much whitespace.
If you like crisp bitmap fonts, I recommend the Proggy line. http://upperbounds.net/ It's fantastic if you like small point sizes; Proggy Tiny is 6x9 pixels per character, and lets you jam an amazing amount of text on one screen and stay crisp and clear.
I've moved away from them as I get older and my vision recedes, but when I was younger nothing compared.
Controversial: I use Input Sans as my coding font. Yes, it's a proportional font (designed for code).
Using a monospaced font feels like a robotic concession to the ancient ways... Doing my small part to bring about the human-friendly future of coding I dream about.
Hmm, nice selection of math operators! If I ever need to put math formulas on highway signs... But I don't want to get people killed, and anyway TeX would have better spacing ;-)
I'm a font-aholic as well, but I specifically look for fonts that remind me of the early days of computing. I really like IBM Plex Plex Mono and Golang's monospaced serif font. I also found vt52 from back in the PDP days.
Another interesting font is B612 Mono, which is the font used on aircraft to help pilots easily distinguish characters on their HUDs. I used it as a programming font, and I think it's quite legible.
I really like the curly braces in Input. I'm not too thrilled about the licence though. And I've used DejaVu Sans Mono for too long for anything else to look right to me, I think, and the DejaVu fonts have such great glyph coverage as well.
I use "Fixed". It is a pretty good fixpitch font for display on screen, in my opinion. I personally prefer it over all of the others that have been suggested. No antialiasing, no TrueType, just a pure bitmap font with nothing extra.
This is a very nice looking font, I may have to try it out. I’ve pretty much stuck to Roboto Mono (with powerline for shell and ligature symbols [on/off] for editors) the last few years. I personally find it readable.
Just gave it a whirl, purely default Mono settings. Did not feel right. I agree with the sentiments of the curly braces feeling too curly. Maybe after a longer adjustment period it'd be fine, but compared to my years of Roboto Mono, it feels squat.
Also just gave IBM Plex a spin and it too doesn't feel natural. To me Roboto Mono just feels clean, almost clinically precise.
I’m such a sucker for beautiful typefaces. I’m going to try this one out. I recently switched from Fira Code to Source Code Pro, but I don’t like it quite as much. This looks pretty
I can't find anything better than Monaco for myself. That's something about it aesthetically pleasing which I can't quite explain. Fira Code probably comes second.
I second SF Mono, subjectively it is the most aesthetically pleasing, well proportioned and just plain beautiful to look at.
With that, the entire San Francisco type family is extremely well crafted. I just wish it was openly available even for a fee. But, that makes it even more irresistible and valuable for Apple.
Isn't it so... exclusive... that you have to dig the file out of the Xcode.app or Terminal.app bundle to be able to use it in other applications, even on macOS?
Oh - thanks for noting! SF Mono looks pretty cool, I missed it somehow (is it available on 10.12?). I guess I'll have to dig it out of Terminal.app now to try it out.
I'm currently using Droid Sans Mono for coding. With a small hack to add a slash through the Zeros. For me it's finally the best coding font I've used.
If the Input Mono Condensed you're referring to comes from https://djr.com/input/ I recommend reviewing that font's license.
https://djr.com/license/ is a non-free license (the license does not respect your software freedoms to run, copy, share, and modify the software). The license is revocable under unclear and incompletely specified conditions: This license can be terminated at any time for no declared reason "without the obligation of notice or opportunity to cure [a breach of any term of this agreement]". The license tries to place limits that could go beyond what power copyright law grants in Massachusetts, USA (the region the license will be interpreted within). In other words, copyright law in your region may grant you more rights than the state of Massachusetts, USA grants.
So? What's the worst that could happen and how do you even imagine a practical CnD would take place? Somebody spots you using the font at a convention and decides to change the license then and there?
It's not like you can't easily change your font if you're ever required to.
Originally learned about this font from here a few years back. The font is customizable as either serif, sans, or monospaced along with a, g, i, l, 0, etc.
My first adventure down the font hole started with Bit Stream Vera Sans Mono followed by Source Code Pro. Stuck with Source Code Pro for many years and even today, not sure any other aliased font looks and works as well as Source Code Pro at almost every size, from the smallest onward. It just looks clean to me.
After reading on here how great it was, switched to Fira Code for a while. It was nice, but never blew me away. The ligatures were a nice change I guess.
Then I tried out Iosevka and was happy. Kept using it for a while.
Then it was Input Mono, again happy and used it for a while.
I was later introduced to Operator Mono and thought I had found code font bliss (pay).
Ended up going back to SF Mono (I'm on macOS) and feel content. Finally. Again. I don't think I'm switching anymore. I might try for a day or a few minutes something else, but I can't see myself sticking with it like SF Mono. It will have to blow my mind.
As an aside, I love no antialias Monaco at about 10 pt on hi dpi/retina displays (MacBook Pro 2017 and LG 5k with non-decimal scale, e.g. 2x). Something about it seems perfect to me. It usually seems to require special configuration and sometimes is difficult or not supported at all in many tools and editors, so I have stuck with SF Mono, typically 11 pt or 13 pt depending on the display and time of day and how much sleep I got.