Hacker News new | past | comments | ask | show | jobs | submit login
Hack: A typeface designed for source code (sourcefoundry.org)
521 points by erickhill on Aug 29, 2015 | hide | past | web | favorite | 243 comments



Hack is DejaVu sans mono. Below is a gif I took switching between DejaVu sans mono and Hack. Aside from line height I fail to see the difference.

http://gfycat.com/SomberUnitedGermanshepherd


They do acknowledge the source of the font:

"Hack has deep roots in the libre, open source typeface community and includes the contributions of the Bitstream Vera & DejaVu projects."

It's a bit disingenuous though. I'd call Hack a straight copy of Deja Vu Sans Mono, with a few very minor tweaks. On Linux using the TTF fonts I can't even see a difference in line height:

http://i.imgur.com/wxTr0at.png

http://i.imgur.com/OO1bJFE.png

The only glyphs I can tell which are slightly different are 'i', '0' and '_'.


Adjusted and combined your examples to a gif. The one with the red square is the Hack font.

http://i.imgur.com/8SqL6mT.gif

Aside from '_', 'i', '0', many of the changes are so minuscule that it feels more like a change for the sake of change. Some however are nice, like the parenthesis placement, cleaner 'r'.

One thing I really don't like is the change to a serif-style comma. They've probably argued that it improves readability, and prefer that over typeface consistency.

They should emphasize more the previous work they are using, otherwise they might come across as ... hacks.

I'll probably stick with inconsolata though. But good job, nonetheless.


> Some however are nice, like the parenthesis placement

I see the parentheses as problematic on their own. When I read the functions that don't have any arguments, it looks like they have one space character within the parentheses!


Thanks for combining these images. The red square was really clever for peripheral vision identification of the image.

I agree with a lot of what you said here. Weirdly, they went sans-serif with the 'i' and serif with the comma. I'm personally a fan of commas, semicolons, and quotations having the same visual flavor and the Hack changes went farther from that.


I can't stand the Hack 'i'. It's awful.


To turn the conversation to a slightly different direction:

this is a great case study of the kind of effects branding can have. Dejavu sans mono, an otherwise boring and established font, especially for those using Linux, somehow just seemed something sexy and exciting because it's a newly released, specially made font called Hack, it's a font that represents a very fundamental paradigm shift in how fonts have been, the seamless legibility this font offers is unprecedented. This font is finally the one thing that will enable you to code better than you could ever before. You can't wait to try it out, can you. Go ahead, take it out for a spin. Set your terminal to use Hack, open up vim, and write up a helloworld.c program. You won't believe it -- it'll all come out beautifully and without effort, you'll find the code writing itself through you.


By "deep roots" they mean a copy-paste job with a linear transformation. LOL.


In any other medium, we might call that plagiarism.


Fortunately we can call that a fork, since they comply with the license.

https://github.com/chrissimpkins/Hack/blob/master/LICENSE.md


Copyright infringement != plagiarism. They're not violating the copyright because they abide by the terms of the license.

They're also not plagiarising because they clearly cite its original source. They even go so far as to say "deeply rooted in" which seems to me like a euphamism for "virtually identical to".

The point here isn't that it's illegal or immoral, just kind of uninteresting.


If, for example, someone repackaged a public domain font without attributing source, I wouldn't call that plagiarism either.

In my definition of plagiarism it implies unauthorized use (i.e. not complying with the license) but I guess that's open to interpretation.

So it'd still be uninteresting, unimaginative, not original work... but not plagiarism.


"," too



"i" is different. Don't see anything else though.


Hack's "i" is not an improvement IMHO, they made it less distinctive from "l".


I feel like the tail on the i is too long.


That was the one thing that stood out for me too


Top of the lowercase 't'.


Comma and colon are also quite different.


If you look more closely you'll see that many of the glyphs are changed, most subtly. The lowercase "i" is the most significant change I saw.


There are some very minor changes, but this got me thinking about tricky fonts are compared to software development in general. You can fork a font on GitHub and make some changes, but you can't really merge them back into the original font because fonts are expected to be entirely static. Perhaps they could accept pull requests for a DejaVu 2 or something.


It doesn't work for Helvetica or Arial, but less-famous typefaces can change pretty significantly over time:

http://www.fastcodesign.com/3033126/roboto-rebooted-why-goog...


Interesting. I hadn't thought of that before, but those examples seem to embody the struggle in the transition from classic print design to modern digital mediums.

I imagine someday we'll see more typefaces versioned like software, instead of alterations receiving new names. Or is this already happening?


So that's why my editor is not changed at all after using Hack, I feel guilty blaming my editor, I thought it's broken.


For the first obvious difference, watch the 'i' in 'login'.


Lowercase and i hyphen are very different. Some other characters I'd have to see better aligned to tell.


If it's not very different from DejaVu Sans mono, why not use the latter itself in the first place?


No one has yet mentioned the ultimate hacker font -- Glass Tty VT220:

http://christfollower.me/misc/glasstty/

Then there's UW ttyp0 for those who still prefer their fonts bit-mapped:

http://people.mpi-inf.mpg.de/~uwe/misc/uw-ttyp0/

And UniVGA, an emulation of the VGA font that provides much of Unicode (useful for a little Turbo Pascal nostalgia trip with an appropriate color theme, or the FPC IDE):

http://www.inp.nsk.su/~bolkhov/files/fonts/univga/


That's ludicrous. You can get better scanlines by using Cathode or Cool Retro Term, and the latter comes with the beautiful 3270 font that stands upon the long clean design heritage of IBM's 360/379 line. This beautiful font, by the way, you can take for a spin on any civilized operating system by simply typing `apt-get install 3270font`. Go, try it.

http://www.secretgeometry.com/apps/cathode/

https://github.com/Swordfish90/cool-retro-term

https://github.com/rbanffy/3270font

;-)


If you're going for "Hollywood Hacker", a huge green OCR-A font is also pretty great.

http://i.imgur.com/dg5oMqS.png


ttyp0 is way better than Terminus, which is so popular among Linux/Unix people. But if the world ever goes HiDPI, I guess bit-mapped fonts will die out.


