Comment by bonaldi
13 years ago
Am I the only one who wants to see multiple, proportional fonts in editors?
Sure, I want to keep the methods themselves in monospaced font, but can't I have the method declaration in a larger size, and comments in a proportional serif?
There is a wealth of design experience out there in communicating things better and more quickly with typography, so why do we not take advantage of that in our IDEs?
Because when people try it, it doesn't look or work very well.
I think it's important to understand that this doesn't mean that such things will never work, but it is also important to understand that almost every idea that you've ever heard of has actually been tried lots of times (lots of lots of times in many cases), and there are often good reasons that they haven't actually been adopted.
As others are already pointing out, the linked proposal bears a striking resemblance to what Smalltalk does, so it's more helpful to ask "Why haven't the many attempts at this approach been successful?" than to ask "Why hasn't anyone tried this?" The first may lead you to a successful variant, the second will lead you down the same garden paths that everyone else went down.
I don't think anything prevents you from setting comments to be a different size and proportional in current editors. I know that it would be trivial in Emacs; some themes actually do that already.
You can try this by doing M-x modify-face, entering font-lock-comment-face then "DejaVu Sans" (or any other proportional typeface) and pressing enter a bunch of times.
In most cases there's little reason to have the code in monospaced font either. People really just need their blocks (and their continuation lines) to be properly left-aligned, and that works fine, because even in proportional fonts, a tab at the beginning of the line is always the same width.
Just don't mix spaces and tabs.
Sometimes you want columns of figures to be aligned throughout, but fortunately most fonts respect the rule that all digits should be the same width (for exactly this reason).
My emacs is set for Dejavu Sans semicondensed bold at 6pt ... I find that for code, bold or demibold works a lot better than regular weight.
Disclaimer: although I really do code in proportional fonts, using emacs is only a 90% solution. It's harder to navigate code when hitting the up/down keys causes your cursor to jump left and right because emacs' proportional-font implementation is just a thin skin over a fixed-width world. I'm still looking for a next-generation IDE which will free me from this kind of issue.
I saw this proposal lately that would allow proportional fonts everywhere: http://nickgravgaard.com/elastictabstops/
No you're not the only one. I've been working on pretty printers for SQL and Clojure, to render their textual representation using html elements other than <pre> so that they keep their indentation, regardless of font style or size (example: http://pastehtml.com/view/bun1zr4o7.html).
Suns Fortress language was kinda interesting experiment in that direction: http://software.intel.com/en-us/articles/first-impressions-o...
You can already do this with barely any effort at all in emacs. M-x customize-faces and then set the method face to be larger or a different family.
Source insight does just that: http://www.sourceinsight.com/features.html
Like this? http://i.imgur.com/8XYfb.png
Textmate 2 supports it if that's what you want.
No you're not the only one. I've been working on pretty printers for SQL and Clojure, to render their textual representation using html elements other than <pre> so that they keep their indentation, regardless of font style or size (example: http://pastehtml.com/view/bun1zr4o7.html).