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…
Or in PowerShell…
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
.
Reboot and the font is available in the properties for PowerShell and the command prompt.
I’m curious, why do you choose Hack over Consolas?
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.
…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!
I’m sorry, but to be honest I haven’t even tried VS Code myself yet (it’s a bit embarrassing, I know).
You can find instructions on how to change your font in VSCode in the following link: https://www.alphr.com/vs-code-how-to-change-font/