73 comments

[ 3.3 ms ] story [ 73.5 ms ] thread
After redesigning my website to use Atkinson Hyperlegible fonts, I switched my terminal and code editor to the monospace variant to properly test it. After a month of testing and positive experiences, I felt motivated to investigate further and write an article comparing Atkinson Hyperlegible Mono to JetBrains Mono and Fira Code.

The visual comparisons use examples from an accessibility paper on homoglyphs and mirror glyphs. I chose JetBrains Mono and Fira Code as a baseline, since many developers use these fonts and find them familiar.

While Atkinson Hyperlegible Mono excels at character distinction, nothing is perfect. I detail trade-offs in the "Caveats" section, below the installation instructions.

I'm curious to hear others' experiences and thoughts. I'm fascinated by what role font choice plays in legibility and accessibility, but the research is relatively sparse in this area.

Character distinction isn't that important when reading english mainly because context automatically repairs any s1m1l4r1t1es b3tw33n w0rd5. Even numbers can be used the replace letters and it only slows down reading slightly. Leetspeak is only a worst case example. For example for b0Ok 0 and O causes virtually no pause.
Why don't we embrace proportional (i.e. not monospace) fonts more for coding? IMHO, they are a big step up when it comes to legibility. I personally switched after I noticed reading stuff in the sidebar (which is usually in a proportional font) felt more comfortable than reading code.

You can't use it for a terminal of course, and occasionally I find comments relying on monospace alignment. Other than that I see no downside to proportional fonts.

I use Input, which gives more room to special characters and is pretty nice overall: https://input.djr.com/

Some people use proportional fonts in their IDEs, and have been for decades. It's just not exactly a mainstream practice. (I seem to recall that Microsoft used proportional fonts in their IDEs in the 90's. Or maybe I'm thinking of Visual Basic? Not sure.)

The main reason I have felt no inclination to use proportional fonts when coding is that proportional fonts tend to be _very_ bad at distinguishing homoglyphs and that is the _last_ thing you want when trying to find the syntax error or undefined variable. Although I will admit that I haven't look very hard for a proportional font that's actually meant for programming.