> But if the world ever goes HiDPI, I guess bit-mapped fonts will die out.

No, it's the other way around. Anti-aliasing is a hack to make low-res displays slightly more palatable. Once the resolution gets good enough, there's no point in anti-aliasing your fonts anymore, and bitmaps start making a lot more sense.


How is anti-aliasing related? I was thinking about rasters: if you don't have many pixels, you need to use every single one the best possible way, so you manually layout every single pixel. If I have a ton, I can draw any vector glyph and I would not need to micro-manage the pixels. Can you elaborate or give me a link?


It takes far less cpu time to draw a bitmap than to draw a vector shape. An in-between solution is to pre-render vector shapes into bitmaps for later use; this is what METAFONT does.


I tested the 3270 on HiDPI displays (Mac and Linux) and it was glorious. Seriously.


I'm slightly surprised that almost nobody here uses Menlo or Monaco, even though several screenshots in the thread are clearly made on OS X.

I'm curious why that's the case. Do people generally dislike the system-provided fonts or are the alternatives considered "better"?


I love Menlo and use it almost exclusively, but the inline asterisk makes people upset for some reason. I personally prefer an inline asterisk.


Holy shit. You just made me realise why I actually love Menlo. (I'm an iOS dev, so I type and see a shitload of asterisks on a daily basis.)

Many alternatives "felt" wrong, but I never quite could put a finger on what's wrong with them.

Inline asterisks definitely feel just right at home when writing Obj-C.


Monaco 10 is the only true code font :) That is, until I get myself a retina Mac, of course.

Then I'll use an undecided vector font and the last remaining piece of resistance from classic Mac will be gone.


That's painfully true. When I got my 13" retina mac, I literally couldn't decide on a terminal font for two weeks, switching them every few hours.

Nothing looked right. Nothing does even now, half a year later. Though personally, 12pt Monaco feels least "wrong".


So true! The only thing I dislike about my retina Mac is that Monaco 10 no longer looks right.


I moved to Inconsolata (with subpixel font smoothing):

https://discuss.atom.io/t/why-is-the-text-display-inferior-t...


Menlo is nicely tuned for retina displays.


I'm a huge Monaco fan. Slightly disappointed that Apple chose a Bitstream Sans derivative for its default monospace font. I don't dislike Bitstream/Deja Vu/Panic Sans/Menlo - it just feels derivative at this point and Apple often take opinionated stances on typefaces.

Nothing beats the lowercase "a" in Monaco.

I feel like it has a bit of whimsy that other fixed with fonts don't have. It's not stuffy or pretentious. None of the bowls are circular or ovular (except for the "o") all of the ASCII range characters are distinct. It looks great in its bitmap or anti-aliased vector versions.


I came to Mac OS recently from Linux and while I like Menlo, I found myself quickly going back to Inconsolata[1], which is really great for long coding hours, and works especially well for me with the dark solarized color scheme.

[1]: http://www.levien.com/type/myfonts/inconsolata.html


I've been using Monaco for Powerline for quite a long while now. The main issue is that most of the builtin proportionally-spaced fonts have some glyphs which are difficult to distinguish. Monaco gets the job done but other people prefer slightly different glyph styles or want to make their own fonts, more power to them.


+1 for Menlo. I've tried all the fonts recommended here on HN and I always go back to Menlo.


I've been using Monaco 9 since I first started hacking away in HyperCard and BBEdit, and when OS X started screwing up the antialiased version of it I switched to ProFont which looks identical but scales properly


I use Menlo in both the terminal and my editor, and am sure A good portion of of my coworkers use Monaco.


Yes, Menlo is my go-to font, I use it in the terminal and with Xcode. Always had.


I desperately want to find a new code font to love but I always return to Consolas.


Have you tried Source Code Pro (http://adobe-fonts.github.io/source-code-pro/)? It's my go-to now when it comes to monospace fonts. I keep it installed on all my systems, right along side my dotfiles.


Here's another vote for Source Code Pro. It's an amazingly attractive font. I'm glad I discovered it.


Trying "Source Code Pro Light," it reminds me of one of the fonts on Solaris CDE but a bit more sensible.


Aha! You're right...


Does it show more lines than consolas in the editor? I just measured Hack with Consolas (9pt) in VS.NET, and Hack shows 54 lines, Consolas 65 (and for reference, lucida console 131). The page you linked to shows the typeface, which is nice, but it's hard to measure whether it's a font that's going to lead to more lines or less lines in the editor.


I switched from Consolas to Source Code Pro after I switched to a 4k monitor. On a 1080p display, I think I still prefer Consolas, but Source Code Pro is absolutely beautiful on a high-dpi screen.


I use source code pro lite on everything that requires monospaced fonts now. I use source sans pro a lot in documents / email.


Yeah, this is my go-to as well.


I've been using Source Code Pro Light for quite a while. It's great.


Mine too, especially for the light version for non-retina OSX!


I'm particularly fond of semi-bold. I find light is too narrow for my vision and taste. After a while of using the light version, it starts to blur together, but semibold works well. But my wife uses light and regular on her high DPI Lenovo.


Well, I'm glad there are these variations for peoples preferences, I wish multiple font wights was a more common option.


I love it too, using it on Xcode and iTerm


Can you set iTerm to use Light as the Regular font and then use Regular font as the Bold font?


For a complete change of style it might be worth having a look at fonts designed assisting those with dyslexia. Designed for uniqueness of glyphs and for minimising eye strain.

https://gumroad.com/l/OpenDyslexic# http://dyslite.com/home/download/dyslite-mono-dyslexic/

I've used them for several years ( even though I'm not dyslexic ) and now find 'normal' terminal fonts to be extremely harsh on the eye. Probably the best change I've ever made to my programming environment.


Despite having a different proposition and use-case, FE-Schrift seems have ended up with a similar yet much more aesthetically pleasing outcome. It doesn't have lower-case, which is a deal breaker for programming at least though.


Paid, but interesting:

