Fonts for hackers
xobni.com
xobni.com
Some consequence: the poor spacing of the letters 'i' and 'l', and the squashed, dark appearance of the 'm' and 'w' in monotype fonts. There is something of a hopeless in the task, though, since any good monotype font will have hundreds of characters in it: punctuation, numbers, European letters, mathematical marks...
Making them all look right together, with the additional constraint of identical size, is a Herculean task.
cause if I'm wrong, I seriously need to rethink this small font fetish I have...
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
BTW, after thinking about this, I thought it would be fun to share actual screen shots:
I am currently using "Vrinda" size 10 on my Windows Vista laptop with ClearType -- will probably use a bigger font once I buy a proper monitor.
Some nice discussion and inllustrations around this theme at Coding Horror: http://www.codinghorror.com/blog/archives/000969.html
I just hope I never have work on the same code with you.
There's just so many cases where having monospaced font is useful and easier to read when dealing with code.
And I have not changed anything in my code due to this, so I think you could work with me just fine. There's tabs for indentation, and there's... well, code. What else do you need?
Could you give some examples of these cases? I really haven't come up with any in the past few weeks, and the readability is so much better with variable width.
For example, looking at this: http://www.codinghorror.com/blog/images/programming-fonts-2-...
...the "!" in the conditional is squished into about 3 pixels, but it has just as much importance as any other character, if not more. Glancing at this code you might not even notice it. In normal text it is also important, but would appear at the end of a sentence, which would be hard to miss...but wedged in there between the "(" and "O" it gets lost.
Another example is trying to line up things. This is sort of a style preference, but sometimes I like doing things like this:
float percent = 0.4f;
int width = 640,
height = 480;
char flag = 'A';
Now, when I typed that the text field was using a monospaced font and everything was lined up perfectly. Chances are, you're viewing it with a variable width font... is it lined up? Not really. (edit: ok in this case multiple whitespace characters are converted to a single point but you get the idea)
What about this:
float percent = 0.4f;
int width = 640,
height = 480;
char flag = 'A';
Much nicer, eh?Variable width fonts are optimized for readability of free flowing text like books, articles, etc. Code is highly structured, and lining things up and that sort of thing can help the readability.
Can you give me cases where variable width font in code is better?
So you have these two points, right?
1. Each character is important
2. Lining up things
As a disclaimer, I must say that naturally this is really up to personal taste more than anything.
About 1), I'd say that you are correct, but that depends on the type of thing one is working on. I guess working on some obscure Perl code (that's where I have seen most examples with lots of code that looks like !%&[$tes]) you need to focus much more on single characters than working on for example C++ code with long named variables/function names and mostly calls to them. I am working on the latter, and have found that code like this is easier to read with variable width:
---
TFileName refName;
TXxxYyyInfo* info = iXxx->info->GetPathAndName(refName);
refName.ZeroTerminate();
---
Ok, not too good examples, but maybe you get my point?
2) is something I totally do not care about. I am way too lazy to start lining up anything by hand -- I want my editor to line up my code automatically. And it does a nice job, and I use external tools if I have to work in an environment where I can't select my editor. I don't thins my time should be spent adding spaces.
So to summarize: 1) doesn't seem to matter for me, and if code tends to have many special characters after each other it is probably better to rewrite it for readability anyway. And I don't want to do any lining up by hand anyway.
And descriptive (i.e. quite long) variable names are easier to read with variable width font.
YMMV.
Apparently there's no good way to turn off anti-aliasing in Eclipse on OS X, which drove me absolutely nuts, but this guy came up with a genius (but ugly) hack to fake it:
http://www.partlyhuman.com/blog/roger/aliased-text-mac-eclip...
Admittedly, there's a bit of a learning curve, but once you've gotten over the hump, it's much more pleasant to code "heart smiley lightning-bolt" than all those ugly letters and numbers.
a few months ago i tried setting Vim to use OCR, but for whatever reason it didn't wanna. luckily in my quest i found a free package of fonts: http://en.wikipedia.org/wiki/Core_fonts_for_the_Web#The_font... these are professional fonts that you'd normally have to pay $20 a pop for, but for legal reasons they're free in their packaged form
one of the fonts is Andale Mono, which Vim didn't reject. it felt odd at first compared to Courier, mainly because Courier is quite heavy. but Andale grew on me quick and it remains my font. since then there have been times i've thought my code actually looked aesthetically beautiful
Emacs.font: DejaVu Sans Mono-12 Emacs.background: AntiqueWhite
You'll need emacs from CVS, but it is a huge improvement over previous versions if only for the better font support.
http://www.bitstream.com/font_rendering/products/dev_fonts/v...