
Hack – A typeface designed for source code - rayascott
https://github.com/source-foundry/Hack
======
drewsberry
This was posted to HN a couple of years ago. Has it changed since then? The
discussion back then was fairly comprehensive, and most of the comments in
here will likely replay the same questions (ligatures, comparison to other
fonts like DejaVu sans, I vs i, etc.).

[https://news.ycombinator.com/item?id=10140728](https://news.ycombinator.com/item?id=10140728)

~~~
throwanem
Upvoted so maybe the next person will see it _before_ lengthily replaying the
DejaVu comparison like I just did.

Then again, this is probably one of those perennial sorts of topics that's
just enjoyable to chew over every now and again.

------
jameskegel
This is an infuriating experience on mobile. Show me white background and
black text with your font. I'll be damned if I'm going to learn new paradigms
in scrolling and waiting just to then notice I can't see anything anyway
because it is a responsive 1080p screenshot of 12pt text.

~~~
enobrev
Pretty infuriating on the desktop as well.

I scrolled down for an example, saw the screenshot of tiny text and assumed
that either I've gone blind or that screenshot is shit; I'm going with the
latter. Maybe it looks better on a computer with an apple on it, but not on
ubuntu / chrome.

Hack seems to be a nice font, otherwise. I don't know that I would switch to
it as my primary, but I'll gladly add it to the collection of 20 or so
"programming fonts" i seem to have collected over the years.

Does anyone program in <= 12pt type? I'm looking at this "specimen" link[1]
and 12pt seems unnecessarily small. I can read it clearly, but I feel like I'm
working harder to do so. 16pt is more my style.

1: [http://source-foundry.github.io/Hack/font-specimen.html](http://source-
foundry.github.io/Hack/font-specimen.html)

~~~
throwanem
(Had no trouble zooming the screenshot to legibility on an iPhone SE. What do
you want to bet the site was designed in an exclusively fruit-machine shop?
They're getting to be pretty crap for dev work lately, too, but that's another
discussion.)

I use 9pt fonts in Emacs on my personal laptop, because otherwise I can't use
my preferred layout (a maximized frame containing three vertically split
windows) and fit enough code on a 13" display.

With a high-DPI display, it's workable enough - at 72dpi it'd be a disaster,
as I had opportunity to discover during a brief flirtation with a netbook.
Workable though it be, I'd like to find a still broadly similar font that made
pairs like i/l and ./, more easily distinguishable at such small size. Hack is
not that font; it appears to be a slightly modified Vera/DejaVu Sans Mono,
which is no bad thing to be sure - I've used that font exclusively for many
years - but hardly revolutionary.

To be clear, I'm not sure whether Hack actually is a modification of DejaVu
Sans Mono, or whether it's a novel design. Doesn't change what it looks like
either way. And some decisions seem much more driven by style than by
usability - for example, curving the tail of the i, to match the l, would
actively harm legibility compared to DejaVu Sans Mono, where l's distinctively
curved tail makes it very easy to distinguish from every other glyph that
consists primarily of a single vertical stroke. That's one of the two most
commonly confused groups, and so I'm not really seeing a strong legibility
rationale for making one of its members _less_ distinguishable from another.

------
rufusroflpunch
I'm going to be honest... After a while, all of these programmer fonts start
to look the same to me.

~~~
Raphmedia
They have a nice playground which lets you try different fonts. Give it a go:
[http://sourcefoundry.org/hack/playground.html](http://sourcefoundry.org/hack/playground.html)
(click once on the fonts dropdown then use the down arrow to compare them
quickly)

~~~
baldfat
It doesn't display ligatures.

------
creichenbach
For those feeling adventurous: Input[1] is a proportional font made for
coding. It's also highly customizable.

[1]: [http://input.fontbureau.com](http://input.fontbureau.com)

~~~
eequah9L
I was using proportional fonts for a couple weeks. A problem I ran into was
that in coding styles that I typically work with, you need to align stuff with
spaces to match some artifact on a previous line (e.g. an opening paren of a
function call). At that point you pretty much need the space to be as wide as
any non-whitespace character that might appear there, otherwise things end up
looking wrong. This is what basically killed it for me. a) I don't like how it
looks. And b), I don't want to have patches bounced over formatting trivia
that I don't notice.

(Edit: typos.)

------
rbanffy
Sorry, but nothing beats the good old IBM 3270 font.

[https://github.com/rbanffy/3270font](https://github.com/rbanffy/3270font)

~~~
madmoose
I humbly beg to differ. This is the terminal and editor font I use:
[http://www.dafont.com/nouveau-ibm.font](http://www.dafont.com/nouveau-
ibm.font)

~~~
rbanffy
Oh no! Not the MDA font! ;-)

------
ConfucianNardin
Comparison page with quite a few programming fonts, Hack among them:
[http://s9w.github.io/font_compare/](http://s9w.github.io/font_compare/)

~~~
s9w
I really need to update that thing

also, this is a later version:
[http://www.s9w.io/font_compare/](http://www.s9w.io/font_compare/)

~~~
naikrovek
It's a shame that the gdipp renderer hasn't been updated in awhile. it looks
__so much __better.

------
Freak_NL
If you are used to DejaVu Sans Mono (or its ancestor Bitstream Vera Sans
Mono), you might like Hack as well — it modifies DejaVu Sans Mono to make it
even more suitable for source code and introduces a number of nicely aligned
glyphs (geometric shapes, etc.) for use in terminals and status lines.

Great for both terminal emulators and code editors alike.

~~~
notzorbo3
That explains why the font looked so familiar. I've been using DejaVu Sans
Mono since forever and it's great.

------
DonHopkins
Real programmers use a 3x5 pixel font, to get the most code on the screen as
possible!

[https://web.archive.org/web/20150407130603/http://mckoss.com...](https://web.archive.org/web/20150407130603/http://mckoss.com/jscript/tinyalice.htm)

~~~
azeirah
Viewing that story on a 2560x1440 screen is... yeah

I mean I'm young, but my eyes can't do that. I don't know anyone who can :x

~~~
Joeri
On a 12 inch apple II monitor that font displayed at 28 dpi, so you have to
zoom in 3 to 4 times to see it in the size it was designed for.

~~~
DonHopkins
Extra credit if you can read that hires text on an Apple ][ color monitor (or
NTSC color TV), where you get one color per two pixels, with seven pixels per
byte, and some very quirky rules for figuring out the color!

[https://en.wikipedia.org/wiki/Apple_II_graphics#High-
Resolut...](https://en.wikipedia.org/wiki/Apple_II_graphics#High-
Resolution_.28Hi-Res.29_graphics)

The Apple II's Hi-Res mode was peculiar even by the standards of the day...

Each pair of adjacent pixels generated a single color pixel via artifact
color, resulting in an effective resolution of 140×200. The lower seven bits
of each byte represented the pixels, while the most significant bit controlled
the phase offset for that block of pixels, altering the color that was
displayed...

Finally, another quirk of Wozniak's design is that while any pixel could be
black or white, only pixels with odd X-coordinates could be green or orange.
Likewise, only even-numbered pixels could be violet or blue.[4] This is where
the so-called "fringe benefit" comes in. The Apple video hardware interprets a
sequence of three or more turned-on horizontal pixels as solid white, while a
sequence of alternating pixels would display as color. Similarly, a sequence
of three or more turned-off horizontal pixels would display as black.

------
jcahill
Hack isn't all that great. Here are tons of alternatives:

[https://github.com/chrissimpkins/codeface](https://github.com/chrissimpkins/codeface)

(Use Input)

~~~
baldfat
WHY does codeface not show ligatures? They only have them in the mono space
example?

Hack is my second favorite, but just the last year I switched to Fira Code:
monospaced font with programming ligatures.

I like the zero being a slash as opposed to a dot but the rest is spot on for
me.

[https://github.com/tonsky/FiraCode#fira-code-monospaced-
font...](https://github.com/tonsky/FiraCode#fira-code-monospaced-font-with-
programming-ligatures)

~~~
kevinSuttle
It does. We just added it.
[https://github.com/chrissimpkins/codeface/pull/163](https://github.com/chrissimpkins/codeface/pull/163)

------
SeanDav
Lower case "i" and "l" are just way to similar. In addition lower case "i"
looks a lot like a "t" to me. This is not a good sign for a coding font.

------
Accacin
I use and enjoy this font. Easy and clear to read, and not having to patch the
fonts for Vim Powerfline saved a little time (although nearly all patched
fonts are available in the AUR).

------
MarcScott
Honest question here, does anyone else have no idea what font they are using
in their text editor?

I use emacs, and don't have a clue as to what font I'm using. It's monospace,
and that's about all that matters to me. As long as I can tell the difference
between I, 1 and l - I really couldn't care less.

~~~
naikrovek
Yeah, lots of people don't know or care. As long as it shows them what they
need to see, they don't care, and that's 100% fine.

------
maxk42
Stop making sans serif fonts for code!

Code has to be readable. Those serifs aren't merely decoration: They're visual
cues that help your eye intuitively determine which letter is intended by a
given shape.

Sans fonts may look "clean" but they actually take your eye longer to read.

~~~
fancy_pantser
"So before you go around claiming that serif typefaces are easier to read than
sans-serif typefaces, you might want to do a little checking around. The
embarrassing truth is, there's no solid research to back up that claim."

Source with references: [http://asserttrue.blogspot.com/2013/01/the-serif-
readability...](http://asserttrue.blogspot.com/2013/01/the-serif-readability-
myth.html)

One of many studies that show it's actually additional spacing that's at work
when small text readability is improved with serifs:
[https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4612630/](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4612630/)

------
kowdermeister
I'm glad they built this:
[http://sourcefoundry.org/hack/playground.html](http://sourcefoundry.org/hack/playground.html)

(click side-by-side to compare)

I think I'll switch to Fira Mono, Hack line height seems to be to condensed.

~~~
zichy
They are missing Input (Mono):
[http://input.fontbureau.com/preview](http://input.fontbureau.com/preview)

I started using it after discovering the customizer.

~~~
kowdermeister
What an awesome idea, thanks for this!

------
dna_polymerase
I prefer Iosevka, which was trending a while ago:
[https://github.com/be5invis/Iosevka](https://github.com/be5invis/Iosevka)

~~~
noir_lord
I have my own build of iosevka with my name in it.

I've yet to find a better condensed programming font with ligatures, it's
close to perfect already (for me).

~~~
masklinn
When I looked at ligatured fonts a few months back I went with Monoid instead,
it fits my uses better, and I was especially attracted to the triple-equal
ligature for JS contexts (in Monoid, `===` is rendered as a long ≡ making it
visually very distinctive from assignment or regular equality).

~~~
noir_lord
Yeah iosevka is missing a few ligatures I'd like but they slowly get filled
out over time and it had the ones I use the most.

------
chmike
Only good match is bitstream vera sans. I prefer Hack because it is lighter
(cf. i) The only thing I prefer in Vera is the 0. The dot inside the zero in
Hack is too big.

------
batat
IMO DejaVu's "i" is much better.

[https://i.imgur.com/1ITyRGt.gif](https://i.imgur.com/1ITyRGt.gif)

------
ericfrederich
I switched my Sublime Text to it and watched my fonts change ever-so-slightly.
This font is essentially "Source Code Pro"

------
partycoder
Which font to use depends on many factors. First of all fonts don't look the
same under various font rendering engines, and those engines have parameters
leading to even more variations.

Then, your screen is another factor. With a lot of dpi (e.g: 4K or superior)
you can pretty much anything you want since most fonts will look very
readable.

------
oneeyedpigeon
All sorts of problems installing this on OSX; to be fair, the process for
installing fonts on OSX is horrible anyway, but there are still errors.

Edit: I don't know why this got downvoted; if there's a way in which you want
me to alter it to be more acceptable, please let me know.

~~~
coldtea
> _All sorts of problems installing this on OSX_

Like what? Installed it with absolutely no problem at all in both Sierra and
High Sierra (GM) -- and never had issues installing it in my older Mac OSes
(or any other font -- some fonts created by amateurs --free .ttf varieties--
have broken metrics/config and you're warned about it sometimes. Other than
that, absolutely zero issues).

> _to be fair, the process for installing fonts on OSX is horrible anyway_

It's literally double clicking on a font file and clicking "Install Font" on
the preview that pops up.

How is that in any way "horrible"?

~~~
oneeyedpigeon
UPDATE (& TL;DR & Introduction!): Killing Font Book between operations avoids
all sorts of errors and weird display issues you'll get if you try to install
multiple font files in a single 'session'. Open Font Book from fresh, locate
font files in Finder, drag them into it and you'll do everything in one
operation, and it will even update to show you what's happened!

> Like what?

Errors about duplicate fonts. Several occasions where dialogs open and close
immediately, indicating some kind of problem, but not sure what. Even after
going through the "yes, please do really install this font, even though there
are 'duplicate fonts'", nothing seems to happen sometimes.

I've managed to install three of the fonts (font variants?) — Regular, Bold,
and Bold Italic — but Italic refuses to install altogether.

> How is that in any way "horrible"?

Having to open four separate font files, then click a button each time to
actually install them seems like a pretty tortuous process — I'm grateful it
was only 4! It would be a LOT nicer if I could just select the files, right-
click and choose "Install font(s)" and have it all done in a single step.
That's totally aside from all the errors.

Having said that ... pro-tip: drag-and-drop. I _always_ forget that drag-and-
drop is sometimes the 'first class' way of doing something on OSX. So the
quickest way, I think, would be:

1\. Open 'Font Book' 2\. Locate files in Finder 3\. Drag and drop from the
latter to the former

This process finally allowed the "Italic" variant to be installed. I'm
assuming it will work with multiple variants at once; I would test that, but
trying to remove the family/variants in Font Book just gives me a 'no-op'
(after a confirmation dialog).

~~~
coldtea
> _UPDATE ( & TL;DR & Introduction!): Killing Font Book between operations
> avoids all sorts of errors and weird display issues you'll get if you try to
> install multiple font files in a single 'session'. Open Font Book from
> fresh, locate font files in Finder, drag them into it and you'll do
> everything in one operation, and it will even update to show you what's
> happened!_

Oh, I rarely happened to need to install multiple files in the same Font Book
"session". At best 4-5 files for the different fonts of the same family (X
bold, X italic, etc) -- might be why I'm not seeing those issues.

> _Having to open four separate font files, then click a button each time to
> actually install them seems like a pretty tortuous process_

Having been there in 1997-200x era Linux, where you had to manually edit
config files and jump through hoops to register fonts (and they wouldn't even
work across all desktop environments and toolkits) I really don't see the
issue...

That said, you can just drag and drop multiple font files into Font Book if
I'm not mistaken. In fact, you could just drop them into your Fonts folder and
they should work too -- no clicking required -- don't know if Apple removed
that, used to work at least in Snow Leopard days.

~~~
oneeyedpigeon
> At best 4-5 files for the different fonts of the same family

That was _exactly_ the case in this instance :)

> Having been there in ...

Sure, I don't think I've ever had a _great_ experience installing fonts on any
platform, but I hold Apple to a higher standard.

> That said, you can just drag and drop ...

I know, I said that in my update that you quoted! :-)

------
yoandy
I do not get the feeling it is an improvement over other Fonts. Just another
Font face.

------
ToFab123
How does this compare to consolas used by Microsoft Visual Studio and others?
[https://en.m.wikipedia.org/wiki/Consolas](https://en.m.wikipedia.org/wiki/Consolas)

~~~
jhasse
Hack is rather different. If you're looking for a free alternative to
Consolas, check out Inconsolata:
[http://levien.com/type/myfonts/inconsolata.html](http://levien.com/type/myfonts/inconsolata.html)

------
kronos29296
WOW! The website looks so shiny just for hosting a single font. Almost thought
it was some website advertising Hack the language related stuff. Great web
devs behind the site. Kudos to you.

------
hollander
What are Powerline glyphs?

~~~
cannam
I wondered that. This issue [https://github.com/source-
foundry/Hack/issues/1](https://github.com/source-foundry/Hack/issues/1) points
to
[https://github.com/powerline/powerline](https://github.com/powerline/powerline)
which appears to be some kind of status-line plugin thingy for Vim that uses
certain glyphs for arrows and things. I haven't yet managed to find out
_which_ glyphs.

------
gbrown_
Does anyone like the way they've done the dotted zero? I've always disliked it
personally. If they offered a slashed version I would definitely try it out.

~~~
jmull
No! It's an Abomination^TM

Keep stuff out of the middle of my zeros, please.

The circle surrounding nothing wonderfully symbolizes a subtle concept.

Drop a dot in hole and now what are you symbolizing? A nice golf shot? When
you put a slash across it are you warning me away?

No, no. I prefer my voids empty, thanks very much.

~~~
cat199
O?

------
houzi
Pleasing to the eye, but too wide for my taste. I like to have divide a 1080p
screen into three columns of 80 chars width, and most fonts are too wide for
this.

~~~
userbinator
If you're referring to a _vertical_ 1080p screen, which is pretty common for
developers, then you'd need a 4.5-pixel-wide font, which would be extremely
difficult to read (5-pixel-wide + 1 border characters are probably the limits
of having recognisable characters for the full ASCII range), but with it
horizontal then only 8 pixels wide would be sufficient, and there are plenty
of fonts in that range. Various 8-pixel wide "VGA"/"DOS"/"IBM terminal", as
well as the classic "6x13" and "7x14" fonts which are my favourites, would
qualify.

------
mmjaa
I'm having troubles differentiating between Hack and Menlo .. is it just me or
are they quite similar?

~~~
rhblake
Both Hack and Menlo are based on DejaVu Sans Mono / Bitstream Vera (the DejaVu
family extends Vera). Very little difference indeed.

------
andrepd
Previous discussion:
[https://news.ycombinator.com/item?id=10140728](https://news.ycombinator.com/item?id=10140728)

Tl;dr: the monospsce font seems to be (have been) an almost direct copy of
DejaVu Mono. I don't know how much has changed over the last 2 years.

------
andybak
At first glance - lower-case l and i are too similar (at least with my eye-
sight)

------
josteink
I'm using this in Emacs on all the platforms I code. I love it.

------
Lapsa
me... favoring Fira Code

------
discreditable
Why are these goofballs distributing Windows fonts as an EXE?

------
tempodox
Installing these fonts makes Font Book crash on my Mac.

------
liuw
Nothing beats good-ole 6x13 font in a terminal. :-)

~~~
naikrovek
I used to think that, then I saw Monaco on an old Mac at 10pt and I changed my
mind.

Windows doesn't render fonts the same way so I wound up creating a near clone
of Monaco @ 10pt on a Mac and called it Monocle. I fixed some things that
annoyed me along the way.

Here's an earlier version that I used to show people:
[https://fontstruct.com/fontstructions/show/517659/monoclefix...](https://fontstruct.com/fontstructions/show/517659/monoclefixed)

------
jokoon
No, still cannot compete with consolas, sorry!

~~~
piahoo
yeah, I felt in love in incosolata instantly

------
yummy
This, Consolas and Noto Mono are my favourites

------
wolfi1
does it support ligatures? (like fira code?)

~~~
ishtu
speaking of ligatures Iosevka and PragmataPro are my favorites (edit:
spelling)

~~~
zimpenfish
+1 for PragmataPro (coming up on 10 years now, I think)

------
ginreaper
I juse assume everyone uses terminus...

------
tome
Can we please stop polluting the global namespace with names like "Hack"?

~~~
rayascott
It's the name of the typeface.

~~~
tome
That's exactly what I'm objecting to.

