Using the Hack Font in the Console and Visual Studio

A few days ago I saw a tweet about a new font called Hack. It’s a font that’s designed specifically for programming. No more doubts if it’s an O or a 0. Clear, enlarged punctuation for ; . ,. It’s just brilliant.

In Visual Studio…
2015-09-02 18_55_46-Kentor.AuthServices - Microsoft Visual Studio

Or in PowerShell…
2015-09-02 19_03_27-posh~git ~ authservices [master]

Installation

To install, first download the TrueType (ttf) zip from the Hack website. Doubleclick each of the files (no need to even unzip) to open them in Windows font viewer and click install from there. If you’re running Windows 10, make sure the firewall is switched on (yes, honestly). The font is now available in Visual Studio in the Environment->Fonts and Colors section in the options.

Configure in PowerShell/Console

Adding a new font to PowerShell and the console is a bit more tricky. By default, only three fonts are available in the console font settings: Consolas, Lucida Console and Raster Fonts. New fonts are not added automatically. To make the font available, a registry hack is needed.

Open regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont. Check the available values, and another one with one more 0 in the name than the existing. As the value, specify Hack.

2015-09-02 19_14_31-Registry Editor

Reboot and the font is available in the properties for PowerShell and the command prompt.

  • Ryan E on 2015-09-04

    I’m curious, why do you choose Hack over Consolas?

    • Anders Abel on 2015-09-04

      I think it looks more sleek, which is entirely a personal taste. If I have to find an objective argument it would be that the punctuation characters are semi-bold. Especially the ; is very distinct and easy to spot.

  • May on 2016-02-10

    …and for the love of God I can’t find how to install this and use in Microsoft Visual Studio Code. Any help on this? Thanks in advance!

    • Anders Abel on 2016-02-10

      I’m sorry, but to be honest I haven’t even tried VS Code myself yet (it’s a bit embarrassing, I know).

  • Leave a Reply

    Your name as it will be displayed on the posted comment.
    Your e-mail address will not be published. It is only used if I want to get in touch during comment moderation.
    Your name will be a link to this address.
Software Development is a Job – Coding is a Passion

I'm Anders Abel, an independent systems architect and developer in Stockholm, Sweden.

profile for Anders Abel at Stack Overflow, Q&A for professional and enthusiast programmers

Code for most posts is available on my GitHub account.

Popular Posts

Archives

Series

Powered by WordPress with the Passion for Coding theme.