Introduction
The best programming font I have come across so far is Terminus. I use it for everything except printed documents.
Unfortunately, there are at least the following shortcomings of Terminus:
Characters
0
and8
are hard to distinguish. It does not annoy me much in practice, but a better font might solve this :)As Terminus is a bitmap font, some programs do not want to display it. There is a Terminus TTF version, but it lacks the clarity of the proper bitmap Terminus unless you happen to hit exactly the right font size and have all the modern things (hinting, antialiasing, etc.) turned off!
Hence, from time to time, there is need for some TTF/vector font instead. Given that there are tons of other programming fonts it should not be hard to find a proper substitute except it seems incredibly hard to get the details right. Maybe I am just too much used to Terminus.
The screenshots on this page were created using theme Night, font size 16 and the C code from https://github.com/m7a/bo-z80-ti84plus-trtotp/blob/master/trtotp.c on the following page: https://www.programmingfonts.org. The exception is Monoid which has been tested at font size 15 because 16 was very wide.
Disclaimer: I collected the fonts I liked most here, but your preferences might be different. I suggest browsing https://www.programmingfonts.org and trying it with some code of yours and a theme that looks similar to the one you are normally using.
The following table compiles a list of fonts that look OK. None can beat Terminus so far, but some come pretty close and might be chosen if at any future time, venerable bitmap fonts are banned from ever more modern applications and displays.
Font Samples
ConsolaMono | Fairfax HD | Fifteen |
Monoid | mononoki | Iosevka |
PT Mono | Share Tech Mono | Terminus (bitmap version!) |
Note that you do not get the bitmap Terminus on https://www.programmingfonts.org by default. I downloaded a HTML variant of the page and edited it by hand to replace the (vector-based) web font with the system-installed one to make the comparison screenshot.
Metadata
OFL := SIL Open Font License, Other := See linked homepage
Name | License | Homepage |
---|---|---|
ConsolaMono | OFL | https://fontlibrary.org/en/font/consolamono |
Fairfax HD | OFL | http://www.kreativekorp.com/software/fonts/fairfaxhd.shtml |
Fifteen | OFL | https://fontlibrary.org/en/font/fifteen |
Monoid | OFL/Expat | https://larsenwork.com/monoid/ |
mononoki | OFL | https://github.com/madmalik/mononoki |
Iosevka | OFL | https://typeof.net/Iosevka/ |
PT Mono | Other | https://company.paratype.com/pt-sans-pt-serif |
Share Tech Mono | OFL | https://fonts.google.com/specimen/Share+Tech+Mono |
Terminus | OFL | http://http://terminus-font.sourceforge.net/ |
A subset of the fonts is available in Debian:
Name | Debian Package |
---|---|
Monoid | fonts-monoid |
mononoki | fonts-mononoki |
Terminus | xfonts-terminus |
PT Mono | texlife-fonts-extra |
Discussion
So far, I like the following ones best:
- Terminus
- Mononoki
- Fairfax HD
Here are my main criteria for distinguishing the good ones from the better ones:
- Clarity in display (Terminus wins by far margin)
- Uniformity of characters vs. distingiuishability. I have found that
many programming fonts try to over-accentuate certain characters such
that they can be distinguished more easily. On the downside, this causes
the text to look a little “disturbed” which is just as annoying. I find
this can best be evaluated by looking at the number blocks (check the
PASSWORDPADDINGBYTES
array contents from the screenshots): All of the fonts displayed here are OK in this regard, but Termins wins again.
Some Non-Terminus Favorites at Random Dates
2021-10-10 | Share Tech Mono |
2022-01-12 | PT Mono (for practical reasons, see below) |
Fonts and UTF-8-Art
This section was added 2022-01-12.
╔════════╗
║ TEST ║
╟────────╢
║ BOX ║
╚════════╝
- Mononoki, Monoid, Share Tech Mono, Consola Mono and Fifteen fail to display test box correctly by displaying the middle line from the box in a different length compared to the other characters (maybe they are missing the glyph?).
- Fairfax HD displays it correctly but with large vertical distances
between the lines. This can be tuned with CSS
line-height
property to nice results. - PT Mono, Iosevka and Terminus display it all-correctly.
=> From an ASCII-art-compatibility point of view one should select one of Fairfax HD, PT Mono, Iosevka or Terminus.
See Also
- https://www.reddit.com/r/voidlinux/comments/itfeti/goodbye_awesome_terminus_font/
- https://notabug.org/digit/dbtfc
- https://github.com/zshoals/Dina-Font-TTF-Remastered
- https://github.com/slavfox/Cozette
To test fonts:
- put ttf in
~/.local/share/fonts
fc-list -v
to identify PostScript namematerm -fn xft:...
Fonts to try out
- https://b612-font.com/ Looks quite interesting. Zero not
slashed by default, but maybe there is a variant where it is? Debian
package
fonts-b612
. The parentheses()
are a little weird in that they look like brackets[]
from a distance. https://github.com/polarsys/b612/pull/22