Pragmata Pro: http://www.myfonts.com/fonts/fsd/pragmata-pro/ Triplicate T4c: http://practicaltypography.com/triplicate.html

Something a little different:

Fantasque: https://github.com/belluzj/fantasque-sans


I use Triplicate as my standard fixed size font everywhere. I love it!


+1

That's a strange feeling, huh? It's similar to how we always want more (money, vacation, etc.) in life, but when we get there we just want more again. I've had the thought about Consolas many times; "Why do I keep looking for a new one when I like Consolas?". I think the answer is that we always seek novelty, because that drives evolution.


A change in environment boosts productivity, doesn't it? I read somewhere, maybe in Peopleware, that in a lighting study, they found any change (brighter, darker) to a workplace imported productivity. The idea being that it was just the change, not really mattering what was changed.

Perhaps it reflects poorly on me, but I love novelty. Different places, new software, new languages (or improved features) - it's great. I'll get a huge boost working on a shitty desk in a cold hotel, for a week. I started learning Ruby, and while I find it revolting in a way (it's like the opposite of elegance), I'm enjoying learning it.

This must be a well known effect, as MS seems to make small but very noticeable cosmetic changes to their UIs. I feel ... something when using the older version. Something slightly beneath my conscious perception, something that changes and feels fresh when I upgrade. (Similar but not quite the same thing when I use a shitty cross platform UI that doesn't get things quite right.)

I should probably collect a few good fonts and color schemes and rotate them automatically.

And you know, it doesn't really matter when working. But the novelty is very useful to get me going. Once I'm rolling on a project, I can be in any broken environment and stay in the flow.


I could not agree more with almost everything you just said, even the Ruby bit (did the same thing, even bought a book, though I gave up a little prematurely).

The only time seeking novelty hurts me is with side projects. As soon as I get used to the project I lose site of the bigger goal, and then I just want to start a fresh, new side project.


What language would you say has elegance? I'm thinking about learning a new language.


Haskell has elegance. Quite a different kind of language if you're not used to it, though. I found it a pleasure to learn a bit of Haskell.


I've tried them all, Consolas included, and nothing even comes close to Dina -

http://www.donationcoder.com/Software/Jibz/Dina/index.html

† That's for Windows, not Macs.


I'm a big fan of Dina too. The original font is a bitmap font, however, and not all software still supports bitmap fonts. There's a working TTF version linked from here: http://chrisrickard.blogspot.co.uk/2010/03/dina-font-for-vis...

It's TTF in name only; at the right size, it's hinted so that it works just like a bitmap font. It doesn't scale.

I use it for all my terminals and IDEs on all platforms.


Dina used to be my go-to font as well but a few years ago I switched to Anonymous Pro [1] as it tends to be more recognizable at the small font sizes which I use.

[1] http://www.marksimonson.com/fonts/view/anonymous-pro


Another vote for Anonymous Pro.


I'd consider profont much more beautiful than Dina, personally.


I've been using the X 6x13 font for about 12-13 years. Though these days I've had to switch to a TrueType one that looks the same - presumably reproducing the pixels with hand-drawn boxes...

Hack is quite nice in terms of the aspect ratio, but in common with many modern fonts it doesn't look very good at low point sizes on a ~100dpi monitor. Not exactly unexpected - nobody bothers to hint their fonts any more, and/or provide bitmap versions for low point sizes - I'm sure it takes ages anyway and most people won't care - but still a shame. I have antialiasing switched off on Windows, and Hack looks pretty horrible. But 9pt non-AA Arial Unicode MS shows delightful-looking small fonts are possible...

Looks good on a retina display though. Just need to replace all my monitors with 250+dpi ones and I'll be set!


I use Fantasque Sans Mono - I love its subtle character! https://github.com/belluzj/fantasque-sans


I use Inconsolata myself.


Same here :) I was a lucida console user for years (and before that Courier) but as I passed 40 my eyes told me it would be better to use something else. Consolas it was, and I have to admit, it's great.

I tried hack, it looked OK (in vs.net) but the 0 (zero) didn't render with the fill-in but open. That of course sucks, as for a programmer a 0 has to be different from O. Perhaps it's something related to vs.net's rendering, not sure.


Ditto. On linux I fancy terminus though.


I really like Terminus. I started using it last year and I'd be hard-pressed to switch to anything else.


Seconded. Terminus is really amazing. But I've been trying Hack for a change after many years of Terminus and I find it rather pleasing.


Tamsyn [1] made me switch from Consolas. Now I am not even looking for another font. It is so perfect. But it being a bitmapped font, I get only two sizes. But I am so happy with it that I don't even mind...

[1] http://www.fial.com/~scott/tamsyn-font/


Here is a very different font: https://github.com/mikekchar/MUmePlusGothic

I sometimes need Japanese characters on the console, so I got in the habit of using this font. The only thing I did was return the backslash character to be an actual backslash character (rather than yen symbol, which most Japanese fonts do).

Sorry, I don't have a picture of it (and I couldn't even find a good picture because they only show Japanese characters ;-) ). It's quite a nice programmer font, but just about the opposite to Consolas. Consolas is short and wide, whereas Ume Plus is very narrow. This gives you more columns, rather than more lines. I often split my screen left and right (tests on the right hand side) and due to poor vision, I have massive fonts. This gives me a few extra columns to work with.


There seems to be an issue with its lowercase "g" (Sublime Text 3 on Windows 7): http://i.imgur.com/CWCcR60.png


As a retro-computing geek who had an early contact with IBM 3278 terminals, I am very fond of their font. So much, in fact, I recreated it based on earlier bitmaps that trace their history back to a student who copied it pixel by pixel from a real terminal. May not be your piece of cake, but you can try it:

https://github.com/rbanffy/3270font

When I can't use it, Terminus is a favorite. A long time ago I added a central dot to Luxi Mono's 0 and used it as my terminal font for a long time.


Same situation here, except that it's Courier New that I always return to.


Have you looked at Courier Prime? I like it a lot. http://quoteunquoteapps.com/courierprime/

// Looks like they've added Courier Prime Code.


