212 points · by hbbio · 13y ago · 140 comments
[1] http://en.wikipedia.org/wiki/Liberation_fonts
I just found it surprising no one else had added them already.
Liberation Mono is a more vertically compact font, but I consider it just as readable as Deja Vu. I can fit around 7 more lines on my 1920x1200 monitor with 13pt Liberation versus 12pt Deja Vu. Deja Vu just takes up way more space than it needs to and (my opinion) does not make it anymore readable than Liberation or Dina.
I generally dislike anti-aliasing/smoothing on fonts when writing code in certain editors/ides (looking at you Intellij Idea). I don't mind it elsewhere, but Java just sucks at rendering fonts with its generic anti-aliasing scheme. Since I dislike it in Intellij and I use their IDE quite a bit for Android/Java, Python, JavaScript or PHP, I disable the Java anti-alias setting and most fonts tend to look bad that way as they're designed for smoothing.
Liberation though looks great with little to no distortion even without anti-aliasing enabled. I would have stuck with Dina (similar to it) since bitmap fonts do not get smoothed out by the OS or IDE, but many editors do not support bitmap fonts and the lack of UTF-8 support with Dina is a letdown as well. It's still a great font, just the tools I use end up being more important than the font itself.
Compared to Deja Vu, Liberation has less distortion glyphs without smoothing enabled and much more readable. The real downside to Liberation Mono is the 0 has just a dot in the center of it instead of a full slash unlike Menlo (doesn't bother me as I can see it, but I would prefer a slash).
Just for reference and because pictures give a better idea than my own preferences, here's a comparison:
Deja Vu 12pt: http://imageshack.us/a/img543/9845/dejavu12.png
Deja Vu 12pt (no font smoothing): http://imageshack.us/a/img547/858/dejavu12noaa.png
Liberation Mono 13pt: http://imageshack.us/a/img43/691/liberation13.png
Liberation Mono 13pt (no font smoothing): http://imageshack.us/a/img708/6315/liberation13noaa.png
Yes. A proportional font for programming. In the beginning I hated tabs and white space, until I just got used to it. Now it's much easier to read my own code. Words jump out of the text because spaces are spaces and "i" doesn't make me doubt for a split second where the word starts and ends.
Georgia is a bit of a radically-proportional font: even the numbers are proportionally spaced! Most proportional fonts have monospaced numbers. I think I would probably like monospaced numbers, but I do like Georgia enough that the proportional numbers don't bother me.
I find the same benefit you do: I have an easier time reading my code (and other people's code too). There's a subtle benefit as well: it's completely removed the temptation for me to look for column alignment when there's no need for it. I think monospaced fonts trick our eyes into seeing, and seeking out, vertical patterns that don't really need to exist.
Since as I mentioned in another comment, I just don't do column alignment any more (indentation only), that takes away the old arguments about "tabs for indentation and spaces for alignment" and such. It doesn't matter if you use tabs or spaces for indentation; the code will look fine either way. And there's no column alignment to get messed up.
I should also mention that I don't have any beef with people who prefer monospaced fonts. I do have a beef with coding standards that only work in monospaced fonts because of column alignment and similar column-oriented formatting tricks.
Most fonts that are worth their money come with monospaced and proportional numbers in both lining and old-style forms. Those can be chosen via OpenType features but I fear most code editors don't allow choice in that matter.
I kindof makes sense because ObjC methods are so wordy, that you would want a font aimed at readability rather than symbols.
My Xcode theme is here gor anyone who wanta to try http://objectivesea.tumblr.com/post/3109860705/newromantimes...
Without a monospaced font, column cut, copy and paste operations are effectively eliminated (as nothing lines up vertically) and that is one of the programmer editing constructs I use the most.
I could not live without column editing.
(Perhaps I need to make an emacs keyboard shortcut to toggle font type at the press of a key. Then i could quickly switch to monospaced for my rectangular operations. That might work. Wouldn't help for Xcode or Visual Studio though.)
* The pixel density of your display
* Rendering method (ClearType, OSX anti-aliasing, etc.)
* The size of text you prefer
* How sharp your vision is
* And of course, personal taste.
As a reference point, I'm using Windows 8 on a moderately high-density display for a Windows laptop, at around 140 DPI. I'm old, with less than perfect vision, but it corrects well with my single-vision computer glasses.
My favorite font these days, as I mentioned elsewhere, is Georgia. I just find it so easy to read.
Other proportional fonts I've tried for coding and liked fairly well are Verdana, Cambria, Rockwell, and Source Sans Pro.
The best thing, of course, is to try a few and see what pleases your eyes.
Xcode handles mixed proportional and monospaced fonts fairly well. Comments are in a monospaced font, everything else is proportional.
I assume you were joking, but the issue of ascii art in the comments actually came up super quickly when I switched to proportional fonts.
I didn't realize it until you mentioned it, but Komodo has a similar feature. You can select monospaced or proportional for any syntax element. I think I will try putting comments in monospaced and see how it works out.
Thanks for the tip!
(67% joking - as you know ascii art in comments is sometimes a real thing.)
With regard to indenting vs. column alignment, don't do column alignment. Code is an outline. It's not a spreadsheet. Column alignment is not beneficial in most cases, and it wreaks havoc with source control diffs. Is it really better to code like this:
double someFunctionName( int index, // counts things
SomeType secondParamWithStuff, // fancy object with stuff
SomeLongerNamedType third ) // whatever
instead of this: double someFunctionName(
int index, // counts things
SomeType secondParamWithStuff, // fancy object with stuff
SomeLongerNamedType third // whatever
)
Now sure, the second version may look a bit sloppy if you're used to the first, but it has several real advantages:* Much less horizontal eye movement
* No eye tracking across wide swaths of whitespace
* Changing one name doesn't require reformatting the whole thing
* Since you don't have to reformat, it doesn't generate unrelated diffs
* It works equally well in proportional or monospaced fonts
Oddly enough, many years ago I switched to the second style, not because I was using a proportional font at the time, but because I was really tired of reformatting multiple lines of code just because I'd refactored one variable or type name.
And then some time later I tried a proportional font. My code looked fine in the proportional font, and it was still just as readable in a monospaced font.
WRT 80 columns or whatever your limit is, I just don't worry about that. I generally keep my lines quite a bit shorter than that, but if a particular piece of code is more readable with a longer line, I don't sweat it.
But there are many cases where code works best as a spreadsheet.
For example any time you need to initialise an array of structures, that is best viewed using a grid like pattern.
> but because I was really tired of reformatting multiple lines of code just because I'd refactored one variable or type name. Any decent editor with smart indenting should eliminate most of that effort.
Also if the editor is scriptable editor, it should be possible to create a simple script to semi-automate the task.
Do you ever work in a team?
For example if you do sysadmin scripts in perl and edit with vim and have perltidy installed, its more or less just (esc) :%! perltidy (enter) and it looks beautiful.
Gave up on 80 columns a couple years ago. Haven't looked back much.
The only time I ran into length problems was when I was asked to print my code on A4 paper for an exam.
mixing tabs and spaces is strange and IMO should be avoided, but it sometimes happen :( all-spaces FTW
What legality concerns?
Why would tens of thousands of sites from google be of interest?
And of coure microsoft has the font. It's their font afterall.
"Verdana is a humanist sans-serif typeface designed by Matthew Carter for Microsoft Corporation" [Wikipedia]
Here's how it looks on my system: http://ozansener.com/images/github-browse-file-1.png
Homepage: http://lineto.com/The+Fonts/Font+Categories/Text+Fonts/Akkur...
Here is a side by side comparison: http://cl.ly/image/1j030D031g0U/o
Since people seem to care about it, I should also note that it has a nice slashed zero you can see on line 6 which I prefer to DSM's dotted counterpart.
Edit: Here's how it looks like when I adjust DSM's line-spacing to match Akkurat Mono's default, it still has that busy look: http://cl.ly/image/1z3Z393x1s3l/o
Here's an animation comparing them (Deja is the bigger one, Akkurat the squat one): http://i.imgur.com/lkOzDWN.gif
I really dislike Akkurat's bloated commas and semicolons, the exaggerated "+" (which has not enough spacing, either), and the shallow braces are not good, they look like parantheses.
The only thing I like about Akkurat, I have to say, is the less classical "&". Deja uses the "et"-style ampersand, which looks unfinished at the kind of code sizes used for programming.
But each to his own, I guess.
And that slashed zero is an Ø [1], my friend, not a zero. :-)
Answer is, Akkurat Mono looks rather nice on Retina, going to use it for a while and see if its one of the classics like Inconsolata.
http://cl.ly/image/1j1N3E0k2O10 (Objective-C)
Thanks for linking the font!
http://i.imgur.com/4NhZ3h2.png http://i.imgur.com/yaCGIWG.png
I use it with Sublime Text 2 and the scheme called Big Duo
http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-cod...
or Source Code Pro
https://github.com/adobe/source-code-pro
On Mac, I use Source Code Pro or Menlo.
[1]: http://nodnod.net/2009/feb/12/adding-straight-single-and-dou...
If it's a matter of adding a couple slashes to 7's/Z's or to 0's, that should be reasonably straight-forward to do. In Glyphs, it would be a matter of adding a new shape for the slash wherever you want it. Then File -> Export and you're on your way.
(And obviously you might run into license violations if you're changing fonts you're not allowed to. This post isn't meant to address the legal side of it, just a guy at his desk fixing fonts for his own use.)
(Edit: typo.)
Confusing capital 'Z' with numeral '2' is possible for me; luckily, capital 'Z' is really uncommon in what I create. If I feel it might be a problem, I'm likely to increase the curviness of the top of my numeral '2'.
Anyway, this is all handwriting. Typefaces, which aren't scrawled in haste, have a lot of other tricks they can use to distinguish glyphs.
You can try it out if you select Monospaced from the dropdown here: http://www.linuxlibertine.org/index.php?id=86&L=1
Other than that from that list of fonts, Source Code Pro looks quite good too.
The site needs to make it clearer which font is the best
There is no best font.It's my new favorite now.
Love the retro touch it gives my terminal. Now, if only Gnome Terminal supported phosphor persistence...
http://www.boldmonday.com/en/nitti
I love working in that typeface and have it set to default in Sublime Text and Terminal.
http://i.imgur.com/afWazoB.png
http://en.wikipedia.org/wiki/Fixed_(typeface)
http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
http://www.twoevils.org/html/files.html (TrueType version)
Right now, votes are directly influenced by page order, which I suppose is indicative that people don't feel strongly about their fonts.
We'll definitely be iterating on how we rank and present viewpoints to try to reduce bias. We don't want to remove indicators of popularity entirely, though, since that would reduce the utility of the site for readers who are still trying to decide. We do intend, though, to at least provide enough information for users to judge where there may be bias for themselves, and we'll try to eliminate it where we can.
If you have even a mildly decent display (1920x1080 at 15.6"), pixel fonts are beautiful and readable.
A higher standard would be Menlo and Courier New, both having all those plus the Greek Extended (with accents), Cyrillic, Hebrew and Arabic sets, and a mess of other symbols. Deja Vu Sans Mono is missing the Hebrew, at least the version I have, but adds a bunch of dingbats and miscellaneous symbols. Everson Mono (not mentioned in the subject article and not a great programming font) has even more, all the odd-ball language support like Lao and Gothic.
Edit after checking the others mentioned: Only Menlo, Courier New, and Liberation Mono have Hebrew, a bit of a surprise given how much software is done in Israel. Those three have the largest complements of glyphs, and Liberation Mono is open and free.