Giter Site home page Giter Site logo

source-foundry / hack Goto Github PK

View Code? Open in Web Editor NEW
16.2K 338.0 602.0 105.09 MB

A typeface designed for source code

Home Page: http://sourcefoundry.org/hack/

License: Other

CSS 4.37% Shell 75.30% Python 18.92% Makefile 1.41%
font typeface developer-tools developer ttf web-fonts hack

hack's Introduction

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.

hack's People

Contributors

alerque avatar amadio avatar burodepeper avatar chrissimpkins avatar gitter-badger avatar jacksgt avatar jakubzitny avatar jameslikeslinux avatar jbhannah avatar jdw1996 avatar jieyanhuang avatar jorgheymans avatar leriomaggio avatar mavit avatar mtelesha avatar mynetx avatar radarhere avatar sufuf3 avatar texhex avatar tombyrer avatar vl4dimir avatar xuzhao9 avatar yevshev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hack's Issues

Feature Request: Center asterisk glyph

This may just be an opinion thing, but I find that the asterisk looks better when centered on the line instead of being elevated:

Menlo for Powerline:
Menlo for Powerline

Hack:
Hack

I know this may not be a possibility, but thought I'd throw up an issue for consideration as it is an opinion thing.

Web font subsetter script

Goal is to create a script that allows users to subset the files with only character sets that they need. Working on it. If anyone has experience with this / interest in pitching in, let me know.

Missing U+00B7("MIDDLE DOT") in Regular and Oblique

Looks like the Bold and BoldOblique styles both include U+00B7 but the Regular and Oblique don't. Would be great if this could be added as it's the default character used by Atom to signify invisible whitespace, and the missing glyph causes it to use a fallback that messes up alignment

v.2.0 Failing Install on Windows