Perhaps check out PragmataPro. It’s a true work of art.

http://www.fsd.it/fonts/pragmatapro.htm


A couple of other suggestions I like but nobody else ever seems to mention:

Meslo LG [1] Droid Sans Mono [2] - the version with the slashed zero

[1] https://github.com/andreberg/Meslo-Font [2] http://www.droidfonts.com/info/droid-sans-mono-fonts/



Check out Office Code Pro. It's a custom version of Source Code Pro, and slightly more readable in my opinion.

https://github.com/nathco/Office-Code-Pro


Since everyone's mentioning their favourite code fonts -- any love for Ubuntu Mono? I know it's not trendy to like the OS default as a non-Apple user but I find myself always coming back to it when I see it in comparisons.


I love Ubuntu Mono as well. I even installed it on the Windows side of my desktop even though I do pretty limited coding there.


From what I can gather this font is almost identical to Ubuntu Mono.


The 1Il are a little more distinguished in Ubuntu. Also, look closer at the stem of n and u. Ubuntu is also weighted heavier I think.


The "m" in Ubuntu Mono is just so adorable it makes me smile every time.


I Ubuntu Mono on all my machines.


In addition to just being a nice monospaced font, I like that its non-monospaced version, Ubuntu, is also available. I can use Mono in my source and non-Mono in my desktop UI and everything looks consistent.


My favorite.


I use Hasklig, even though on a different language. I love having ligatures for common symbols. I should pick up fontforge again and adapt it to PHP

https://github.com/i-tu/Hasklig/


I love this and want to use it; I just wish there was a proportional version. I've spent a lot of time trying to figure out how to hack OTF to do my own programming font (proportional with programming-specific ligatures), but the how-to information available on the web isn't very complete.


The use of ligatures in Hasklig is very intriguing. Would really like to see more work in this vein. Could see benefits to Clojure (arrows) and even => in JavaScript.

EDIT: Looks like FiraCode has ligatures too https://github.com/tonsky/FiraCode


This could be really cool, but I can also see it getting distracting and increasing oversight. The >= and <= signs look nice in Fira Code and Hasklig, but I worry I'd accidentally see them as > and < when debugging. Either way, I can't really try it because neither of those are usable in vim with iTerm2 and I'm not changing my whole toolchain just to try a font.


Oh my yes, this is very nice indeed. Probably the first real advancement I've seen in programming fonts in decades.


Hm. I was hoping maybe neovim (being, in some sense - "new" vim) might have fixed this -- apparently not (yet) -- looks like it's still modelled too closely on vim (not that that's a surprise, or all bad -- I suppose it was too much to hope for that this kind of design errors would be (easier to) fix(ed) this early:

https://github.com/neovim/neovim/issues/1408

Proper font handling is actually one of the few things that I find troubling with these "old" nix tools.

The combination of nice font handling and otherwise being lightweight (and working fine without any borders, which makes sense when paired with xmonad for a window manager) was one of the reasons I moved to Sakura:

http://www.pleyades.net/david/projects/sakura

(Not on my Linux box atm - so unable to test if ligatures actually work -- but either way it would appear vim does a little too much -- so even if the terminal handles ligatures, vim will not. Time to upgrade to ed! ;-)

I wonder if kakoune[1] supports ligatures in a capabable terminal? I'm guessing not, but have yet to try.

Also, I just discovered that AbiWord actually have a setting to get vi(m) keybindings -- not that I'd suggest moving from vim to abiword for editing code...:

http://www.abisource.com/wiki/Keyboard_bindings

Based on the issue[2] for Emacs support, it looks like the general "easy" approach is monkey-patching from two-symbols to unicode ligatures and back on the fly. Such an approach would probably work with vim too -- it'd probably be just as well to handle that bit via a pre/post processor -- and just type in the combined symbols directly in vim (eg: iab >= ≥ to insert the symbol for "greather-then" rather than >= -- and then just deal with editing that as a single symbol. You'd need to run the source through a transformation to change all occurrences back -- for most langauges -- so I'm not sure if it's really a good idea. But seems simpler if you just want ligatures, and there's a unicode glyph that matches the ligatures you want.

Ahem, well -- from the Haskling site: "Some Haskellers have resorted to Unicode symbols (⇒, ← etc.), which are valid in the ghc. However they are one-character-wide and therefore eye-strainingly small. Furthermore, when displayed as substitutes to the underlying multi-character representation, as vim2hs does, the characters go out of alignment."

So then again, maybe not. I suppose we just have to wait for the next display server tech to reinvent display PostScript along with a friendly API ...

[1] https://news.ycombinator.com/item?id=9764028

[2] See gist linked from issue: https://github.com/i-tu/Hasklig/issues/10


I think, you may get oddly looking code with such ligature fonts if you declare your own operators that contain ligatured pieces as parts.

For exmaple the operator >>== will probably have the first three characters joined in the ligature {>==}=

Operators ==== and (four asterisks) may look very strange too.


When using a text editor or IDE that does not allow the user to adjust the line spacing (aka "leading"), my choice of programming font for the last 1.5 decades has been Lucida Console. It has tighter line spacing than any other monospaced font I've seen, thus displaying more lines of code within a window of a given height. Every time I hear about a new font designed for source code, I try it out, and am consistently disappointed at how far apart the lines are spaced. I haven't tried Hack, but looking at the screen shot it seems no better than other fonts in this regard.