The other reason is that sometimes I read code where someone has created an ASCII diagram in the comments, or have other structures or whitespace where vertical alignment matters. (This used to be highly popular in C, although it's viewed as a bad practice in "modern" times.)

I find monospace code very easy to read, so I guess at the end of the day, proportional fonts have a few disadvantages with no real upside. For me at least.

> I seem to recall that Microsoft used proportional fonts in their IDEs in the 90's. Or maybe I'm thinking of Visual Basic? Not sure.

What's the distinction you're making here; are you saying Visual Basic isn't an IDE? Because AFAICS it very much is. (Or was, whatever. For its time, not even a bad IDE AFAICR.)

> You can't use it for a terminal of course

That is the problem, though. I edit with neovim inside of wezterm. The few times I've seen proportional used for code, I've thought that it looked interesting but realistically, I live in a vt100 universe and all things considered, it's really not that bad.

I'm interested in Atkinson Hyperlegible Mono as a programming font. I think monospaced is a defining characteristic of programming fonts. Basically, legibility is just different for programming and text (although I clearly read too much Verdana).

If you use a true proportional font, you give up aligning code elements other than basic indentation. For most people, that's too much to give up.

I do like quasi-proportional fonts like Iosevka Aile, where very wide or very narrow characters are allowed something more like their natural widths. I think, though I'm not sure, that the widths are worked out so that "Wl" (wide + narrow) is the same length as "xx" (2 x normal), for example. My experience using Iosevka Aile in Emacs is that things usually-but-not-always align like they're supposed to, which is a better trade-off than fully proportional fonts.

> If you use a true proportional font, you give up aligning code elements other than basic indentation.

Have you ever gotten deep into how tab stops work in Word?

The deeper you go the more you realize fun things like Tables are as much "Tab Stops with Borders" as they are a separate concept to Word. The UI/UX of both reflect each other.

WYSIWYG word processors and design tools have lots of ways to align proportional fonts.

The big thing is that to do it well they need a ton of metadata: this "paragraph" has tab stops at 1", 2", 4", and 5.5", two of the stops are right-justified and one is centered. Word makes it surprisingly easy to edit all of that metadata easily and visually in the Ruler up top.

If you are sticking to plain text documents that are easy to source control, where and how do you store that metadata? How do you keep it from being a distraction from the code you want to write?

It's not an insurmountable problem, we could do some really cool things if we tried. One half-baked thought off the top of my head here is that I bet you could do something rather cool with easily embedded CSS Grid descriptions in nearby comments and Tab/Newline-delimited sequences auto-populating cells in the grid. Given how much of our code is HTML rendered anyway and how ubiquitous HTML renderers are in our digital lives, CSS Grid isn't the worst model to reuse for something like this, and might be something someone could build a prototype with relatively quickly.

Maybe this is a silly idea, but what about a terminal emulator that could switch fonts on the fly?

For example, it could switch to a monospace font when a "fullscreen" program like vim switches to the other buffer.

Or maybe it could even render different fonts per line.

Typos feel way harder to spot in proportional fonts. Maybe because proportional fonts are easier to read so your brain subconsciously ignores them. And typos, like a misplaced or forgotten comma, can cause some of the most annoying bugs. Also, most editors still mostly operate on individual characters. With a fixed width font I can immediately see how many cursor up and cursor left commands I need to send to move the cursor to a specific position in the text.
> Why don't we embrace proportional (i.e. not monospace) fonts more for coding? IMHO, they are a big step up when it comes to legibility.

No, according to what seems to be the common definitions in this thread (dunno if that's the "official" one, or if such a thing even exists), they're better for readability, not legibility. And I agree with user bjourne's comment[1], "Typos feel way harder to spot in proportional fonts." What we need for coding is mainly legibility, not readability.

Well, at least usually, while writing and editing. For getting an overview of a large codebase, the increased readability of a proportional font might be better. (So what we really need may be a quick way to switch our editor or IDE between proportional and non-proportional fonts.)

[1]: https://news.ycombinator.com/item?id=44654792

Maybe an acquired taste, but I'm fond of Intel One Mono ... https://github.com/intel/intel-one-mono

designed for low-vision developers.

Looks like a great, functional font. I'm also a fan of Adobe Source Code Mono, but the look and feel of Berkeley Mono just wiped the floor of all these professional and well designed fonts.

IBM's Plex Mono also a great contender for a "professional" programming font.

My current favorite code font is Berkeley Mono https://usgraphics.com/products/berkeley-mono

It's not free, but I love it. You can customize some variations too (like how zeroes look; I use the "invisible slash" look) and it has some support for terminal symbols and programming ligatures used by terminal tweaks like Powerline, etc.

yep! I just got it the other day. I upgraded to get the variants but I quickly settled on the Regular which is included with $75 Dev license. It's amazing even using it for non-code like in Obsidian.
Same here. No other font comes close to it in terms of readability. I really don't care about what each font claims about in terms of achiveness. As long as it's not pleasing to me, its not worth for me.
Come here to say the same...expensive but worths it
It just occurred to me that if HN supported, say, 4-bit mono PNG images with transparency in comments, that would help here without impacting bandwidth too much and might add a classy element
This is of course subjective, but I still find JetBrains Mono to be much more pleasant to read (when it comes to code) than any other mono font out there.
I moved on from these fonts quite some time ago and just use https://github.com/be5invis/Iosevka everywhere.

It's ideal for 'wordy' languages such as C++ where a typical line length can often go over 150 characters, and then you don't have to scroll sideways.

Iosevka is the most terminaly of the modern vector programming fonts, outside of perhaps Terminus. I set my Emacs to use it, as I haven't been able to find a font that comes anywhere near as comfortable.
Alternative title: A long winded technical deep dive into how I make my personal font preference appear to be an objective decision.
I’ve been loving MonoLisa. I previously used Fira Mono and then JetBrains Mono, each for a few years. All good fonts!

https://www.monolisa.dev/

I had a nice little chuckle when reading the intro paragraph:

> As software developers, we always strive for better tools but rarely consider a font as such.

We must travel in different circles, it feels to me like half the developers on HN, blogs, and social media are WAY more concerned with the aesthetic of their development environment than actually getting any real work done with it!

"Mirror image glyphs occur when flipping one character creates another"

About a half of the article is about these "mirror image glyphs". Why would they be a problem for the proclaimed purpose of character distinction? Has anyone ever mixed up "b" and "q"?

Fira Code uses the empty set character (∅) for zero. This mistake cost me a correct answer on a math test in 12th grade because I made the wrong slash.

Either that, or I made the correct slash and my teacher interpreted it incorrectly!

I use Atkinson Hyperlegible for my blog[1]. Really happy to see the new version adds variable weight. That was the main thing I didn't like about the original version.

[1] https://adamhl.dev

Over my embarrassingly long time of coding, I've gone through all of these fonts and more (VT100 anyone?) and eventually traded the sans-serif fixed-width fonts for ones with serifs, as it feels less tiring at the end of long days. For the last few years, I've used Monaspace [1] variants, especially Xenon, and enjoyed them immensely.

1. https://monaspace.githubnext.com/

This font was just added to codingfont a few minutes ago! https://www.codingfont.com/AtkinsonHyperlegibleMono you can compare it side by side to your other favorite coding font to see which one is better looking in a code editor! You may also play the blindfold game to see if it will TRULY wins against all others in a blind test on codingfont.com
I moved to "Atkinson Hyperlegible" for all of my Note-taking/Reading, Markdown Editing, etc. And recently upgraded to "Atkinson Hyperlegible Next" beating my choices of iA Writer’s Fonts. We are spoiled for choice and they are all beautiful and super readable and comfortable.

Unfortunately, I found "Atkinson Hyperlegible Mono" (IDE/Terminal) to be a tad stunted for my liking. I wear glasses but not that bad and I like to use my computer without glasses. I personally like "Monaco" with a tad larger font-size. The other reason I try to stick to more common fonts and pick one of the better of them is to be able to use any IDE (helping/discussing with team members) and not feeling uncomfortable without "my favorite font."

Again, very personal, but I tried "Atkinson Hyperlegible" for the website for about a month or so and I found it to be neither modern, nor professional nor vintage/classic but more like the website warming up to the reader/visiter, “Hey, are you OK? Finding it hard to read, I'm going to make some scientific fixes to help you read!”

Me too. I can't use anything other than Monaco.
My favorite of these programmer fonts is PragmataPro, which I bought around 5 years ago. I like how it’s denser while still being easy to read.

Only problem is that it doesn’t have all the nerd font glyphs so it can’t handle the nice oh-my-zsh themes well, like the powerline-10k theme. I still use it despite that though.

Same here, PragmataPro stopped me from switching fonts. Maybe because it was so expensive ;) It just has a lot of attention to detail and polish. I was using IBM Plex Mono and Iosevka before.
Hard agree; I paid for the full desktop license and stopped thinking about my programming font choices.
> Atkinson Hyperlegible Mono lacks programming ligature support.

Good. That's a feature, not a bug. I want -> to render as a dash and a greater than sign. Not an arrow. I can't even articulate why, other than a deep seated distrust of magic.

This is why I like 0xProto font. It has ligatures for a nice clean look, but preserves a little bit of spacing between characters so they're still legible as individual characters. It's also very readable and legible overall, with nice proportions.

And ligatures are a must for me because I find that symbols don't line up nicely in a ton of fonts and it annoys me a lot.

For me, it's because it messes with my expectations of where my cursor will go when I move it over the ligatured characters and what will happen when I edit them. It's very jarring to delete one character and see the character(s) next to it change.

There is also something to be said for each character being the instructions for how you type it. How to type “->”? Press - then >. With ligatures, that goes out the window, and at least for me, I have to quickly look up in my memory how to type ≥ or ⟹.

That said I do very much like Commit Mono’s “smart kerning”, where characters are adjusted slightly based on the characters surrounding them. I guess you could call it a soft version of ligatures. For instance, when an m is between two i‘s, the i‘s get pushed away a tad to give the m a bit more room to breathe. Similarly, when you type an ellipses (...), the dots get pushed ever so slightly closer together than they would be naively.

The difficulty I have with many so-called legible fonts is that they’re often not very readable.

Legibility refers to how easily individual characters can be identified. But good readability depends on how easily your brain can recognize whole words—through pattern recognition of word shapes.

When characters are too similar in shape and size, it becomes harder to distinguish the unique shape of each word, which reduces readability (which often happens with these highly legible fonts) — even if each individual letter is technically more clear.

Interesting distinction there. I didn't know that was the difference between legibility and readability. I'd really like to hear more about this. Do you have experience with fonts that strike a better balance, or know of reading material that discusses this subject in more detail?
Good observation, legibilty is not the same as readability. Hyperlegible fonts are used in places where it is crucial that the readers can identify the correct characters and/or short words – even if the readability suffers slightly.

Readable fonts are for longer form texts where the flow of reading is more important than correctly identfying individual characters.

Both have valid use cases and there are fonts who mange to do both pretty well.

This legibility vs readability distinction is why variable-width programming fonts like Proportional or Input Sans can actually reduce cognitive load during extended coding sessions despite sacrificing character grid alignment.
Do you think Atkinson Hyperlegible specifically hurts readability?

I am thinking about the regular one on text, not mono on code.

I agree, and can imagine using a different font depending on the (programming) language or purpose, yet each font being quite objectively better at that purpose. Some languages are a lot more similar to natural language, and some are more mathematical, technical or really need fixed width blocks to be readable.

And then there are fonts that I don't like aesthetically and generally avoid, but come to the rescue in the wee hours of the morning when you really have to get something done and your eyes have gone blurry.

As an Urdu speaker I love the Nastaliq font for its ability to give each word its own unique shape. When alphabets are knitted together, it doesn't just change total width of the word, it changes total height as well. Found a random website with urdu text in image form https://wp.nyu.edu/virtualurdu/the-clever-bird/
Since we're sharing our monospace fonts of choice, I use mononoki. My vision isn't great, and this is the font I've found that allows me to pack the most on my screen while still remaining readable.

https://github.com/madmalik/mononoki

That said, the differences between 0 and 8, while better than my previous favorites, still aren't as stark as I'd like them to be.

Sans serifs...except when the serifs help distinguish 1 from l and from I, etc.

Why not use a monospaced serif font in the first place? I get that they don't seem to be common, but maybe they should be.

I think it's because traditionally computer screens have pretty low DPI, and serifs can be really tricky to render well at low DPI. In print, that's not an issue, and serif fonts really shine.

On high-DPI screens, like the one I'm currently using, serif monospace fonts can also look really good. For example, I'm typing in Latin Modern Mono (based on TeX's default typewriter font) in this text box.

Coming from Commit Mono, Atkinson looks a bit unusual. But I think I can get used to it. I think the comparison to Fira Code is valid, because in the terminal Atkinson looks almost like Fira Mono, but better. Since I usually sit a meter away from the screen, I can appreciate the extra legibility of this font.

Also, it's great that it's available as a Nerd variant. It makes it super easy to install on Linux with Embellish.

To me it seems that Atkinson Hyperlegible Mono has really bad kerning. I think I'll stick to JetBrains Mono for the time being.