From issue report on Codeface (chrissimpkins/codeface#106):

I downloaded the latest zip on August 5th 2015.

I tried to preview the file Hack-Regular.otf but Windows errored, stating that it is not a valid font file. The >same error appears when I attempt to preview any of the Hack related .otf files.

I am unable to install any of the file also.

Powerline symbols are incorrect

Under Hack:

Under a font with proper powerline symbols (in this case Fantasque Sans):

Note how Hack's symbols don't properly fill the entire height of the character, whilst Fantasque's ones do.

[Linux] Increased font spacing in Emacs

Is anyone successfully using Hack in Emacs? I'm using it in Prelude (Emacs 24) and I see odd spacing when I set my font to Hack-Regular (have tried different sizes, from 9 to 12, with the same behavior). Interestingly, I don't see the same with either Hack-Bold or Hack-RegularOblique. See screenshots below.

First, with the oblique font (looks purty, if slanty):

screenshot from 2015-08-30 17 36 01

Now, with the regular font (wat):

screenshot from 2015-08-30 17 35 36

Any ideas? I downloaded the Hack-v2_010-ttf.zip as the README suggests for Linux installations, and tossed the .ttf files in my ~/.fonts folder. I'm using the same font w/ the same face just fine in Byobu/Tmux.

Greek upper and lower thetas are hard to distinguish

Especially at small point sizes, the greek upper and lower case thetas are hard to distinguish. As this is a programming font, and upper and lower case distinctions can be important, it might be reasonable to stylize them a bit more.

Box glyphs don't close vertically

The box glyphs don't form continuous vertical lines .. horizontals are OK. Note the gaps in the vertical lines below (from Xcode). Menlo, SourceCodePro and other "coding" fonts get it right:

screenshot 2015-08-31 00 28 40

v2.0 Test Builds are Available to Try

I am releasing test builds of the upcoming v2.0 release that will include a large number of new character sets and changes to the Hack typeface. Development is taking place in the development branch of the repository.

The new character sets include:

  • Powerline symbols (patched by default into the regular set)
  • Expanded Latin character set
  • Greek character set
  • Cyrillic character set
  • Expanded math symbols/characters
  • Armenian character set
  • Georgian character set
  • Expanded Vietanamese character set
  • Expanded pan-African character set
  • Expanded punctuation character set
  • Expanded symbol set
  • New superscript numerals
  • New subscript numerals
  • New scientific inferior numerals

This release increases the number of Hack glyphs by nearly 10-fold and should permit much broader, multilingual use of the typeface.

Current Test Releases (build v2.010)

Regular Set:

Bold Set:

Oblique Set:

Bold Oblique Set:

Testers

If you use the test versions and encounter any problems, please provide me with feedback so that we can fix any issues. Thanks much!

Hack v2.0 Test Build Examples

Here are some examples of the current test build. I'm really pleased with how this has turned out so far. I'll update the documentation with many more examples and brand new specimens with the final release.

You can download the test build binaries to give it a try. See issue #14 for the download links.

C

c

### CSS

css

JS

js

JSON

json

Python

python

Ruby

ruby

Shell

shell

Powerline support

As this is becoming more and more popular and it is now available outside vim would it be possible to add Powerline support to the font?

There's no visualize whitespace dots

Hi! Big thanks for font, it really is beautiful.

I use a useful visualize whitespace function in the Qt Creator IDE, and the Hack font is unfortunately not supported whitespace dots. But the symbols of end-of-file (diamond ◆), the tabulation (arrow →) and line break (downwards arrow↲) are displayed normally.

Screens.
Consolas:
Consolas

Hack:
Hack

Maybe you missed the glyph with the necessary point?

Esperanto support

Esperanto needs just a dozen letters with diacritics: ĉĈĝĜĥĤĵĴŝŜŭŬ (that's cC gG hH jJ sS with circumflex, and uU with breve)

Cyrillic set feedback wanted

If there are any native speakers/writers out there using it, any input that you can provide on the character shapes, positioning, and appearance would be very helpful.

Modify Cyrillic c to differentiate from Latin c

Request from #22

Problem: the Cyrillic and Latin c characters have the same shape and it is not possible to distinguish them in text.

Goal is to create visually distinct glyphs for these characters that have the same shape but different Unicode positions (and therefore can cause errors in code).

[Linux, Ubuntu, rxvt] Render hinting or something similar missing?

Hi!

I really like how hack looks like but I think that I have some issues with it and I am not sure if my settings are wrong or there is something else.

I am trying to use hack in rxvt (terminal emulator) on Linux (ubuntu). I have this line in the ~/.Xdefaults:

xft:hack:pixelsize=9:antialias=true:hinting=true

It looks like it's ghosty, not crisp enough in comparison to some other fonts I tried (like terminus in example).

Here is side by side comparison. Left is terminus, right is hack.

I hope you have some ideas what could be a problem.

terminus-hack

[Linux, OS X, Windows] Bold baseline differs from Regular baseline

Perhaps best illustrated by a screenshot:
screen shot 2015-08-30 at 12 38 11 am
(those are two different windows side by side, Sublime Text and Gnome Terminal)

The baseline of Bold text is one pixel higher than that of Regular text. This happens at 8, 9, and 10 point, and does not happen with Bold Italic.

It also probably has to do with the font rendering stack on Gnome because I've seen it on Debian 8.1 (Gnome desktop) but not on Mac OSX 10.10.

[OS X] Oblique slant does not display properly in Intellij IDEA/WebStorm/PyCharm

This is a known issue with the Java font renderer on OS X platforms for these JetBrains editors. It renders a pseudo-oblique with a larger slant angle (of the regular font) instead of the installed oblique font. I have confirmed that this occurs with other typefaces and verified this is in a known issue in the JetBrains issue reports. The issue has been reported on multiple occasions over the last year in their issue tracking system. I added my own 2 cents and will update with any information that I receive. Sorry for the troubles.

Some git-related glyphs seem slightly out of place

I'm coming from Menlo for Powerline while using zsh+powerline on OS X. When working in a git repository the glyphs seem a bit off to me.

Hack:
hack

Menlo:
menlo

I feel like the arrow, as you've changed it, would feel more natural with the glyphs in Menlo.

Add Emoji support

It would be great to have Emoji support 😎.

I regularly use e.g. ✏️, 🔍, etc as short labels in UI and they would also be nice in code comments.

Maybe the glyphs from another typeface (with a compatible license) could be reused?

They should not necessarily be colored. Something like in Segoe UI Symbol would already be a great step ahead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.