Font designers never seem to consider tight line spacing as a potential selling point, and that makes me sad. :-( In fact, wider line spacing is sometimes touted as an advantage, for readability.


That is a customizable option in Sublime Text, which is my primary editor.


Comparison with Fira Mono at 12px: http://screenshotcomparison.com/comparison/140470

I'll stick with Fira.


The 'f' is really ugly, and the * not being centered is a shame (it's used so much in source code for ⨉, it really should be vertically centered), but the reduced number of serifs is nice. I also like how === has less spacing between the lines, which fits common source code conventions which use = for underlines and horizontal rules.


Here's the same with Source Code Pro: http://screenshotcomparison.com/comparison/140474

I'm liking the asterisk and kerning in general. It's taller, so it feels a little more cramped between lines. That might be a dealbreaker for some.


I think you've made a mistake. The a glyph in your demo doesn't look like the glyph in the Github repository...


Is it just me or is screenshot comparison useless on mobile?



On my Mac, Hack has increased leading (space between lines) which makes it more readable. Quite a bit more IMO. I'm curious why your screen shots show identical leading.


Compared to Fira or compared to Hack rendered on my system? Are you using Atom/WebKit too? Same font size?


Hack has greater leading compared to Fira. I notice it when viewing in either Xcode, TextMate or Android Studio.


Whoa, really? Fira already has a much larger line-height than nearly any other mono font I've used.


They've reduced the line-height quite a bit in one of the more recent versions.


Fira at low res without antialiasing and without retina display looks right. I'd choose fira.


Another coding font worth mentioning is Anonymous Pro

http://www.marksimonson.com/fonts/view/anonymous-pro


I've use the same page[0] for the last 4 years to decide on which font to use for coding on new machines. I see Hack has been recently added!

[0] http://www.slant.co/topics/67/~what-are-the-best-programming...


Why does source code have to be shown in fixed width? I've been using non-fixed width fonts for about a year now and I find it much nicer on the eyes. The only downside I've found is that sometimes things don't line up quite as nicely, which is purely cosmetic.


If you use vim keybindings, it's certainly nice to be able to move between lines without your cursor jumping around.


Most people consider that anything but cosmetic.


Well the indented parts will always line up correctly (since all they have before them are spaces or tabs), the only problem is if you use spaces for alignment after you've already typed some text.


the one true argument alignment style™ does not work (well) with variable width fonts:

    retval = select(readFDCount,
                    &readFDs,
                    NULL,
                    NULL,
                    &timeout);
or:

    d = [NSDictionary initWithObjects: objects
                              forKeys: keys
                                count: count];
added


The first would be easy to simulate semantically, treating the leading whitespace as a flexible tab stop and thus replacing all the leading spaces with a space of the appropriate width (basically, the editor would replace the leading spaces with `retval = select(` with opacity 0).

The second would be more difficult to handle, but so long as you know what to look for to indicate the style is being done it could be handled perfectly intelligently. It’s not the simplest thing, but it’s perfectly feasible.

Basically, variable width fonts can become fine so long as you also have semantic understanding of what is being achieved with whitespace. The use of monospace fonts is a cop-out, pure laziness. [Yes, I am deliberately stating this more strongly than I believe. It’s an understandable laziness, as the problem is hard and the industry and tooling all backs monospace, but it is laziness.]


Elasti-tabs can handle the first case, though I don't really see why you would want to bother. The second case...I don't think is reasonable.


Couple replies, but nobody stated the (to me) obvious. My source code is displayed in the same font as everything else in my terminal, and using a variable width font for terminals yields some pretty insane results.


My solution to the things not lining up nicely was to give up column alignment completely. In fact, I did that long before I started coding in proportional fonts. I think it was giving up column alignment that opened my eyes to the possibility of using proportional fonts at all. If you don't use column alignment, code looks pretty much the same in a proportional or monospaced font.

BTW my favorite coding font right now is Trebuchet MS on a high-DPI display.


I went through a stint of coding in proportional fonts about 15 years ago. Mostly, I liked it (I used to use Verdana myself, I think?) - you can often get a fair bit more on screen widthwise, which means you can have more files side by side, and the overall appearance is quite pleasing.

Don't recall anything specific that got me to change back, but change back I did in the end. Just a bunch of small things adding up, really, a combination of limitations in commonly available tools, and the repeated need to print nicely-formatted tabular things to the all-pervasive monospaced text console. Swimming against the tide just ended up being more hassle than I felt it was worth.


It does not have to be. Go ahead and use nice proportional fonts and never looks back. There are certainly no shortage of them that are high quality and easy on the eyes.

But for the rest of us, having a fixed width font is as important as any other consideration. And we're always on the lookout for a fixed width font that's as pleasing and readable as you proportional font people enjoy. Don't be jealous of us getting all the articles and blogs, because those only exist because we're jealous of you and trying to catch up.


On the other hand, I don't think I've ever seen a proportional font designed specifically for programming in. Like, with the same "make sure 1/l and 0/O look different" considerations programmers' fonts get, but proportional.


You should check out Input, which is exactly that. I've been using it for a couple of months, can definitely recommend it. The only issue I've run into is that certain features in Sublime Text don't work so well with proportional fonts, such as indent guides.

http://input.fontbureau.com


The preview page is amazing.


I've been using Trebuchet MS for coding, and it does a good job on this: all the confusing pairs are easily distinguished. For example, the lowercase "l" has a little rounded hook at the bottom to it doesn't look like a capital "I". It's not perfect, but I've been enjoying using it.

Before that I used Georgia, which is also fairly good in this area. I stopped using Georgia because it rendered poorly with too-thin stems in Windows 8.1 on a MacBook Pro Retina. Looked fine in OSX and on my ThinkPad's 145 DPI display.


The most common concerns are a result of the font being monospace.

In most proportional fonts, 1 has a hat, and l is a vertical line; and 0 is a thin, squared off oval; while O is almost a circle. The characters become similar in monospaced typefaces so that they can fill the rectangle they're supposed to fill.

I and l are often indistinguishable; but there's no shortage of fonts that put the extra strokes onto I [eg: Verdana, Tahoma, every serif font...]


I've used "Untyped" and "Trim" from this collection[0], and they were plenty readable. They take care of ambiguous characters and provide a wider space character than general-purpose proportional fonts.

[0] https://code.google.com/p/i3project/wiki/Fonts


Serious question: what kind of codebases are you working on where there tokens in which it's not immediately obvious from the context whether they contain digits or numbers? I have never seen such a situation.


Proportional is still very contreversial. A few of us have made the transition, and won't go back to fixed-width, but many value the ability to do ASCII art (aka space-based alignment). Other than that, there is absolutely no advantage to using a type writer font on a modern display.


I've been using a proportional font since the beginning of the year. It took one week to adjust (things look weird for a few days).

I tried the Input font time ago and didn't like the way it looked, but maybe I have to fiddle with its settings and find a way to make it look nicer. I'm using DejaVu Sans inside emacs now. The only shortcomings with the font are that l (lowercase el) and I (uppercase I) to be indistinguishable, but it's rare that they cause trouble. Uppercase o and zero are distinguishable (zero is narrower), but maybe a marker inside the zero would be handy. Not sure about that. Context usually is enough to make them apart.

Overall a page of code formatted proportionally is much nicer to look at than a monospaced one, so I'm not going back.

It would be nice for editors to support alignment with proportional fonts inside lines (see http://nickgravgaard.com/elastic-tabstops/). Maybe this is not going to play with Python and similar languages but automatic transformation of spaces into tabs and vice versa has been around for years and we have more CPU cycles than we need now.


Proportional fonts do not work well with space-based alignment, but are fine with tabs.


Actually, you can't reliably use tabs for column alignment with proportional fonts. You can get everything aligned for the font you're using, and the tab width you've specified in your editor, but when someone else views the code in a different proportional font or a different tab width - or in a monospaced font! - they will likely see "off by a tab" errors.

Proportional fonts do work fine with tab-based indentation. If you stop using column alignment, as I did many years ago, then it no longer matters whether you use proportional or monospaced fonts, and it doesn't even matter whether you use tabs or spaces for indentation. All sorts of code fomatting questions just become non-issues.

And column alignment was always such a hassle, I was glad to give it up anyway. Column alignment is a pain to maintain - it all too often just ends up misaligned after people work on the code, it messes up version control diffs, and the occasions where it helps readability are easily matched by the occasions where it hurts readability.


But is rare that you're the only one changing and using the code. Fixed width code looks similarly aligned on all systems with fixed width fonts.

A code written in Helvetica would render bizarro on an editor running Futura.


> A code written in Helvetica would render bizarro on an editor running Futura.

Don't be so sure of that. If you were to load any of my code in your favorite editor and font, you would never know that I wrote it in a proportional font or what font I used. It would just look like ordinary well-formatted code.

The reason is simple: I don't use column alignment at all. Column alignment is the only reason that code formatting would ever depend on what font you use or whether it's a monospaced or proportional font.

Without column alignment, it doesn't matter in the slightest what font you write the code in or what font you read it in. Proportional, monospaced, any font you like. It will look fine.


That is interesting. How exactly do you format your code? I'm super curious. Maybe a code sample? :)


> Why does source code have to be shown in fixed width?

> ...which is purely cosmetic.

You've answered your own question. I do this for a living; I want to look at something I like to look at.

But to each their own.


> I do this for a living; I want to look at something I like to look at.

That's an interesting observation. When you spend so much time looking at text, it should be in a form that you enjoy viewing.

The funny thing is that's exactly the same reason I use proportional fonts: I enjoy coding more when my code looks good to my eyes.


I've been using Anonymous Pro[0] for as long as I've known about it. I think I think Anonymous slightly more than Hack. On a different note, while this might sound like a silly gripe, I really don't like the "r"s in Hack. They seem off.

[0] http://www.marksimonson.com/fonts/view/anonymous-pro


Looks good, but the font of the webpage itself could use some improvement.

http://i.imgur.com/UEkkBAc.png

Why do w, x, v, y look darker than the other letters there? Why are the S, z and g missing part in the center?


I still like Source Code Pro better (yes it's free too) https://github.com/adobe-fonts/source-code-pro



Pragmatapro is my fav http://www.fsd.it/fonts/pragmatapro.htm (since everyone is posting theirs).


Seconded. Bought it ten years ago/ never looked back. And Fabrizio (the author) has been pumping out improved versions to all registered users about annually - just shows up in my inbox.


Nice. Reminds me of http://input.fontbureau.com, a little bit softer.


I just found Input yesterday, and I really like it. Hack doesn't come out well in Emacs (letters are way too spaced), so I'll stick with Input.


Hack and others compared: http://s9w.github.io/font_compare/


I hate it when sites like this change the normal scrolling behaviour. I use the trackpad on my MBP and on sites like this scrolling accelerates too quickly and gestures like going back don't work in chrome.


This. Why do people think that changing default behaviour is ok? Hijacking scrolling always bothers me, for now I can't even read the content because of the scrolling being too annoying.

Maybe I should write a browser extension to remove scrolling hijacking.


As a python developer I use only fonts which inserts tiny space between two and more following underscores.

See in __call__ method http://sourcefoundry.org/hack/assets/img/mockup/python-sourc...


Well, Hack and many other fonts like SCP is a bit too wide for Asians, since they may mix source code with 文字 like this. That's why I made Iosevka [1]. [1]: http://be5invis.github.io/Iosevka/


Thank you for this, I really, really like the compactness of it.

Not surprised to see Pragmata as an inspiration, I bought that font a few years ago when it was around US$100, and I still love it today, I probably use it 80% of the time :)


Now that I have a 4k monitor, I notice how unrefined the shapes of most programming fonts are. Of course this is on purpose and the right choice for typical resolutions, but it would be cool if someone designed a bit more elegant monospace font for 4k displays.


I have really enjoyed the look of 'Source Code Pro', an open-source monospace font designed by Adobe. It pairs well with Source Sans Pro for sans-serif text.

Not only do all of my editors use 'Source Code Pro' but I also often use it to display monospaced text on websites because of how clear and legible it is for reading as well as coding.

I cant wait to put Hack to the test, but for me the ultimate test will be if it can displace Source Code Pro from my editor!


One suggestion is Triplicate (http://practicaltypography.com/triplicate.html), which looks _awesome_ at high resolutions.


Oddly enough, that site does not seem to allow deep links, even to a sales page.


I contacted the site's author, the link should work now.


Source Code Pro and Consolas are the best ones for me on high DPI displays. SCP is also very good on normal displays.


Try Fira Code, thats the one I use. Compared just now to Hack and still prefer the curves and shapes of a good old Fira font.


FWIW, Inconsolata was designed to look good and elegant at large sizes in print, so it should fit the bill quite well.


I like Inconsolata[1] a lot.

I prefer the version of Inconsolata with straight quotes[2].

[1]: http://www.levien.com/type/myfonts/inconsolata.html

[2]: http://nodnod.net/2009/feb/12/adding-straight-single-and-dou...


Anyone use Hermit[1]?

[1]: https://pcaro.es/p/hermit/


6-7 years ago I bought the Essential version of the PragmataPro font (http://www.fsd.it/fonts/pragmatapro.htm). And although in the intervening years I have tried dozens of other fonts, I have always come back to the PragmataPro. It is now available for 19 euros (~$21). I bought the essential version for $70 back then.

I personally use it aliased. The font looks a little dense with anti-aliasing on. But I never liked anti-aliasing anyway, especially on low-dpi screens.


For coding I highly recommend M+ 1mn, a lot of thought seems to have gone into the design of this typeface.

http://mplus-fonts.osdn.jp/


As with most typefaces, i fail to see how this is better than Comic Sans.


You haven't reached peak typography hipster status if you haven't sent out a resume in comic sans


We see another pushing of 'the great programming font' from time to time. But rarely see innovations like special glyphs from multi-character tokens, +=, ++, /*. We see the same, boring, single rendering glyphs for parenthesis and brackets without regard to the depth level of parenthesis. You would think a more savvy font designer could do something eliding color and font rendering to produce a font the would help quickly understand code.


Have you see FiraCode? https://github.com/tonsky/FiraCode

I find the idea interesting and would love to see more in this direction. It especially makes sense for languages with more obscure operators that are mimicking traditionally handwritten mathematical symbols.

That being said, I tried using FiraCode for a week and switched back. Some of the conventional common operators have become so ubiquitous and second nature to me that its difficult to adjust (especially the comparison operators). I'm still looking forward to more extended ligature fonts though.



I've never thought about fonts in coding environments before; you guys must be very experienced if you're thinking of stuff like that.

This is what my editor(Kate) looks like, is this a good font or a bad font? http://i.imgur.com/QtP1csu.jpg


I'm kinda late, I guess, but I thought I'd add my 4¢:

It's not experience, so much as accomodating the repetetivity of software development. Just like getting a better chair or a more comfortable keyboard, one day you find a font that strains your eyes and brain less than the last one, and you switch, and your eyes last longer.

Speaking of which, my absolute first reaction after I loaded that screenshot was "ouch, blur!" - to me, the combination of font, color scheme and antialiasing is making the text quite hard to read. Now, your eyes might be good enough to counteract that, and your screen might be lit differently from mine perhaps as well, making this reaction moot. On the other hand, if you look at some of the sharper screenshots in this thread (curl -s https://news.ycombinator.com/item?id=10140728 | grep -o '<a href="https\?:&#x2F;&#x2F;[^"]\+"' | sed $'s/^.\{9\}//;s/.$//;s/\&#x2F;/\//g;/imgur\|png/s/[^$]\+/\033[7m&\033[0m/'), and your eyes go "...oooh.", then you might be blind to the blurriness of your font. You might adjust this by changing the font, your editor color scheme, or learning about FreeType (ahaha) and how to adjust hinting.

All of this is just technical blathering though; I'm not questioning your choice of font for the choice's sake, or criticising it. I'm just saying, in case you don't realize, I thought it was blurry with my eyes, on my system. :P

As for actually going about making changes and adjustments, this is usually done in the traditional manner - spending an afternoon avoiding the todo list and for example getting horribly distracted with color scheme designers or font comparison utilities or text editor build systems... ;)


You grab a bunch of fonts, try all the monospace ones, find one you like, and go with it.

I use Liberation Mono everywhere. You might want to give Oxygen-Mono a shot just for kicks since its the "kde" font, but having used both I still like my Liberation.


Your font is fine. Use whatever you like. Main thing I look for is fonts that differentiate between things like 0Oo and lI1. I prefer open source fonts too. Just don't use a non-monospaced font.


In my day we wrote Pascal in 9-point Geneva and we liked it! ;)


In THINK Pascal? In all those years I've never found another IDE that was as productive as this gem.


Yes! And same--the THINK IDEs spoiled me.


But it's so much easier to get your mixed tabs and spaces aligned correctly with a non-monospaced font!


You can get used to any font, and it is after all a matter of taste. I have preference but it's totally personal and might just be a habit. Whatever works, you know.


Since everyone's mentioning their favourite fonts...

Some time ago I discovered the IBM OS/2 VIO (console/terminal/monospace) font converted to PCF for use with X11.

A screenshot and an archive can be found here: http://www.karasik.eu.org/fonts/

I haven't used this resource, which has (aparently) the same font data converted to BDF: https://github.com/dk/ibm-vio-os2-fonts

I'm on a spare (unconfigured) PC at the moment since my main systems were taken down for abrupt maintenance, but it's currently the default font I use in my terminals, text editor, etc. It looks a LOT softer than Fixed (the default X11 font)!


I recently switched to Roboto Mono Light and I love it so far. Looks really clean on retina screens.


Me too. I used Consolas, but I absolutely love Roboto Mono now.


Nice font. I really appreciate that it supports non-latin alphabets. Even though it seems that these alphabets come from the original font (deja vu maybe?) and hasn't been much worked on, it still is extremely useful!

Some critic:

The small i seems a bit funny to me. It is like a greek iota (ι) with a dot on top. Also it is a bit tall font. Whilst that makes text/code more readable, on the same time it let you see less lines on your terminal. My main mono font (Liberation Mono), lets me see comfortably 51 lines in a full screen terminal on a 15.6" laptop. Hack font only shows 45 lines (11% less code :p) at an equally acceptable size.


Just a bit of feedback (bias: I'm used to Monaco for Powerline)

The lowercase 'a' is much better than Monaco.

The tilde and lowercase 't' seem harder to see than Monaco.

People see characters differently, so some things which make it harder to see for some are easier for others.

Make one want a website which generates a custom font based on each person choosing the most visible variant of each glyph.

Hack: http://screencast.com/t/nnGD3Wm1M7Z5

Monaco: http://screencast.com/t/65hJcI43XT7


This started quite a conversation, looking at the stats in Codeanywhere it seems at a first glance that Inconsolata is the most used (although true this is the default font). Will do a detailed analysis and report my findings :)


I've been using Proggy Tiny for literally over a decade, I wonder if there's any font that can beat it for me.

Does anyone know of an easy way to compare two typefaces and see how they look when rendering source code?


As mentioned earlier in the thread: http://s9w.github.io/font_compare/


Thanks, I've seen that before, but it doesn't list Proggy Tiny, and just shows the characters in the font in a line and not how they'd appear in source code. It's hard to discern things like line height, compare the fonts at equivalent sizes, or see how they'd actually look in source code.

It also has anti-aliasing enabled on fonts that support it, which I personally hate. Proggy Tiny is designed to be pixel perfect at small sizes. MonteCarlo looked similar to Proggy Tiny, but when I typed MonteCarlo's example[1] into my editor and compared to Proggy Tiny[2] I really disliked it. That shows why you really need to see it with real source code in an editor at the same size.

Thanks for the link though, it's a good resource to see some of what's available!

[1] http://www.bok.net/MonteCarlo/java-example.html

[2] http://imgur.com/no8txTq

Edit: totally didn't notice it has a compare mode, and that you can change sizes and turn anti-aliasing off. This thing is sweet!


If you're looking for a programming font, you might like this old relic: http://www.bok.net/MonteCarlo/


Fantasque Sans Mono is my font of choice: https://github.com/belluzj/fantasque-sans


This font does not work well at all in small font sizes, at least in Emacs. (ttf, linux mint, no font hinting)

At 4 & 5 point font sizes, there is a TON of whitespace around each character, destroying the text density and visible flow. Though it might be an Emacs rendering quirk as it never quite appears exactly the same as system fonts otherwise.

Liberation Mono is still works the best for me at those font sizes, still being legible and leaving enough pixels varying between similar characters to distinguish them.


On OSX put the ttf's into your ~/Library/Fonts directory. I've switched, Atom looks subtly different, but I'm surprisingly comfortable with it. Looks good.


You just have to double click the ttf files (or select them all and double click one of them) and it will install. Don't need to move them manually.


I'm loving it. It makes a great terminal font as well.


While on the subject of fonts could an expert answer a question for me - on Windows (10 if it matters) should I install the ttf or the otf font? Is there a difference?


This should hopefully answer your question: http://superuser.com/questions/96390/difference-between-otf-...


I found the glyph for zero really ugly and attention grabbing


That's the idea, it should draw attention that it's not capital "o". Ugly though, it's not.


I like luculent, it's quite thin and you can stuff lots of texts in a small terminal, very useful if your laptop is small, and underscore is also thick.



Probably an uninformed response, but this looks a lot like menlo to me. Edit: People compare to DejaVu sans serif - which is almost identical to menlo as well: http://www.leancrew.com/all-this/2009/10/the-compleat-menlov...


I'd like to use Fira Code ligatures on Atom, but they're buggy :\

At the moment I'm using Monoid, but it hasn't as much ligatures as Fira Code.


There already is a perfect font for coding - terminus. Not that choice is a bad thing.


I like the typeface, but I wish Hack had other weights; I find their normal weight far too heavy. I use Source Code Pro Extra Light (in Emacs and the terminal, on OS X) on my low-DPI display and it's pretty good.


In my emacs setup, I use Hermit (a font for programmers, by a programmer)

https://pcaro.es/p/hermit/


For programmer art that looks not bad at all!


No Love for ProFont here. I can't get away from using it.

http://tobiasjung.name/profont/


Good, but not as good as a) Input Mono Narrow and b) Inconsolata.


I hate that 'i' glyph but otherwise looks nice. I'm more interested in editor's colorscheme in example though. Really nice, anyone has some information?


I'm trying this out. It looks really sweet thus far.

Thanks for your contribution. I think you'd be surprised how much of an affect your work will have on the folks who adopt it.


I'm not a fan of the Trebuchet- style lowercase 'i' with the unnecessary curved hook on the bottom. Or the design of zero.

I'll stick with Consolas.


I am partial to Luxi Mono myself:

http://frammish.org/luxi.png


I really don't like the font personally, but you know, can't argue with taste. I'm curious though - you're using Geany for working with Go? What level of support does it have?


Geany doesn't support Go out of the box, but you can configure it to have excellent support. In the preferences, you can tell it the "go build" commands, and it will be able to build & run your project in Geany's integrated terminal and attach gdb for debugging. Also in the preferences you can tell it the format of go error messages, which allows it to highlight lines with compile errors.


In that style, I find Latin Modern Mono better, especially its digits.


The 0 reminds me a bit of the the Jacksonesque Eye of Sauron. I'm not sure if that's good or bad, really.


I just the default font for sublime text. I've never found a "source code" font worth switching to,


i really love ProggyCleanTTSZ can't see myself switching specially for a font called "Hack"


Enjoy using it in my terminal and sublime text editor. I slightly prefer it over Manaco/Menlo ..


might just be me, but looks identical to Deja Vu Sans mono for me on windows


I'm reading "if" as "lf"...


Someone can compare it to sourcecode pro?


I'm surprised no one has mentioned Comic Sans! It's my goto font for all of my coding needs.


try Droid Sans Mono


Not much love here for Droid family it appears. Droid Sans Mono has been my go to monospace font for years now on different platforms. Ideal fonts are subjective, but this font is most comfortable to my eye on both shell and editors when antialiasing is turned on. Strangely enough I find Noto Sans which is derived from the same family less pleasing.


Thanks, but I will still stick with Monaco.


[deleted]


The O looks like a zero, but the 0 has a dot, and therefore doesn't look like an oh. That's not enough? I'm happy if every letter has a distinct form; they don't all need to differ from the common form though.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: