Thanks for that! This font looks gorgeous in Terminal. I was just struggling 2 days ago to find a better font because I was fed up with the system defaults.
I love Inconsolata as well -- it's the only font on OS X that comes close to Consolas on Windows. For some reason though IntelliJ cannot render it well at all, so I've resorted to using Droid Sans Mono [1], which is awesome as well.
It's good, but I'd say it's short of perfect due to the similarity of the "1" [one] and "l" [lower-case ell]. Inconsolata-g fixed this, but in a strange way (taking the lower serif off the "1" [one]).
I've recently switched to coding in a proportional width font (right now I'm using Verdana) and I'm never going back. I've yet to be bothered by things not lining up perfectly like things can in fixed width fonts, and overall my code feels more readable and easy on the eyes. I recommend giving it a try.
While I'm not the parent, I can comment on this too.
I program in Python, C, C++ and Java. In all these languages I prefer a proportional font. However I had to stop, mainly because the editors I want to use (Sublime text 2 at the moment) don't support proportional fonts.
Programming in Python, where whitespace is syntactically significant, with a proportional font, seems to be volunteering for an unnecessary burden. Reasonable people may differ.
The only mitigating factor would be that the spaces at the left margin all (presumably) have the same width.
Another proportional font using python programmer here. All significant white space is in the left margin and all has the same width, so not a problem at all.
And those are the only spaces that are significant in Python. Indentation works fine in proportional fonts, just like it does in monospaced fonts. The only thing that doesn't work is columnar alignment after the indentation, and that wouldn't be significant in Python anyway.
Second Verdana. I use it on both Mac and Windows for all languages. It looks and reads better that any of the fixed fonts I've tried. In the first couple of days after I switched it felt a bit weird, but then that feeling went away. I suspect that was due to the fact that I was simply used to fixed fonts and not that there was anything wrong with proportional fonts.
I would consider trying proportional width fonts, but I work on a fairly large team that all touches a lot of the same code. Having bunch o comments not line up may not bother me, but it would annoy others on the team.
Wow! I've had so many programmers react with shock when I tell them I use proportional fonts, that sometimes I think I'm the only one. I'm glad to hear your comments and the others here.
I really enjoy reading text in proportional fonts much more than monospaced. That's true for program code as much as any other text.
Like you, it doesn't bother me to lose vertical alignment. The only vertical alignment that matters to me in code is the indentation, and that works fine in proportional fonts. (The one exception being that the popular two-space indents are really lousy in a proportional font. So I prefer tabs, or if spaces are a requirement, four-space indents.)
In fact, some time before I started using proportional fonts, I'd already changed my coding style to avoid vertical alignment other than the left margin. I used to write code something like this:
function someFunction(aParam, // This is the the main thing
anotherParam, // This is another thing
aParamWithALongerName) { // Remind me what this is for
firstStep(); // Here is a description
secondStep(); // of these three statements
thirdStepSortOf(); // that go together
}
That kind of code is the very reason for coding in monospaced fonts, but why? It is a pain to maintain and keep the spacing right, and in this (fairly realistic) example I find it extremely unhelpful to have all that whitespace separating "aParam" with its comment.
Instead, about ten years ago, I switched to a style more like this:
function someFunction(
aParam, // This is the the main thing
anotherParam, // This is another thing
aParamWithALongerName // Remind me what this is for
) {
// Here is a description of these three
// statements that go together
firstStep();
secondStep();
thirdStepSortOf();
}
Now it may not be as "pretty" to have those comments on the parameters not all lined up as they were before, but it's a heck of a lot easier to maintain, and to my eyes it's easier to read too. The comments about the parameters are not related to each other, they are related to the parameter that each one applies to. With this style I can read:
aParam, // This is the the main thing
as pretty much a single unit, where the excessive whitespace in my previous style made it hard to match up each parameter with its comment.
Having made this change, some time later I discovered that the version of Visual Studio I was using at the time supported proportional fonts, gave it a whirl, and like you, found I really liked it.
It is true that when I read other people's code who've used columnar alignment, the alignment doesn't work any more. But for the most part that just doesn't bother me. In the few cases where the alignment really makes a difference, I just switch to a monospaced font to read that file.
My favorite editor, Komodo IDE (or the free Komodo Edit), does a marvelous job of handling this. Like many editors, you can set up a customized theme of fonts and colors, but unlike any other editor I know of, each theme includes separate selections for a proportional font and a monospaced font. For some reason they don't provide a keyboard shortcut by default to switch between them, but I mapped Alt+O (on Windows) which is unused otherwise. I remember it by thinking "prOpOrtiOnal" and "mOnOspaced". :-) So I can switch between my favorite proportional and monospaced fonts easily, and it also remembers that setting for each file I've edited.
UltraEdit and UEStudio (Windows only) are not bad here either. They don't have an explicit way to select proportional vs. monospaced, but if you press Alt+C to go into column selection mode it switches to a monospaced font while in that mode. So that's a way to view a monospaced file. I wish more editors had this kind of flexibility.
> That kind of code is the very reason for coding in monospaced fonts, but why?
Aligning crap like that is one of the indicators I use to tell if someone is an inexperienced coder. After you write enough LOC, you eventually realize that lining things up is a waste of time. You're inevitably going to insert a line long enough to screw up your alignment, and now you'll have to bungle your diff.
I've tried proportional fonts and gave up as the programming languages tend to emphasize punctuation and put crucial meaning in it, but in proportional fonts the punctuation is a second-class citizen, and this is reasonable for natural languages, but is not good for programming languages.
Could you give an example or two of program code where a proportional font made the punctuation hard to read or stand out less? I'm curious because I've coded in proportional fonts for ten years and haven't found that to be the case myself - with a couple of possible exceptions.
One is names_with_underscores. In a monospaced font, the underscore is the same width as every other character. In a proportional font, the underscore is one of the widest of characters, and much wider than a space.
For example, in the font I'm coding in right now, an underscore is 13 pixels wide, a parenthesis is 8 pixels, and a space is only 5 pixels!
So what happens is that the underscore in a way gives more visual separation in an expression than spaces or other punctuation.
var foo_bar = some_function(one_param, another_param);
To some degree, my eyes group that code this way:
var foo
bar = some
function(one
param, another
param);
My solution for this is simple: don't use names_with_underscores (except when language conventions require it, such as in Ruby), and do add spaces inside the parentheses:
var fooBar = someFunction( oneParam, anotherParam );
Why do the spaces go inside the parentheses and not outside? Well, you need a space in there somewhere, and this just doesn't work for me:
var fooBar = someFunction (oneParam, anotherParam);
Nor this (with no space at all):
var fooBar = someFunction(oneParam, anotherParam);
To me, the space belongs at the same place where I might put a line break if I had a too-long line. I would never break lines like this:
var fooBar = someFunction
(oneParam,
anotherParam);
or like this:
var fooBar = someFunction(oneParam,
anotherParam);
But I do break lines like this:
var fooBar = someFunction(
oneParam,
anotherParam
);
This way the spacing goes in the same place regardless of whether it's a space or a linebreak.
I tried to get down with Source Code Pro, but it's such a radical departure from the popular monospaced fonts like Consolas, Inconsolata, Menlo, Monaco (classic!), etc... that I couldn't do it =(
It's interesting how much of your productivity comes from the subtle/indirect recognition of things. Changing something as trivial your color scheme or font can take a good chunk of time for adjustment.
I'm a huge fan of Ubuntu's monospaced font and use it on my Mac with Sublime.
I've never understood why people code on dark backgrounds with such thick, fuzzy fonts. I find it extremely hard to read and have instead grown used to coding on an off-white background. Fonts are just rendered much thinner in a dark color on a light background (or at least, they seem to be). There's more space between legs and inside the o's in the letters. I find it much easier to read.
I've spent many hours trying to figure out how to convince Vim and/or OS X to lighten up on their font rendering. For some reason the only place I've been able to pull this off is Drracket which I just use for a class, and which has an option to do it. I've never been able to pull it off in my standard coding environment. I can't understand why that option isn't available anywhere else, or on an operating system level.
This is Monaco 12pt in Drracket and Vim, with that Drracket font smoothing option at the bottom: http://i.imgur.com/Va0ZN.png
Is there a good reason there's such little control over font rendering, at least on Mac?
OSX font rendering is optimized for high ppi displays (128+ ppi). If you try to look at screenshots of OSX font rendering on low-ppi displays (i.e. typical Windows laptop with 15" display at 1366 x 768) it's going to look incredibly fuzzy.
On the other hand, ClearType is optimized for low-ppi displays. If you try to view text rendered with ClearType on a high ppi display (128+ ppi) it will look incredibly thin because ClearType attempts to force straight font lines into a single row or column of pixels which is incredibly thin at such a high ppi. That's the very thing that makes ClearType fonts look much crisper on very low ppi displays.
tl;dr OSX font rendering is much more readable on 128+ (or even 220) ppi displays.
I think this comes down to personal preference. I am on a 24 inch screen with 1080 lines and I still prefer reading text in OS X to Windows on it. On my shabby laptop, not so much.
You are correct. The Source Code Pro light variant looks less fuzzy than Source Code Pro (normal). OSX does very fuzzy fonts by default. I updated the blog post to reflect that you should consider the light variant first on OSX.
Also when switching to the retina display the fuzziness goes 100% away.
I find off-white a little easier to read, but the sheer amount of light emanating from a large screen anywhere near white irritates my eyes more so than the strain of reading slightly fuzzy fonts.
"Please note that Source Code Pro comes with varying lightness degrees (I think there was 5 of them)." <- From the comments on this article; might be useful.
>I've never understood why people code on dark backgrounds with such thick, fuzzy fonts. I find it extremely hard to read and have instead grown used to coding on an off-white background.
Because we (I) find them extremely easy to read. I can't stand white or off-white backgrounds.
After years of using Terminus on every single machine, I'm now switching to Anonymous Pro, and I'm liking it very much so far... Maybe I'll give Source Code Pro a try though, and see how it compares to them :)
I pulled Source Code Pro out of brackets a few weeks ago and loved it in Sublime, VS, and ConEMU on Windows and iTerm2 on the Mac. Then someone pointed me at Envy Code R [1]...
I find it much more pleasing with the benefit of great differentiation between 0 O etc...
At the risk of destroying your productivity for the day, you can probably fix that annoying line over your line numbers (that is, http://imgur.com/GhaNq) by messing with your fringe-mode variable. I think I remember its presence having something to do with a conflict between fringe-mode and linum-format.
PragmataPro really is a beautiful font. At first I was concerned that the larger line-height was a poor tradeoff for the decreased width, but it's so much more readable at lower sizes than e.g. DejaVu (my prior font of choice) that I've actually gained rows on my screen without sacrificing readability.
My only remaining concern is that the hypen isn't vertically centered with many of the other symbols, making -= and -> look awkward.
The hyphen problem is fixed in the most recent version!
CHANGES FROM 0.8 TO 0.81
edited by Fabrizio Schiavi 2012-06
* dashrockets
->
<-
<=
=========> 0%
>=
+=
-=
*=
+--------+--------+--------+
are horizontally aligned
* | ¦ "bar" and "brokenbar" are now designed to be overlapped between two lines of text
| ¦ (useful for iTerm2, tmux 1.6., Terminal.app and others)
* horizontal strokes of the letter Nun (U+05E0) is a bit shorter,
to help make it more distinct from Kaph (U+05DB)
* Italic weight is TrueType handhinted
* Bold Italic weight is TrueType handhinted
* added an entire Unicode block:
2100-214F Letterlike Symbols to the Regular weight
* added these letters from the block
1D400-1D7FF Mathematical Alphanumeric Symbols
to the Regular weight:
Amathdoublestruck, Bmathdoublestruck, Dmathdoublestruck,
Emathdoublestruck, Fmathdoublestruck, Gmathdoublestruck,
Imathdoublestruck, Jmathdoublestruck, Kmathdoublestruck,
Lmathdoublestruck, Mmathdoublestruck, Omathdoublestruck,
bmathdoublestruck, dmathdoublestruck, emathdoublestruck,
imathdoublestruck, jmathdoublestruck, Bmathboldfraktur,
Cmathboldfraktur, Dmathboldfraktur, Emathboldfraktur, Fmathboldfraktur,
Gmathboldfraktur, Hmathboldfraktur, Imathboldfraktur
Looks good. However, nothing's going to stop me using TheSansMono[1]. I've discovered this font a while ago and have never looked back. I like the look and all the characters that might look similar have been worked on in order to be easily distiguishable, like the capital O and the number 0, the lowercase l and 1, and so on. Since it's my terminal font it's really the main font on my system and so far it's worked for everything.
I've been using Terminus for years. I've tried several times to get into "pretty" anti-aliased fonts, but nothing beats hard, sharp edges for a long day of programming. I specifically use Terminus with 16 pxlsize on a 15.6" 1920x1080 screen and find that delightful.
Coding with dark text on a white background is much easier on the eyes, too, unless you have a screen that won't let you turn down the brightness.
Pro tip: hold up a white sheet of paper in your well-lit work environment. Adjust your screen brightness to match the brightness of the piece of paper. Your screen should not be brighter than your work environment.
Super pro tip: work outside. Get a professional laptop with a matte screen, one of those lightweight "antigravity" chairs, and find a nice place to work outdoors. A 12x24" piece of wood makes a good lap desk if you need to use a mouse and fits well over the armrests of all of the outdoor chairs I have worked in.
I used the Source family briefly. It's quite nice, although there was something I didn't quite like about it. I replaced it with the Nimbus L family, which is very similar but seems easier to read to my eyes. (on X11, anyway. doesn't look quite as good on OS X for whatever reason).
I added some notes to the blog post about customizing horizontal and vertical spacing of the text. Advanced editors and terminals usually have a setting where you can fiddle this for your own comfort.
The horizontal spacing of Consolas and Source Code Pro are almost identical. The vertical spacing of SCP is much greater, but you're more likely to be able to adjust that in your editor anyway.
While not for me (I love Consolas too much), it's great that we're starting to see some useful fonts under permissive licenses (and from big names like Adobe and Google). I remember back in the day when there were only a handful of fonts that had a license that a) allowed redistribution and b) weren't GPLed.
Worth noting the character set is lacking compared to other fonts such as Consolas or Ascender Uni.
There's too much attention for 0 vs O's and too little for unicode coverage. Personally, I never understood the whole character differentiation thing when most modern editors/IDEs feature syntax highlighting and checking.
Ive been using the VGA font since I started coding borland IDEs in DOS. I just cant find any other font that seems as easy to read. There is even a version of it with lots of unicode characters added.
When I got a retina macbook the resolution meant each pixel of the font was 4 on the display instead of 1 so I tried and failed to find a substitute again. I ended up using fontforge to double the resolution of the font and smoothed it out by hand with some extra pixels. I like it even more now.
...would love to see a comparison like this http://1overn.com/2011/01/31/iterating-on-font-pair-comparis... Consolasa vs Adobe Source Code Pro and also with Inconsolata (though for now I'm using Adobe's font simply for the fact that in sublime text 2 on xubuntu lts both Consolas and Inconsolata render as white squares instead of letters - couldn't figure out it's some weird encoding issue or dog knows what, as in other apps it works great)
I love Source Code Pro - I keep my editor font size quite large (17-18px depending on the font) and the light variant of Source Code Pro is perfect for the large size.
heh. i tend to lump font geeks in with grammar nazis as people who get worked up over the littlest things. while i never understood the reasons why people seem to go to war over fonts - witness the wrath against comic sans - i do appreciate a pretty font and the links in this discussion.
Where in the heck do you download this? I can go to github but I have to compile it, which needs "makeotf", and I don't have that on OS X. At least not right now.
The section titled "Pre-built font binaries" in the README links to the download location, but it's also the standard download location on github (right-hand side, below the clone URL and above the last commit box): https://github.com/adobe/Source-Code-Pro/downloads
Actually, between elementary OS's font rendering settings, great terminal support and unix/linux tools, I'm spending basically every second on my MBA inside my eOS VM.
Your prompt is awesome, mind sharing? And actually you have some interesting config going on with Sublime. The dots next to the files? Is that a source control flag or something?
zsh + oh-my-zsh + 'agnoster' theme (agnoster is now included in oh-my-zsh).
The dots are unsaved files (usually they're files that are open that I've renamed/deleted and thus it marks them as unsaved).
The ST2 theme is "Aqua/Monokai Aqua"
(EDIT: Note, that prompt looks AWFUL in Terminal.app/iTerm2.app. It can be made to look nice if you adjust the palette color settings for your emulator, fortunately, this screenshot is with Gnome-terminal's Tango palette.).
That feature, where you have an overview of the whole textfile in the rightmost column of the left window, what is it called? And is it available for emacs?
Wow, Adobe. An open-sourced font. I cannot believe in such a miracle. I am truly amazed. One of the main proprietary capitalist freak companies decided to go opensource on what? - on fonts - one of the most closed and commercialized areas. Somebody has triggered some magic switch that turns the world into a slightly better place.
The font is not that good though. In Windows it is rendered too wide. Does not seem to be able to replace my current fav Segoe UI Mono that I find more readable.
But now it is a completely different story: we have the source codes! Let's go edit some fonts the way we like!
> Version 4.38 contains 879 characters, covers about 120 language sets and supports ISO8859-1/2/5/7/9/13/15/16, Paratype-PT154/PT254, KOI8-R/U/E/F, Esperanto, many IBM, Windows and Macintosh code pages, as well as the IBM VGA, vt100 and xterm pseudographic characters.
http://levien.com/type/myfonts/inconsolata.html