[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):

Now, with the regular font (wat):

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.
I have the same problem with TTF: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7), Ubuntu 14.04.3 LTS, Gnome-Shell. Oblique doesn't have this problem.
Stumped on this one. First report I have seen with a spacing issue like this. It looks like it is increasing the em box size for every glyph so that the glyph size stays the same but the sidebearings get really wide. Let me look into Emacs rendering/spacing. I'm not familiar with it.
Mind giving the otf files a try to see if the same issue occurs?
I think I have successfully installed the .OTF files, but it seems to have the same response. I wish I had a virtualized ubuntu handy to be completely sure.
I have the very same spacing problem with Hack 2.010, GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2) on Arch Linux with the TTF. The OTF, however, looks just fine.
Yes, I can confirm this. Spacing in emacs is totally off (GNU Emacs 24.4.1). Though for me it only happens when using the ttf version. otf seems to work.
@chrissimpkins :clap: The OTF font works A-OK for me too. That suggests two courses of action to me:
- Change the README to recommend using OTF fonts (#worksforme)
- "Fix" the TTF fonts to render as expected in Emacs and Emacs-like environments.
Pls advise on whether I should close this issue or not. (I'm satisfied now, FWIW. Thanks, all!)
OTF one still have weird vertical spacing issue, compare (dejavu, in plain terminal)

to (hack otf, but it is same for ttf)

I confirm, OTF files seem to work. I ran:
sudo fc-cache -f -v
Giving me a list of font directories to scour. I found both ttf and otf laying around my computer. I removed all of them:
rm ~/.local/share/fonts/Hack-*
and reran the command. I then used the ubuntu font-viewer to install all 4 otf fonts. Upon starting emacs the font looked great.
@mjgiarlo is right. OTF work well for emacs/Ubuntu/linux.
@XANi I suggest ensuring that you really only installed 1 of them. Try running fc-cache.
Same issue but otf works fine.
I am coming from a DejaVu Sans Mono and I would switch if it weren't for the _ spacing, as a C developer I really dislike it.
:+1: for the OTF fix. I actually came here because I couldn't figure out why Emacs was behaving so weird after seeing this font in it.
Are you noticing any rendering issues on Linux with the otf files? The difference in the PostScript hinting and TrueType instruction sets are bound to raise different rendering issues on different platforms. In general, the TT instructions render better on the screen. Let's leave this issue open and I will probe in more detail so that I can determine what the problem was with the ttf files.
and thanks for sharing the fix!
I'm perfectly happy with the OTF files, so far.
On Mon, Aug 31, 2015 at 12:05 PM Chris Simpkins [email protected] wrote:
and thanks for sharing the fix!
— Reply to this email directly or view it on GitHub https://github.com/chrissimpkins/Hack/issues/38#issuecomment-136469316.
@chrissimpkins Not that I can tell, anyway. I am running Arch Linux with the Infinality patches to fontconf, etc.
Here's a screenshot of a test page (OTF):

Not really sure what I'd be looking for, to be honest.
I am not a font expert but I noticed something interesting. When dumped with fc-query there is no spacing value in the output for Hack-Regular.ttf like in other monospace fonts: fc-query Hack-Regular.ttf | grep spacing
VeraMono has spacing: fc-query VeraMono.ttf | grep spacing spacing: 100(i)(s)
But regular Vera does not fc-query Vera.ttf | grep spacing
The Hack-Bold.ttf file has spacing and works fine in Emacs fc-query Hack-Bold.ttf | grep spacing spacing: 100(i)(s)
For the OTF fix, there is an annoying issue: The 'u' characters is significantly higher than other characters for about half of the font sizes. Other characters are fine.
That does not happen with all fontconfig settings. I noticed the problem with no autohinting and with full hinting.
Setting the hinting to medium solves the problem (but makes the font too blurry for my taste)
I noticed the problem in Emacs, xterm, lIbreoffice and a few other gtk2 apps
I do have some issues with Hack (otf) in Emacs, particularly in C-mode and font-lock. There are some blurring issues that's not evident when using DejaVu Sans Mono or TTF in Windows.
I uploaded a few snapshots to give some visuals to what I see...

:+1: seeing same thing with TTF font in Debian unstable Emacs 24.5 fixed by OTF
Have a look to https://github.com/chrissimpkins/Hack/issues/56 The TTF for build v2.011 mentioned in one of the later comments seems to solve the spacing problem
I'm not seeing any issues with the v2.010 OTF fonts, FWIW. Thanks though @schauveau