Hack: Whitespace rendering issue in Sublime Text 3 (OS X)

Created on 23 Jun 2017  ·  17Comments  ·  Source: source-foundry/Hack

Following up on a Twitter discussion.

The apparent problem: whitespaces are not rendered with a fixed width of 1 character.

hack-whitespace-bug

The regression happened a few builds ago, would not be able to pinpoint exactly which one but at time of writing, It's occurring with ST3 Dev Channel Build 3139, running on macOS Sierra 10.12.5

Any other font I've tried (Inconsolata, Source Code Pro, Mononoki, Monaco) renders the same text properly in the same build of ST3:

reference-inconsolata

The problem is definitely linked to ST3 because the same text renders just fine using Hack in TextEdit.app for instance.

It might be a hint that ST3 with settings "draw_white_space": "all" does not render whitespace with a dot as it does for Inconsolata in the screenshot above. The problem remains with draw_white_space is disabled.

Comparing indentation with tabs vs spaces:

tabs-vs-spaces

I've deleted and reinstalled Hack from the latest archive (Font Book version info says Version 2.020; ttfautohint (v1.5) -l 4 -r 80 -G 350 -x 0 -H 181 -D latn -f latn -m "Hack-Regular-TA.txt" -w G -W -t -X "")

This is not a problem only on my system, others have reported the issue:
https://forum.sublimetext.com/t/dev-build-3132/28529/50

Let me know if I can be of any help.

Spacing issue bug

Most helpful comment

@chrissimpkins Removing Hack, clearing the macOS font cache, reinstalling Hack and restarting ST3 did the trick. I can now enjoy my favorite programming typeface again. Thank you so much! 👍

All 17 comments

Can you confirm that you are using (or seeing this in) a default theme for ST so that we can start without any interference from outside packages?

Reported in linked thread above re: same issue in Win 10:

So from the changelog it seems the "draw_white_space": "all" regression should be fixed, yet nothing changed at all using the Hack font on windows 10 and spaces as indentation do not show up at all, tabs do and work fine also the indentation is off still (as described by planet), as if my fixed-width font is not fixed-width at all

errr, after reinstalling the latest hack font and rebooting, it now works fine, including indentation

It sounds as though the changes included in ST3 dev builds in the last ~ 1.5 months introduced some new white space problems.

Digging through the changelogs to see if we can identify any potential issues. The fact that it is rendering something other than the middle dot for spaces with Hack and is rendering middle dot for other fonts suggests to me that ST3 dev may be substituting another default font's character for something that is missing in Hack (or being perceived as missing, we do include the middle dot).

Whitespace Changes in ST3 dev builds since 3/2017:

3132

  • Improved visible whitespace rendering on HiDPI displays

3133

  • Fixed a visible whitespace regression in 3132

Only changes in that timeframe that I can find. These builds were in late May/early June and seem to jive with the timeframe that you reported. Do you know how we might be able to dig into the actual changes that were made in these builds?

I have the same problem if I use the default theme (for the record, I was using Soda Light 3.sublime-theme when I took the screenshots).

I have the same problem if I use the default theme (for the record, I was using Soda Light 3.sublime-theme when I took the screenshots).

👍

Unfortunately with a closed source application, I don't know how far we are going to get with this. I don't know how they are rendering the spacing / glyph selection for spaces. Dev responsive to questions on the forum?

I don't know how responsive the developers are on the forum but I have posted a link to the issue in a thread about this regression which was started less than 24h ago. Lots of Hack users out there! 😄

Added a comment to that thread. Will you please update here if any additional information emerges that might highlight the cause of the problem and/or workaround/fixes?

I'll surely do. I can't wait to be able to reuse Hack with ST3.

A couple of initial things that you can test:

If that doesn't work, can repeat the above process but try the otf builds instead of ttf.

I've had multiple reports that installing the latest version of Hack solves the problem. @xavier have you tried that? I posted more details on our implementation change at https://forum.sublimetext.com/t/spacing-in-dev-build-3139/29351/9.

Thanks @wbond

It sounds like he is using our latest release version:

I've deleted and reinstalled Hack from the latest archive (Font Book version info says Version 2.020; ttfautohint (v1.5) -l 4 -r 80 -G 350 -x 0 -H 181 -D latn -f latn -m "Hack-Regular-TA.txt" -w G -W -t -X "")

Perhaps a font caching issue either on the OS X platform or in ST3 if you are caching fonts there? This could explain the issue if you switched to the middle dot character in build 3132/3133 because I believe that we added this glyph in one of the early'ish releases of Hack. If there is an old cached version of the font files in use by the platform or ST3, then this would lead to this problem.

For OS X font caching issues, you can use the clear font cache instructions in the links above (here).

@wbond if ST3 caches fonts, is there a way to manually clear the cache after new font installs?

No, we don't cache fonts, but we do cache the glyph in memory for better drawing performance. A restart of Sublime Text would clear that out.

@wbond that is helpful! Thanks!

@xavier if you are willing to try the OS X font cache clear / reinstall approach above and then reboot your system, we can see if this addresses the problem.

As a side (but related note since similar issues on Windows were reported in the ST forum thread) font caching problems are notorious on the Win platform. It is the main reason that we released the Win installer for the fonts because there were numerous issue reports of problems that ended up being the result of conflicts between previous cached versions and newer installs. The Win font installer developed by @texhex addresses this.

Link for any Win users who wander through this thread: https://github.com/source-foundry/Hack-windows-installer

@chrissimpkins Removing Hack, clearing the macOS font cache, reinstalling Hack and restarting ST3 did the trick. I can now enjoy my favorite programming typeface again. Thank you so much! 👍

@xavier fantastic! enjoy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eoli3n picture eoli3n  ·  14Comments

hwdef picture hwdef  ·  8Comments

ben-albrecht picture ben-albrecht  ·  3Comments

luckydonald picture luckydonald  ·  8Comments

mozartilize picture mozartilize  ·  7Comments