Live data from Hacker News

Hack: A typeface designed for source code

sourcefoundry.org

191–200 of 249 posts

Re: Hack: A typeface designed for source code

#191
post #51

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.co…

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.

Re: Hack: A typeface designed for source code

#192

Earlier quoted context omitted.

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.…

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.

Re: Hack: A typeface designed for source code

#193

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.

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.

Re: Hack: A typeface designed for source code

#195

Earlier quoted context omitted.

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

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

Re: Hack: A typeface designed for source code

#197
post #51

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.co…

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.

Re: Hack: A typeface designed for source code

#198
post #74
post #13

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.

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.

Re: Hack: A typeface designed for source code

#199

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.

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.

Re: Hack: A typeface designed for source code

#200

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.

> 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.

Post reply on HN