• Stars
    star
    16,474
  • Rank 1,712 (Top 0.04 %)
  • Language
    Shell
  • License
    Other
  • Created over 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A typeface designed for source code

Hack

GitHub release Build Status Contributors Join the chat at https://gitter.im/source-foundry/Hack Github All Releases

Don't like the development noise from the repository but want to keep up with changes? Check out our gitter Hack channel. Have a quick question that doesn't require an issue report? Drop by our gitter Help channel and ask away.

A typeface designed for source code

Hack is designed to be a workhorse typeface for source code. It has deep roots in the free, open source typeface community and expands upon the contributions of the Bitstream Vera & DejaVu projects. The large x-height + wide aperture + low contrast design make it legible at commonly used source code text sizes with a sweet spot that runs in the 8 - 14 range. The full set of changes to the upstream source are available in the changelog.

The project is in active development, and we welcome your input and contributions. You may view our design objectives and instructions on how to contribute in CONTRIBUTING.md.

Frequently asked questions are answered in our FAQ.

Contents

Specimen

Hack — a typeface designed for source code

Overview of features

  • Typeface Name: Hack
  • Category: Monospaced
  • Character set support: ASCII, Latin-1, Latin Extended A, Greek, Cyrillic
  • Powerline Support: Yes, included by default
  • Included Styles: Regular, Bold, Italic, Bold Italic

Quick installation

NOTE ON FONT UPDATES If you are updating your version of Hack, be sure to remove the previously installed version and clear your font cache first to avoid conflicts that can lead to platform-specific rendering errors. Many platforms/distros offer package managers that automate this process. We release a Windows installer to automate the install/update process on the Windows platform. See below for additional details.

Linux

  1. Download the latest version of Hack.
  2. Extract the files from the archive (.zip).
  3. Copy the font files to either your system font folder (often /usr/share/fonts/) or user font folder (often ~/.local/share/fonts/ or /usr/local/share/fonts).
  4. Copy the font configuration file in config/fontconfig/ to either the system font configuration folder (often /etc/fonts/conf.d/) or the font user folder (often ~/.config/fontconfig/conf.d)
  5. Clear and regenerate your font cache and indexes with the following command:
$ fc-cache -f -v

You can confirm that the fonts are installed with the following command:

$ fc-list | grep "Hack"

Some Linux users may find that font rendering is improved on their distro with these instructions.

macOS

  1. Download the latest version of Hack.
  2. Extract the files from the archive (.zip) and click to open them.
  3. Follow the instructions from your operating system.
  4. Enjoy!

Windows

Hack Windows Installer

The Hack Windows Installer simplifies installation on the Windows platform. The tool guides you through the installation process and addresses some common rendering issues that occur with font installs/updates on the Windows platform. This tool is the recommended installation approach for Windows users.

Chrome/ChromeOS

To use with Secure Shell, edit the following fields in Options:

  • font-family: "Hack"
  • user-css: https://cdn.jsdelivr.net/npm/hack-font@3/build/web/hack.css

Package managers

We highly recommend the convenience of a community developed package manager or other auto-updating utility if this is available on your platform. While the package manager releases may be a bit delayed relative to the repository releases, the packages distributed through these package managers were designed to tune and automate font installs and updates on your system.

We are aware of Hack support in the following package managers (with associated package names):

  • Arch Linux: ttf-hack
  • Chocolatey (Windows): hackfont
  • Debian: fonts-hack-ttf
  • Fedora / CentOS: dnf-plugins-core :: heliocastro/hack-fonts :: hack-fonts
  • Gentoo Linux: media-fonts/hack
  • Homebrew Cask (OS X): homebrew/cask-fonts/font-hack
  • Open BSD: fonts/hack-fonts
  • OpenSUSE: hack-fonts
  • Ubuntu: fonts-hack-ttf
  • Visual Studio Package Manager: hack.font

For installation issues with Hack packages, please contact the package maintainer directly.

Web font usage

Hack is available in the woff and woff2 web font formats. Bold and italic styles are included by default and work out-of-the-box via the <strong> and <em> tags.

Hack is available through the jsDelivr and cdnjs CDN services:

jsDelivr cdnjs

The following snippets provide examples of Hack web font use through the jsDelivr CDN. Adjust the URL paths to those provided by cdnjs (click the link above to find the appropriate URL) to switch to the cdnjs CDN.

1. Add Hack to HTML

Include one of the following in the <head> section of your HTML file:

Subset web fonts

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3/build/web/hack-subset.css">

Full character set web fonts

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3/build/web/hack.css">

2. Add Hack to CSS

pre, code { font-family: Hack, monospace; }

See the WEBFONT_USAGE.md documentation for additional details, including instructions on how to download, host, and serve the web fonts on your web server.

Additional tools for Hack font customization

Customize your build with alternate glyph styles

The alt-hack library includes a (growing) collection of alternate glyph styles that can be used to customize your Hack fonts. Don't like the default zero style? Swap out the UFO design source with a slashed zero or dotted zero and build new fonts that work better for you.

We welcome contributions of new alternate glyph styles in the alt-hack repository. Design something new that works well with rest of the typeface and submit a pull request to the alt-hack repository so that others can use it in their custom builds.

Detailed build instructions are available on the alt-hack repository README.md. Font renaming instructions to support side-by-side installs with upstream Hack are available below.

Line spacing adjustments

font-line is a tool that modifies the default line spacing used in the Hack design (20% UPM).

The following gist installs font-line and modifies line spacing for all desktop font files contained in the same directory:

Install modified and unmodified versions of Hack on the same system

