Skip to content

Instantly share code, notes, and snippets.

@chrissimpkins
Last active April 17, 2018 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrissimpkins/69660d5ebc1a4f2a2793 to your computer and use it in GitHub Desktop.
Save chrissimpkins/69660d5ebc1a4f2a2793 to your computer and use it in GitHub Desktop.
How to Use Hack in Sublime Text
{
"font_face": "Hack",
"font_size": 10
}
@amitness
Copy link

I'm having problem changing fonts.

OS: Linux Mint 17.2
Sublime Text: 3

@chrissimpkins
Copy link
Author

Amit,

Make sure that you are opening the User settings and not the Default settings panel. You will see the settings in JSON format. You may or may not already have some settings in there. This depends upon what plugins you have installed to date. The font_face and font_size settings should be added to the file, one setting per line with a comma following the definition. Save the file in the default location where ST opened it and your font should change. Note that if you were previously using Bitstream Vera Sans Mono or DejaVu Sans Mono, it may not be immediately apparent because Hack is derived from those faces.

Here are the docs on ST settings:
http://docs.sublimetext.info/en/latest/customization/settings.html

There are other settings (including subpixel_antialiasing, grey_antialiasing). Not sure if those are supported on Linux or not. This would be a good question for the ST forums.

Hope it helps!

@prachikhadke
Copy link

I updated the Preferences.sublime-settings file with "font_face": "Hack". Restarted Sublime. Don't notice any difference in font. Have Sublime text 3 on a Mac OS El Capitan.

@bassbird
Copy link

bassbird commented Sep 18, 2017

Using Hack in the recently released Sublime Text 3 Build 3143 on OS X 10.11.6 "El Capitan" results in inconsistent character widths. In my specific case I noticed the capital "F" is slightly narrower than a regular space character. Anybody else noticed this?

Edit:
Well, I updated Hack to the latest version v2.020 and in the process replaced the previously installed OTF variant of Hack with the TTF variant. I don't know if it's the new version or the TTF variant, but the widths are now consistent again, just like you'd expect from a monospaced font ;-) Leaving this out here for documentation.

@pitpit
Copy link

pitpit commented Sep 19, 2017

@bassbird Same issue here

Indent guides are not well aligned when using Hack :

image

It works well with native font :

image

Udpating Hack to v2.020 did not fix the problem.

@pitpit
Copy link

pitpit commented Sep 19, 2017

Ok, I found how to make it works cleaning font cache :

  1. Close Sublime Text
  2. Remove Hack from FontBook
  3. Clear font cache
sudo atsutil databases -remove
  1. Download the latest version of Hack
  2. Install it with FontBook
  3. Launch Sublime Text

image
@

@sfsekaran
Copy link

FYI-- clearing your font cache may necessitate rebooting, in order to rebuild the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment