Live data from Hacker News

Input: Fonts for Code

input.fontbureau.com

31–40 of 44 posts

Re: Input: Fonts for Code

#32
post #14

Earlier quoted context omitted.

Fonts do it because outside of code there is just always a space character inserted before every parenthesis. Adding additional space inside the parenthesis character would just increase that space, something that is not desirable.

The topic is developer-oriented specialized fonts - so there is no such thing as 'outside of code', and in a monospaced font no space can be added since the width is fixed - so my question was about shifting the parenthesis towards the 'inside' within that width.

I was just giving a historic explanation as to why no one might have thought of that. (By the way, good modern fonts actually do a lot in terms of automatically adjusting the spacing of individual letters, and popular layout tools like InDesign offer algorithmic alternatives to whatever the font comes with by default. In proportional fonts “Te” will typically be closer together than “Th” – if you output those fonts with the right program. So fudging with spacing in some automated fashion is not out of the question.)

However, even in code it is desirable to not add extra space to parenthesis, since “foo (bar” is certainly no less common than “foo(bar”. Basically, the font would have to automatically adjust depending on whether or not a space is in front of it to treat both of those cases appropriately. (I think that’s possible with current font formats, so there is likely no technological hurdle to this.) However, that might not be desirable since it might make “foo (bar” and “foo(bar” easier to confuse.

Re: Input: Fonts for Code

#33

This is some truly amazing work. Love the option to change the built-in line spacing. (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.)

Do you use M+1m in a retina display exclusively?

Re: Input: Fonts for Code

#34
post #12

Scanning over the page and the 'explanation' page, I found a headache developing as I tried to read everything there. My experience so far is that I find this far harder to read. For reference's sake, I don't do parameter alignment in my own code (see Stratoscope's comment), but still find it easy to scan code in most-any monospace, probably because my eyes just know where to jump to all the time... For all the words…

Agreed. If somebody likes that — well, that's nice. I even see on screencasts sometimes TextMate with proportional fonts, so obviously somebody will find it desirable. But it won't be me for sure. First off, what I've seen there doesn't seems readable by itself. Second, I don't really see any real benefits of using proportional fonts for coding, while drawbacks are quite big: when I'm tired or just reading quickly through the code I often find myself depending on being able to see that lines with the same number of characters have the same width.

Even more than that (maybe it's something like "professional deformation" already, but I'm fine with it): I've considered using non-monospaced fonts automatically for stuff like LaTeX or markdown, or my own txt notes, but didn't find it pleasant enough. For all the european languages, anyway — typing japanese in vim is a bit painful for me and I don't know languages with more exotic writing system, be it arabic or hindi. I even hard-wrap natural language texts, which would be crazy using proportional font — and am glad I did so, when I want to see it through `less` on fullscreen.

Re: Input: Fonts for Code

#35
This caused me to lookup Sublime Text (3)'s font configuration options and see there were some options I didn't know about. For example, you can add line-height by adding

    {
        "line_padding_bottom": 2,
        "line_padding_top": 2
    }
to your Preferences file. Found this info here in what is also the best version of a ST manual I've seen http://sublime-text-unofficial-documentation.readthedocs.org...

Re: Input: Fonts for Code

#38
post #33

This is some truly amazing work. Love the option to change the built-in line spacing. (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.)

Do you use M+1m in a retina display exclusively?

Yep, I’ve actually never seen it without retina display.

Re: Input: Fonts for Code

#39

Earlier quoted context omitted.

I would say that the problem is "SomeReallyFancyTypeName" where you've created a ridiculously long type name (one of the reasons I avoid Windows programming at all costs). That aside, editors don't handle tabbing very well. It's far more space-efficient to insert two tabs instead of 8 spaces, but space and bandwidth are so cheap these days, no one can be arsed to fix what is viewed as a minor problem (use enough spac…

Thanks for the comments. You're right, "SomeReallyFancyTypeName" was a bit of a strawman on my part. But even with shorter type names you still have the same problems if you use column alignment. I actually gave up column alignment long before I started using a proportional font. I just found it to cause more headaches than it was worth. You mentioned that "editors don't handle tabbing very well". All the editors I u…

This (http://nickgravgaard.com/elastictabstops/) is smart tab handling. All other editor aren't that great, compared to this.
Post reply on HN