Using Hack Font with Atom


#1

I’m trying to use the Hack font in Atom, but when I change the font to Hack, Atom ends up treating leading spaces oddly. For instance, here is what a bit of ruby code looks like using Input Mono as the font:

Notice the invisible spaces, and the consistent indentation of 2 spaces. Here is the same block when using Hack:

The invisible spaces are no longer displayed, and the spacing is actually about 2.5 characters intead of 2 spaces - actually, it’s almost 3 spaces.

Any ideas on what may be happening here and how to fix it?


#2

What OS are you using? I can’t reproduce this on OS X 10.9


#3

Sorry about that. I’m on Mac OS X 10.11.6, using Atom 1.10.2

I just tried Safe Mode by the way and disabled my stylesheet, and it still happens.


#4

What happens if you change the invisible character for spaces?

Just in case that font doesn’t contain the character, or it’s being treated weirdly.


#5

Regardless of what I type for the invisible space, Atom shows no character after the word “Default:” in the invisible spaces box. If I turn off invisible characters, the leading spaces snap back to the width they should be, but I lose the ability to see invisible characters.


#6

So if you change that from the default to say *, the box still says Default: instead of *? Or does it just display as an ‘empty’ box?

Because it looks to me like the font is missing the character which is being used by default. So the non-fixed width blank space/non-displaying character is what is being used instead of the fixed width character that’s expected. But if it’s auto-defaulting and auto-defaulting to a character that’s not displaying correctly, then that sounds like a much bigger problem overall.

Ok, so I had a go using the Hack font, just to see if there was a character or not or if I saw any of the same problems, and I can’t reproduce them in Atom 1.10.2/OSX 1010.5. The character is there, so that’s not the issue, but I don’t seem to be getting the Default: oddness.


#7

Hmm…

I could have sworn I tried an * as well as some other characters, but I just tried entering an * and it accepted it this time. And that gives me proper behavior with leading spaces.

I’ll try uninstalling Hack and then reinstalling, just in case there was an install problem.


#8

Okay, it looks like there was an installation problem of some sort. I cleaned out the old font and reinstalled it, and everything works as expected now. Thanks for helping out with this.


#9

Excellent! Happy to help, glad we got to the bottom of it!