Typography nerd, meet coding nerd. —

Open source typeface “Hack” brings design to source code

Sweet spot is 8px-12px, but you can tell the difference between I and 1 at 6px.

Behold, some of the most commonly confused characters become distinguishable with Hack.
Behold, some of the most commonly confused characters become distinguishable with Hack.

The days of coders being shackled to Monaco or Courier New ends now. At SourceFoundry.org this week, programmer Chris Simpkins debuted the 2.0 version of Hack, an open source typeface designed specifically for use in source code.

Hack is characterized by a large x-height, wide aperture, and low contrast design in order to be "highly legible" at common coding text sizes. Its "sweet spot runs in the 8px-12px range on modern desktop and laptop monitors," Simpkins writes on GitHub. "Combine it with an HD monitor and you can comfortably work at 6 or 7px sizes." As seen in the image above, there's a heavier semi-bold weight in the regular font, and strategic serifs eliminate large gaps on each side of narrow characters. As Simpkins notes on the SourceFoundry site, this helps to distinguish glyphs like the lowercase l and number 1 at small text sizes.

Hack's roots are in the libre, open source typeface community, and the project expands upon the contributions of the Bitstream Vera & DejaVu projects. (See a full contributors list here.) Simpkins has been working on the project throughout 2015, and he tweeted that this latest version includes "new open type features, changes in weights, significant changes in spacing, Powerline glyphs, and more." The typeface now comes with four font styles: Regular, Bold, Oblique, and Bold Oblique. 

Hack has been released as a free and open source project (available via SourceFoundry and GitHub) that is free to modify, to use in commercial situations, and to download for print, desktop, or Web. To display the typeface within its element, Sourcefoundry.org provides examples of Hack within Python, C, and Javascript. There's also a traditional font specimen available.

Hack on display in Python.
Enlarge / Hack on display in Python.

Channel Ars Technica