Input: Fonts for Code
input.fontbureau.com
input.fontbureau.com
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.
Currently I use the Golang fonts (monospaced serifs).
That's one funky monospace, with almost Flintstones' feel to it.
This has easily been my favorite font for a long, long time.
I'm a sucker for ligatures.
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.
https://raw.githubusercontent.com/be5invis/Iosevka/master/im...
Commenting to find this later on.
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).
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 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.
So, those are my reasons anyway.
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.
If you like proportional fonts, go for it!
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.
Great font though. Recommended.
Are there nonmono fonts with arrow ligature support like firacode?
(Also, thanks for reminding me of it. I think I've just found the font for a redesign project.)
Seriously though, what an atrocious site...
What, on ${DEITY}’s Blue Earth, can ligatures possibly do for you as a programmer, that is in any way useful?!?
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.
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".)
Nice work there.
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.
> 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.
Not only that, but it might as well look nice if you're staring at it for 10+ hours.
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.
> 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.
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:
vanillaView = ShowMouseCoordinatesTextBox((20, -30, -20, 22), "", alignment="left", sizeStyle="mini")
If you want to get that down to 80 characters, you might do it like this in a column aligned style: vanillaView = ShowMouseCoordinatesTextBox((20, -30, -20, 22), "",
alignment="left",
sizeStyle="mini")
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:
vanillaView = ShowMouseCoordinatesTextBox(
(20, -30, -20, 22), "", alignment="left", sizeStyle="mini"
)
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.
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 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.)
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.
Sounds like you don't have Font Disease. Lucky.
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)
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'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 :-)
The nice thing is that you still have Condensed and Compressed if you want things even tighter :-)
Monospaced with serifs - totally blew my mind. I am using it since then and it is the best font for me I have tried so far.
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.
My favorite config (on a Retina 15" Macbook Pro): http://input.fontbureau.com/preview/?size=14&language=python...
Might give it a spin. My current goto is Fira Code Retina @ 16pt.
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.
Can you share the font?
Thanks.
https://blog.golang.org/go-fonts
Same metrics as Deja Vu, but with serifs! Shame coverage is so low.
https://www.dcmembers.com/jibsen/download/61/
Including its two TTF versions (which are separately notable for using obscure TTF fearure to achieve a proper pixelated look):
http://chrisrickard.blogspot.com/2010/05/geenatcom-dina-ttf....
The new Output font (yes, that’s the name) of Input‘s creator David Jonathan Ross looks great as well! Very clean sans-serif font.
Whenever evaluating a programming font, it’s really just a question of how similar to Inconsolata it is.
It's a time sink, but quite useful.
I've moved away from them as I get older and my vision recedes, but when I was younger nothing compared.
Noto is short for “no tofu”, the typographer’s name for the box which is displayed when the system can’t find a glyph for a codepoint.
It’s a decent backing font and guarantees you’ll see something rather than nothing.
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.
https://github.com/RedHatBrand/Overpass https://overpassfont.org
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 ;-)
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.
For me, it's Source Code Pro.
https://qph.fs.quoracdn.net/main-qimg-ecd90601a357e090eadf2d...
Also just gave IBM Plex a spin and it too doesn't feel natural. To me Roboto Mono just feels clean, almost clinically precise.
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.
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.
It's not like you can't easily change your font if you're ever required to.