Maybe it's because I've only used fixed-width fonts for programming and have gotten used to it - but I find fixed-width fonts significantly easier on the eyes.
But would you ever read a novel using fixed width fonts? Modern typography uses variable width fonts for good reasons.
I find type writer fonts to look horrible since I’ve gotten used to variable width fonts. It’s like immediate eye strain for me. But you have to choose a good font, times new Roman won’t work.
While I wouldn't say it's THAT significant, there is one other advantage to fixed-width fonts that I've experienced. Due to the fact that they align vertically, sometimes they expose mistakes if you're constructing data in a table-like fashion. Or when you have a bunch of copy/pasted lines that differ only in the parameter values. Like, "Hey wait a minute... this line is 1 char wider than the previous one. Oh, whoops, I fat-fingered something there".
I wish I had more specific examples and could quantify it better, but I know I've caught quite a few errors this way.
This exactly. Most recently I had a script that was calling functions with fixed width data sets (IDs, credit card numbers, birthdates, etc..), and typos were significantly easier to find due to the data and fonts both being fixed width.
This is because we don’t have any decent rich formatting options available for code in a plain text file. You could totally find those errors in an excel spreadsheet, and excel doesn’t default to using fixed-width typewriter fonts.
Variable width fonts are generally more readable, which is why they’re generally used for prose.
Fixed-width fonts allow for easy tabular rendering in a text editor. Some programming styles use this heavily but it’s not universal. Particularly, if you rely on line-by-line blame in source control, alignment changes can make it harder to find the commit where the most recent semantic change happened.
Traditional fonts even had non-lining figures, with varying heights for easier readability. Modern-style figures were only really used for tabular display, or with content written in uppercase/title-case. (Of course, it's hard to support this kind of complex text styling when editing plain-text files that are going to be fed to a compiler, or some other text-processing step.)
But source code is very different from prose. Are there any studies on fixed-width vs. proportional readability specifically when it comes to programming?
I use Geneva for coding. Variable width typefaces are easier on my eyes. I find that my page-scanning more readily gets lulled into laziness when using fixed width. And variable width keeps me from doing goofy alignment games with blocks of similar text (e.g. lining up the `=` signs in a list of assignment operations) that I invariably regret later.
Stroustrup uses them in The C++ Programming Language and it is made it much nicer to read.
If you're using tabs for indentation, and not trying to do pointless alignment then there's really no reason to use monospaced fonts at all - it just makes things uglier.
The kerning is not as tight as in a real proportional font. It's a bit more spacious and regular so that fixed width tabular layouts still look relatively decent.
I should’ve mentioned I’m using a tablet. Although there’s a convoluted method involving long-hold and the Photos app, it still only save the low-res thumbnail.
Well, I'm not sure if there's a way of doing that on iOS, but I'm on desktop now anyway, so if anyone else just wants a direct link to the full-size image, here it is:
(edit: although, nope, even opening the direct URL to the image reroutes it to the low-res thumbnail version. I just don't think it's viewable on mobile — never mind!)
I think most just stick with fonts they've used in the past. In my case, I can't get myself to use anything other than Apple's Terminal (which uses SF Mono). Maybe later in the future I may budge and move off of it (iTerm2 for some reason can't quite exactly get SF Mono right, even though I import it).
Adore Envy Code R. Wish it was something I could purchase and have maintained, one of the very few customisations I make on a new box is configuring things to use it.
I see Input Mono is mentioned, but I actually really like using Input Sans, also from Font Bureau. It's a proportional coding font. I feel like I'm living in the future.
I've been using proportional fonts for coding for years. Nobody notices when looking at my screen or when doing a screen sharing session. The few times I talk about it everybody agrees that it's easier to read. I'm not surprised, because nobody formats books, magazines, newspapers, web sites with monospaced fonts. The only problem is that it's impossible to align code on successive lines to the right of an equal sign. Not a big deal. It's also pretty impossible to write ASCII diagrams in comments. AFAIK there is no editor that can help with that, unless one wants to code inside a word processor.
ASCII diagrams in comments/docstrings are doable if your editor supports custom faces. For example `M-x list-faces-display` on emacs tells me that (among other things) I can customize:
- font-lock-comment-face
- font-lock-doc-face
- org-table (also depends on alignment)
For ~6 months I used Comic Sans as my single font system-wide - like, for everything. Everywhere in the system UI, code, even on webpages (Firefox lets you disable CSS font selectors). The only exception was the terminal, which got messed up with non-monospaced fonts.
It was actually surprisingly great. Then as soon as I got a 4k monitor Comic Sans started to look very ugly - if not for that, I would still be using it. These days I use GNU FreeFont (FreeSans) for the system & Firefox & IDEs, but I have started to do almost all programming through the terminal so I use Fira Code and [Liga]Hack for that.
So give Comic Sans a shot, you might end up liking it too :) (On Windows/macOS you probably won't be able to set it as your system font, but you could still use it in your IDE and on the web)
I have to ask, why Comic Sans specifically? Seeing as it almost universally regarded as an specially ugly font. The only uses that I’ve seen accepted for Comic Sans are for use in comics (obviously) and for people with dyslexia.
I use Comic Sans as my font for closed captions. I'm not dyslexic, but I actually find it way easier and quicker to read than something like Helvetica. But I would never ever use it in a design.
Input looks good I'm going to check that out. I've been using https://sourcefoundry.org/hack/ for a while. I couldn't find anything better at the time for 10pt terminals.
I really like Terminus and have been using it for years. My problem with it is the width -- it's just takes so much space that I can't read nicely 2 files side-by-side. Does anyone know similar font just bit narrower? Fonts that have been designed with anti-aliasing in mind fall out immediately.
Yup. These days a shocking number of people never test on Windows or a 1080p monitor.
Windows is my primary dev environment. I don’t think many people are even trying to look good there. So I’m not sure Consolas will ever be dethroned. Not for me at least.
I also use Consolas, but from time to time I have to read code on another machine or some environment without Consolas or rendering problems, and the things is: if the other font is good at first it's a bit hard, but after a couple of minutes I don't feel like it's a problem reading it. Then going back to Consolas I have almost the same experience. So my anecdotal, personal idea about this is: as long as the font doesn't suck, it just doesn't matter. Same with books: I read everyday, different fonts, not once did I think 'wow this font should be banished, it hurts my eyes' or 'wow every book should use this font'. Of course on a subconcious level there might be fonts which measurably perform better (i.e. need less cognitive processing by the brain) so: show me the evidence before claiming your font is much better than mine :)
I know it's mentioned in the article, but I've loved using Fira Code for awhile. It's made some parts of code much easier to read in ruby and javascript.
I can agree with this. It's especially wonderful without aliasing on an even multiple Retina display. For example, 2x on a 5k Monitor (iMac, LG Ultrafine) or MacBook Pro. It's simple, clean, tried and true.
I think switching up how you do things from time to time keeps things fresh. Change your wallpaper! Rearrange your office! Go without syntax highlighting for a day! And, yeah, change your programming font.
It's hard to do these fonts justice via preview alone, but in whole it's very legible to read.
Aside: If you want fast access to a ton of fixed-width (coding) fonts, pre-patched for powerline, you can grab them at https://github.com/powerline/fonts.
If you do CJK (Chinese, Japanese, Korean) characters in the terminal and want crisp, bitmap ligatures, I recommend Wen Quan Yi Micro Hei. But it doesn't work well scaled up in HiDPI monitors unfortunately! CJK in the terminal is still kind of a mystery to me.
When I was researching coding fonts for myself I've found the two I liked the most were Iosevka and Fira Code because of their ligature support (DejaVu Sans Mono is also good but typically doesn't have ligatures). The choice between them comes down to whether you value having more horizontal space (shorter lines) or vertical space. Iosevka is horizontally compressed, meaning you can fit more characters into a given window width, and Fira Code is more vertically compressed.
Also, in Visual Studio Code you can fine-tune your coding font using these options:
I really want to use Fira Mono/Code, but it sadly doesn't support italics, which is a deal-breaker for me, so instead I've been using Iosevka for a week. It's really pretty!
Huge fan of Go Mono. I was taken aback at first at the idea of a monospace serifed font, but after trying it out I've come around to appreciate the clarity of it.
I'm tempted to switch to it, since it's remarkably similar to the Gallant font (a.k.a. sun12x22 / gallant12x22) I use on my OpenBSD and Linux virtual consoles. I tried using Gallant directly, but apparently Linux console fonts don't map cleanly to X11 bitmap fonts and it caused issues that I didn't feel like troubleshooting.
Fantasque sans mono is my current font, as I've been using it for over a year, as it was the only font that I really like.
It is slightly too fancy sometimes, and I go the one that renders "k" without the loop.
Every thread about programming fonts is not complete without mentioning the wonderful website https://app.programmingfonts.org (no affiliation, I just find it really useful) which lists all the free programming-related fonts with live preview (for example every single font from the article, and every one mentioned so far in every comment in this thread is already there in the app) - it allows quick one-click preview with custom text on each font, and has direct links for downloading said fonts.
Every font from this thread is already there in the app so you might as well just try them all.
Indeed, just the free ones. Although perhaps I should list the commercial ones too in some way.
That said, I do tend to feature them in the tumblr blog, so you can search that for a preview, background info and a link.
One of the things that really gets in the way of comprehension for me are typefaces with too much personality. These cutesy italics etc. really seem to affect my ability to get on with the job at hand.
This is why, despite trying, I've yet to find something that can outdo Consolas on Windows. I tried Fira this and that, Source code pro and a bunch of others from Google Fonts. They all are inferior to Consolas in my eyes. They'll either be missing the slotted '0', or look crowded in small sizes etc.
Do I like Dank Mono? I am indifferent to it. It hasn't sold me on switching from Source Code Pro.
It's better than a lot of other fonts I've seen on programmingfonts.org so far. But just because a font is good or on par with my current one doesn't mean I'll use it. Force of habit is a big factor.
I've moved to it recently and is my new favorite. Mainly because my eyes are getting old so I don't need it to look good at 7 pt since I couldn't see it anyway. And I like thicker fonts like this.
Have you tried Ubuntu Mono? It's not as thick but is quite readable. Also their bold variant might satisfy you if the regular doesn't. DejaVu Mono is also quite adequate.
I found it terrible, not only because of the surplus personality, but due to aesthetic and readability issues.
Readability - the r looks to me closer to an i, not the i of this font but a generic i, I find it confusing and it slows me down.
Aesthetically - the f character have space before it that in many combinations cuts a word to two, for example in the word delightful. Generally the font is mono-spaced, but the space between and after characters varies a lot.
I found it terribly incomplete. $40 and it can’t cover all four standard weights: regular, bold, italic, and bold italic. I believe it was last one, bold italic, that it was missing and the website is careful to obscure that fact.
Too much of the cursive can damage readability, but if it's constrained, then it actually helps a lot. I use Dank Mono and write primarily in JS. I use the cursive for things like `let` and `const`, which helps them stand out. It's a very nice typeface, well worth the money.
Not to sound flippant or pretentious, but for me, $40 is practically free for a software tool. On top of that, I can expense licenses if I use them for my work. I’m guessing that most people in my position would have no problem paying $40 for a font.
It's still a bit much IMO. It reminds me of Sublime Text being priced at $70 or Input Mono being $40-100+ depending on the options you choose.
I assume they are willing to accept the risk of piracy and/or lost sales to free alternatives like Fira Code, and plan to make their money on institutional licenses instead.
I would bet that most who wouldn’t buy Sublime at $70 wouldn’t buy it at $35 either. If you’re paying for text editors and fonts they’re probably important enough to you that you probably won’t let price deter you unless it’s truly exorbitant.
Personally speaking I’m a bit more spendy on small dev products because I know it’s harder for them to stay afloat, unlike Jetbrains or Adobe which aren’t really impacted by my purchase decisions in any meaningful way.
I am not saying you are wrong but to me the real problem is death of a thousand cuts problem: I have zero issues paying for quality work and I do; but when these things start piling up -- fonts, images, logos/icons, IDEs, creative software -- you can easily find yourself spending $1000.
I am not stingy but I feel drowned in a sea of good work each requiring its payment. This phenomena turned me off paying for fonts and settling for free ones.
Thanks for the introduction to Dank. First time I've seen it and I like the look of it. Particularly the 'f' shape.
What's the closest free font you've seen to it? As it's so different from my usual monospace font I want to try ssomething similar first to see how I find it, before spending money on it.
Im not sure I follow. Are you saying you don't understand why people who stare at letters on a screen all day every day for a living might have an interest in the fonts used on said screen?
A good programming font helps avoid confusion. For example, it should be clear if a character is l, I, or 1 without having to see them next to each other (also o, O and 0 as well as others). A font should also make reading code as pleasant as possible (though of course this is highly subjective).
When you consider that programmers spend most of their time reading code, it's not surprising that many programmers care about the font being used.
We stare at text for hours on end, every day. We want the text to be functional... and pleasant to look at. I change fonts frequently, just to spice up my life - it's a little like changing your desktop background on a regular basis.
Well, we spend almost all of our time reading code. I think it only makes sense we develop strong opinions about the font we do that in. It's an essential part of the interface.
Practically, we look at text all day long, so having a font that is easy to read is good ergonomics. A font may be good for code, but might not work as well in a tool like htop or gotop.
Monospaced fonts are also interesting from an artistic perspective that resonates with programmers. Font designers are able to be expressive and original despite — or perhaps because of — the constraints of the problem: all characters must have the same width and the text should be readable for long periods of time, often at small sizes.
What bitmap fonts do you miss? The site is currently restricted to fonts with a license that allow me to serve a web font for the live preview. So while there are a bunch of bitmap fonts in there, there might be some missing. I love to find out about new fonts though.
i mean the standard "fixed" X window fonts, that come with x.org and have a large variety of sizes. They are typically the default font for xterm. They are everywhere, in debian for example, so no problem with the license.
In the US at last check, bitmap fonts weren't subject to copyright. Also, the X11 fonts I've looked at had a license string something like "these glyphs are unencumbered".
I suspect those X11 bitmap fonts are in arcane 1980s formats that would require a chain of conversions-- from bitmap to vector to get them to Postscript Type 1 or TTF, and then from TTF to WOFF.
Yes, I’ve seen a lot with old formats. I don’t think the bitmaps themselves are a problem, I already have a bunch (maybe they are faux bitmap though, not sure actually). And they don’t need to be woff though, that just adds some compression and prevents installation. The latter of course not being an issue for the fonts that are featured here.
The Dina font is free. You are welcome to use, distribute
and modify it however you want, just don't use it for
anything illegal or claim that you made it.*
Seems to be missing Computer Modern's Typewriter Text face (a.k.a. "CMU Typewriter Text"), which was my primary monospaced typeface (and still is on all except my work laptop, which I switched over to Fantasque Sans Mono since it's a better pairing with Comic Neue). It's a lovely font, the only fault being the lack of a slotted 0.
:/ The bitmap fonts are rendered with anti-aliasing. That's too bad. The advantage of bitmap fonts is how crisp they look. Here, they're pretty hard to read at small sizes.
Only if they aren't at their native point size. If you're on chrome, then you're right, because chrome renders how it wants, in classic "I know better than you" style.
It's my favorite programming font, made by a good friend of mine. It has awesome ligatures and the italic version is beautiful, similar to Operator Mono!
An interesting font, but can't say I'm a fan of the regular 'f' extending down below the baseline. The italic style is fancy, but honestly feels a bit ostentatious (in particular I don't like the 's') to the point where I think the attempt to look pretty/handwritten interferes with its readability - especially at smaller sizes.
Easy. A basic font editor can do it. I for example experimented with changing the weight of parenthesis, thinking they're not evil in Lisp, just tuned badly for that purpose.
I have tried lots of different coding fonts for fun (and when I change fonts, it just feels like using a brand new computer :-)), but my go-to font when I just don’t want to think what I’m gonna using is SF Mono, from the San Francisco fonts by Apple[0].
It blends well with the macOS system fonts, and it’s great.
The link you posted https://developer.apple.com/fonts offers to download and install .dmg -> .pkg. I usually install SF Mono via /Applications/Utilities/Terminal.app/Contents/Resources/Fonts. This folder contains all SF Mono fonts in .otf format. If you open them and install, it vill be available everywhere. You can copy those files and install it on Windows or Linux computer.
FYI If you just want to change the 'monospace' font in Chrome, you can do that from chrome://settings/fonts and don't need an extension (I changed it from Courier New to something nicer as well).
It’s good to see that many of these fonts distinguish well between open/close quote characters - this is a personal bugbear of mine. For example, Input Mono fails for me on this aspect. Hyphens and the two dashes are usually problematic, too - unfortunately, no examples of those in this post.
249 comments
[ 3.2 ms ] story [ 277 ms ] threadI find type writer fonts to look horrible since I’ve gotten used to variable width fonts. It’s like immediate eye strain for me. But you have to choose a good font, times new Roman won’t work.
I wish I had more specific examples and could quantify it better, but I know I've caught quite a few errors this way.
Fixed-width fonts allow for easy tabular rendering in a text editor. Some programming styles use this heavily but it’s not universal. Particularly, if you rely on line-by-line blame in source control, alignment changes can make it harder to find the commit where the most recent semantic change happened.
If you're using tabs for indentation, and not trying to do pointless alignment then there's really no reason to use monospaced fonts at all - it just makes things uglier.
Here's a 3200x1800 screenshot with some code in Emacs.
https://i.imgur.com/LdzBmpx.png
The kerning is not as tight as in a real proportional font. It's a bit more spacious and regular so that fixed width tabular layouts still look relatively decent.
Oh it seems that the mobile imgur site is totally nerfed. Sorry. Is there a better free image host?
https://i.imgur.com/LdzBmpx.png
(edit: although, nope, even opening the direct URL to the image reroutes it to the low-res thumbnail version. I just don't think it's viewable on mobile — never mind!)
Related HN discussion: https://news.ycombinator.com/item?id=21303283
I think most just stick with fonts they've used in the past. In my case, I can't get myself to use anything other than Apple's Terminal (which uses SF Mono). Maybe later in the future I may budge and move off of it (iTerm2 for some reason can't quite exactly get SF Mono right, even though I import it).
its nice and readable, but has ligatures, which makes things like == & -> very obvious.
- Luculent, http://eastfarthing.com/luculent/
- Envy Code R, https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-co...
B612 Mono would be an excellent font if the glyphs were well aligned.
You can get it here: https://input.fontbureau.com
And amazingly, you can personalize your font on download, such as choosing dotted vs slashed zeroes.
Not free, but free for personal, non-commercial use. (Check the terms)
I'll try Input Sans.
- font-lock-comment-face - font-lock-doc-face - org-table (also depends on alignment)
1: https://djr.com/output/
It was actually surprisingly great. Then as soon as I got a 4k monitor Comic Sans started to look very ugly - if not for that, I would still be using it. These days I use GNU FreeFont (FreeSans) for the system & Firefox & IDEs, but I have started to do almost all programming through the terminal so I use Fira Code and [Liga]Hack for that.
So give Comic Sans a shot, you might end up liking it too :) (On Windows/macOS you probably won't be able to set it as your system font, but you could still use it in your IDE and on the web)
https://www.myfonts.com/fonts/tabular-type-foundry/comic-cod...
I've been using it for a few months and really enjoy it!
https://github.com/shannpersand/comic-shanns
[1]: https://sourceforge.net/projects/terminus-font/
I have tried many programming fonts. I love articles like this that expose to me to new, fun things to try. But alas Consolas is King.
Unfortunately a lot of coding fonts dont hint well on Windows, or only look good in hiDPI...
Eventually I settled on Droid Sans Mono, which I modified to have a slashed Zero.
Windows is my primary dev environment. I don’t think many people are even trying to look good there. So I’m not sure Consolas will ever be dethroned. Not for me at least.
"Monoid" in the linked article made me think of it immediately.
[1] https://www.nerdfonts.com/
It's hard to do these fonts justice via preview alone, but in whole it's very legible to read.
Aside: If you want fast access to a ton of fixed-width (coding) fonts, pre-patched for powerline, you can grab them at https://github.com/powerline/fonts.
If you do CJK (Chinese, Japanese, Korean) characters in the terminal and want crisp, bitmap ligatures, I recommend Wen Quan Yi Micro Hei. But it doesn't work well scaled up in HiDPI monitors unfortunately! CJK in the terminal is still kind of a mystery to me.
Cascadia Code looks like the Comic Sans of programming fonts.
Also, in Visual Studio Code you can fine-tune your coding font using these options:
I recommend tuning your lineHeight and letterSpacing.https://github.com/belluzj/fantasque-sans/releases/download/...
Every font from this thread is already there in the app so you might as well just try them all.
Just to nitpick.
But I am right now going through every one of those fonts in the app to compare with the one I've used for almost a decade now.
One of the things that really gets in the way of comprehension for me are typefaces with too much personality. These cutesy italics etc. really seem to affect my ability to get on with the job at hand.
This is why, despite trying, I've yet to find something that can outdo Consolas on Windows. I tried Fira this and that, Source code pro and a bunch of others from Google Fonts. They all are inferior to Consolas in my eyes. They'll either be missing the slotted '0', or look crowded in small sizes etc.
It's better than a lot of other fonts I've seen on programmingfonts.org so far. But just because a font is good or on par with my current one doesn't mean I'll use it. Force of habit is a big factor.
My one complaint is the tilde.
Readability - the r looks to me closer to an i, not the i of this font but a generic i, I find it confusing and it slows me down.
Aesthetically - the f character have space before it that in many combinations cuts a word to two, for example in the word delightful. Generally the font is mono-spaced, but the space between and after characters varies a lot.
I assume they are willing to accept the risk of piracy and/or lost sales to free alternatives like Fira Code, and plan to make their money on institutional licenses instead.
Personally speaking I’m a bit more spendy on small dev products because I know it’s harder for them to stay afloat, unlike Jetbrains or Adobe which aren’t really impacted by my purchase decisions in any meaningful way.
I am not stingy but I feel drowned in a sea of good work each requiring its payment. This phenomena turned me off paying for fonts and settling for free ones.
What's the closest free font you've seen to it? As it's so different from my usual monospace font I want to try ssomething similar first to see how I find it, before spending money on it.
When you consider that programmers spend most of their time reading code, it's not surprising that many programmers care about the font being used.
Monospaced fonts are also interesting from an artistic perspective that resonates with programmers. Font designers are able to be expressive and original despite — or perhaps because of — the constraints of the problem: all characters must have the same width and the text should be readable for long periods of time, often at small sizes.
E.g. https://www.donationcoder.com/forum/index.php?topic=15281.0
Both the standard and slab versions are great
For as long as I’ve been coding, I’ve never heard of this font. Thanks for mentioning it.
It's my favorite programming font, made by a good friend of mine. It has awesome ligatures and the italic version is beautiful, similar to Operator Mono!
I wonder how hard it would be for me to change just those characters.
It blends well with the macOS system fonts, and it’s great.
[0] https://developer.apple.com/fonts/
The link you posted https://developer.apple.com/fonts offers to download and install .dmg -> .pkg. I usually install SF Mono via /Applications/Utilities/Terminal.app/Contents/Resources/Fonts. This folder contains all SF Mono fonts in .otf format. If you open them and install, it vill be available everywhere. You can copy those files and install it on Windows or Linux computer.
Also this extension is musthave: https://chrome.google.com/webstore/detail/advanced-font-sett... I set SF Mono as default monospaced font for chrome. IDK why ugly Courier font is still default in many software.
https://www.slant.co/options/228/~monofur-review
[1]: https://app.programmingfonts.org/#agave
[2]: https://app.programmingfonts.org/#lekton
http://eastfarthing.com/luculent