If you modify the upstream Hack source or the released font binaries and would like to install your modified fonts on the same system with the Hack fonts as released here, you can use the fontname.py Python script to define a new font name in the binary files. For example, you can install Hack on your platform along with a 15% UPM line spacing adjusted version as Hack Fifteen. Modify default glyphs with those in our alt-hack repository or design your own and define your creation with any name that you'd like. Following installation, your renamed fonts should show under the name that you define with the script so that you can switch between any of them as you need.

Usage details and examples are provided on the fontname.py repository README.

Resources

Contributing

We welcome contributions to Hack! Please review our CONTRIBUTING.md document for details.

Built With

Hack is built with the following free, open source projects:

  • Font Bakery - post-compilation modifications
  • fontmake - UFO to ttf compilation
  • fontTools - OpenType table read/write
  • font-v - font version string editor
  • ink - stream editor for text file templating
  • OpenFV - open specification for semantic typeface versioning
  • sfnt2woff_zopfli - ttf to woff web font compilation
  • ttfautohint - ttf instruction sets
  • uni - Unicode code point search
  • ufodiff - UFO source diffs
  • ufoLib - UFO source file reads/writes/testing
  • ufolint - UFO source file linting for CI testing
  • woff2 - ttf to woff2 web font compilation

Acknowledgments

We would like to acknowledge and thank the jsDelivr and cdnjs teams for their support of the Hack project through their free web font CDN services. We greatly appreciate the tremendous support of open source software development by the Semaphore CI team. Their free CI testing service and rapid, excellent technical support have been tremendous assets for our project. Lastly, a huge thanks go out to all of those who do the unrecognized work to get Hack out there to users so that it is easy to access, install, upgrade, and use. There are redistribution package managers, review committee members, testers, and others across platforms/distros/applications who perform this thankless work and often go unrecognized. Your efforts are much appreciated.

License

Hack work is © 2018 Source Foundry Authors. MIT License

Bitstream Vera Sans Mono © 2003 Bitstream, Inc. (with Reserved Font Names Bitstream and Vera). Bitstream Vera License.

The font binaries are released under a license that permits unlimited print, desktop, web, and software embedding use for commercial and non-commercial applications.

See LICENSE.md for the full texts of the licenses.

More Repositories

1

Hack-windows-installer

A Windows installer for the Hack typeface
Inno Setup
751
star
2

font-line

OpenType vertical metrics reporting and font line spacing adjustment tool
Python
184
star
3

Slice

An open-source, cross-platform GUI app to generate custom font design spaces from variable fonts
Python
158
star
4

alt-hack

A stylistic alternate glyph library for the Hack typeface
Shell
104
star
5

fdiff

An OpenType table diff tool for fonts. Based on the fontTools TTX format.
Python
41
star
6

code-corpora

Source code corpora for text analysis
Go
29
star
7

ttfautohint-build

Build ttfautohint from source on Linux and macOS platforms
Shell
27
star
8

Woffle

Drag and drop woff and woff2 web font generator for macOS
Python
27
star
9

ufodiff

UFO source file diff application
Python
27
star
10

ufolint

UFO source format linter
Python
24
star
11

hack-linux-installer

Install and upgrade the Hack typeface on the Linux platform
Shell
22
star
12

font-v

Font version string reporting and modification library + executable tool
Python
19
star
13

dehinter

A tool for the removal of TrueType instruction sets (hints) in fonts
Python
16
star
14

fontmake-mp

Concurrent font compilation from UFO source files with fontmake
Python
15
star
15

FSCW

Toolkit to create Windows desktop setups for fonts.
Inno Setup
12
star
16

uni

Unicode code point search
Go
11
star
17

manual-ttfa

Manual ttfautohint Instruction Set Adjustments with Delta Exceptions and Control Instructions Files
8
star
18

ufofmt

A fast, flexible UFO source file formatter based on the Rust Norad library
Rust
7
star
19

text-specimens

Text specimens for the display of typefaces that are used in source code development
C
7
star
20

font-unicode

Command line Unicode character code point and character name search
Python
7
star
21

glyph-filter-lists

Glyph name filter list repository
Python
7
star
22

font-ttfa

A command line TTFA table reporting tool for fonts hinted with ttfautohint
Python
6
star
23

compare-typefaces

Simple browser tool to compare a string between several typefaces, intended to judge the legibility of easily confusable glyphs
JavaScript
5
star
24

set-unicoderange

Python script to automatically set OpenType OS/2 table Unicode range bit flags in fonts
Python
5
star
25

FilterListManager

Glyphs font editor filter list manager plugin
Python
5
star
26

panosifier

Panose data editor for fonts
Python
5
star
27

java-glyph-tester

A tool for testing the JDK font rendering behaviour
Java
4
star
28

font-size

Font file size and individual OpenType table size command line reporting tool
Python
4
star
29

library

A library of type development + design resources
3
star
30

caniusefonts

Always current cross-browser font support based on the caniuse.com API and Embed service.
3
star
31

unilist

Unicode code point list generator with support for inclusion/exclusion criteria
Go
2
star
32

Hack-Test-Win-Installer

A Windows installer for test/development builds of the Hack typeface.
Inno Setup
2
star
33

path-inspector

Quadratic font curve path inspector
Python
2
star
34

freetype2

Customized freetype2 library
C
1
star
35

freetype2-demos

A fork of the freetype2-demos applications with customizations
C
1
star
36

Slice-docs

Documentation for the Slice project
Makefile
1
star
37

opentype-notes

Interactive OpenType resource
Jupyter Notebook
1
star
38

pre-post

pre/post web font specimen sheets rendered with Flask + Jinja2
HTML
1
star