Input: Fonts for Code
input.fontbureau.com
Input: Fonts for Code
1–10 of 44 posts
Re: Input: Fonts for Code
#2Re: Input: Fonts for Code
#3Totally subjective opinion, but yet to see something beat Consolas.
Re: Input: Fonts for Code
#4Re: Input: Fonts for Code
#5Totally subjective opinion, but yet to see something beat Consolas.
I actually prefer Ubuntu Mono over Consolas or Inconsolata but fonts are a very subjective thing. :)
Re: Input: Fonts for Code
#6Re: Input: Fonts for Code
#7Re: Input: Fonts for Code
#8(I’m a monospace addict, and I always switch between Source Code Pro, M+ 1m, and others. What I don’t like about M+ 1m is that it’s narrow, and the line-spacing in the web font is too small.)
Re: Input: Fonts for Code
#9I mean, it seems that for readability it would be better to emphasize the fact that they're asymmetrical - when looking at "foo(bar)baz" , it would be better if the parens would be a pixel or so closer to their inner contents; but currently "foo(bar" on most fonts looks as if the paren is merging with the initial text.
The same would apply for foo[bar]baz and foo{bar}baz.
Re: Input: Fonts for Code
#10Besides personal preference, I think there are two main reasons people avoid proportional fonts: column alignment and two-space indents.
Two-space indents are an unfortunate trend in coding styles, because they practically mandate the use of a monospaced font to see the indentation. I use tabs for indentation, which let each developer adjust the visual indentation to suit their own eyes. Four-space indents are OK too.
I would love to see programmer's editors provide a way to control the amount of visual indentation that each leading space represents.
Column alignment of course is not possible with proportional fonts, but that's an easy problem to solve: don't do it. Instead of this:
void DoSomethingWithStuff(SomeReallyFancyTypeName thing,
string name
int count,
bool condition);
Write this: void DoSomethingWithStuff(
SomeReallyFancyTypeName thing,
string name
int count,
bool condition
);
While you lose the advantage of seeing all the parameter names lined up, it becomes much easier to visually associate each name with its type. My eyes tend to wander when I have to scan across a wide horizontal gap to match things up.This style also leads to much shorter line lengths as can be seen here, and it's easier to maintain: You don't have to realign things when you change the length of the function name or one of the type names, or when you add a parameter with a longer name than the ones you have already.
A case where column alignment is more useful is ASCII art in comments. I've experimented with using a monospaced font for comments and proportional for code, which solves that problem nicely. But I don't use ASCII art much myself, so I went back to proportional for everything.
I'm looking forward to trying out these fonts!