Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to experiment with all fonts, including those that aren't mono-spaced. I understand the reason for using monospaced fonts, but frankly they don't seem legitimate to me.

For instance, one reason to use monospaced fonts is so that code blocks line up perfectly in the editor. But why couldn't a grid simply be built up from the smallest character in the given font, or perhaps some unit that accomplishes this. It seems like a holdover from ASCII days. I've googled, but can't find much information about this.

Has anyone tried this before, or know of any projects that are trying to enable this? In particular I want to use the fonts in VIM and iTerm2 on OS X.

share|improve this question

migrated from stackoverflow.com Nov 15 '11 at 7:58

This question came from our site for professional and enthusiast programmers.

    
Sounds more like a OS X issue than a font or vim issue... –  Ignacio Vazquez-Abrams Nov 15 '11 at 8:06
    
Some monospaced fonts are proportional fonts that have been edited to look good when they are aligned in a grid. It is basically what you are asking for, but a designer has gone to the trouble of making it look nice in the end. I think monospaced fonts are fully legitimate ;^) –  beroe Sep 24 '13 at 21:54
add comment

5 Answers

I've read a number of blog posts in the distant past written by people who actually prefered proportional fonts for their code. Usually, what they liked about that kind of font was their expressiveness but they invariably needed some very rich syntax highlighting and/or custom external tools to make it work and actually be able to read and understand their own code.

You don't read code like you read a text. One is mostly vertical, the other is mostly horizontal.

Like you know, monospaced fonts are designed against a grid so that each character takes up the same horizontal space as the others. Because of that we can align things and read and understand our code in discrete chunks without much brain work: everything is regular and predictible which is a necessity in our craft.

Because we tend to write short lines and the logical pieces of our source files are distributed vertically most of our eye movements are vertical, that's the natural flow of programming. Monospaced fonts facilitate such movements because things can be neatly aligned and we don't have to move our eyes too much.

Each individual glyph of a proportional font is designed with a different width and different default white space settings. Additionally, such fonts make heavy use of kerning (the adjustment of whitespace between glyphs) which is what actually makes text look good. Remove kerning and any proportional font (even the best ones like Frutiger or whatever) will look like shit. Individual glyphs will still be well drawn but they won't fit with each other anymore and create the distinct rhythm that makes them useful and agreable.

Applying a grid to a text set in Helvetica Neue would result in uneven distribution of black/white and an unreadable mess because we would actually remove the most important feature of proportional fonts.

proportional fonts, are not designed for vertical flow at all. A lot of care is put in kerning to allow for the best possible horizontal rhythm but that kind of feature is totally unecessary in the context of programming.

To finish, you can actually set Vim's font to some proportional font, here is how it looks with Helvetica Neue at 12 px:

enter image description here

and the same file with Inconsolata-dz at 12 px:

enter image description here

I guess these screenshots speak for themselves.

share|improve this answer
    
It would probably be a little less horrible if the anchor of the glyphs was at the bottom center instead of the bottom left. But still horrible. –  Ignacio Vazquez-Abrams Nov 15 '11 at 8:31
    
Yes, I agree with you. –  romainl Nov 15 '11 at 8:33
    
The antonym you're looking for is proportional font. –  Andrew Vit Nov 15 '11 at 10:28
    
Thank you. I had it on the tip of my tongue. –  romainl Nov 15 '11 at 10:44
add comment

It is possible to do many thing with variable spaced fonts, but history has shown, as well is the general opinion that it is a bad idea. Most editors aimed at programmers therefore don't allow you to use them, and rightly so.

Say you were to "draw a box" out of a smallest characters in the given font. And somehow managed to get it to line up.

Put a space in front of one row ... since space is relatively wide, ruins the whole thing. Now you have to either space it several times, ... until widths again match, or ... it's a bad idea. There isn't even a discussion on this one.

share|improve this answer
    
Well, one could screw with the font engine and tell it to draw each character in a fixed-size cell, which I believe the asker was getting at. –  Ignacio Vazquez-Abrams Nov 15 '11 at 8:16
    
@IgnacioVazquez-Abrams - Based on his title and text, I wasn't sure what he was asking. But, whatever it was ... my strong stand on this is that it's a bad idea. EOD. (Btw, yes, nice choice fo words ... :) –  ldigas Nov 15 '11 at 8:35
add comment

I'm using a modified SciTE (windows) which make use of Scintilla (portable from source code) and have switched to proportionnal font after many years as monospace fan. The text is more compact (and eye pleasing especially for long class name) so rarely needs line wrap. The vertical line-up is maintained with tab, which I defined as number of pixels. Adding a 'tabify' routine and using small tab-width (about 3 spaces) you can line up any block code neatly: not only at begining of line but multi-column struct or multi-line #define The catch is your code look bad in other editor, and you have to reformat other people codes.

share|improve this answer
add comment

The Terminal programs lets me set any typeface, not just monospaced. I think I could get used to this!

enter image description here

I am sure you have seen the lists of other styles of Monospaced fonts too... Some free ones and the Wikipedia page

share|improve this answer
add comment

No idea how OSX renders its fonts, but there is the obligatory Old New Thing blog post about all things quirky and historic among computing.

The blogpost talks about how for TrueType fonts, the letters aren't drawn in nice little grids. Some purposely hang out of the grid while others don't. To programatically make the font fit into a nice neat grid requires you to not use TrueType fonts. Hence we have come full circle.

But this is on the Windows side. No idea how OSX renders TrueType fonts, but I am willing to bet this is the reason why all fonts aren't available, besides the whole "Does it support every character?" thing.

share|improve this answer
    
Well, you can use scalable fonts, but they have to explicitly be marked as monospace in the headers (and it helps if they actually are monospace, of course). –  Ignacio Vazquez-Abrams Nov 15 '11 at 8:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.