Hack: A typeface designed for source code
sourcefoundry.org
sourcefoundry.org
"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 '_'.
https://github.com/chrissimpkins/Hack/blob/master/LICENSE.md
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.
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.
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.
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.
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!
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.
http://www.fastcodesign.com/3033126/roboto-rebooted-why-goog...
I imagine someday we'll see more typefaces versioned like software, instead of alterations receiving new names. Or is this already happening?
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):
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.
http://www.secretgeometry.com/apps/cathode/
https://github.com/Swordfish90/cool-retro-term
https://github.com/rbanffy/3270font
;-)
I'm curious why that's the case. Do people generally dislike the system-provided fonts or are the alternatives considered "better"?
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.
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.
Then I'll use an undecided vector font and the last remaining piece of resistance from classic Mac will be gone.
https://discuss.atom.io/t/why-is-the-text-display-inferior-t...
Nothing looked right. Nothing does even now, half a year later. Though personally, 12pt Monaco feels least "wrong".
// Looks like they've added Courier Prime Code.
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.
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!
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.
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.
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.
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.
http://www.donationcoder.com/Software/Jibz/Dina/index.html
† That's for Windows, not Macs.
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.
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
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/
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.
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.
EDIT: Looks like FiraCode has ligatures too https://github.com/tonsky/FiraCode
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
For exmaple the operator >>== will probably have the first three characters joined in the ligature {>==}=
Operators ==== and (four asterisks) may look very strange too.
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.
I'll stick with Fira.
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.
[0] http://www.slant.co/topics/67/~what-are-the-best-programming...
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.
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.
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...]
retval = select(readFDCount,
&readFDs,
NULL,
NULL,
&timeout);
or: d = [NSDictionary initWithObjects: objects
forKeys: keys
count: count];
addedThe 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.]
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.
BTW my favorite coding font right now is Trebuchet MS on a high-DPI display.
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.
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.
> ...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.
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.
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.
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?
Maybe I should write a browser extension to remove scrolling hijacking.
See in __call__ method http://sourcefoundry.org/hack/assets/img/mockup/python-sourc...
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 :)
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...
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!
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.
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.
This is what my editor(Kate) looks like, is this a good font or a bad font? http://i.imgur.com/QtP1csu.jpg
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.
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\?://[^"]\+"' | sed $'s/^.\{9\}//;s/.$//;s/\//\//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... ;)
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)!
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.
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.
Does anyone know of an easy way to compare two typefaces and see how they look when rendering 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
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!
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.
At the moment I'm using Monoid, but it hasn't as much ligatures as Fira Code.
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'll stick with Consolas.