Skip to content

[Linux] Increased font spacing in Emacs #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjgiarlo opened this issue Aug 31, 2015 · 27 comments
Closed

[Linux] Increased font spacing in Emacs #38

mjgiarlo opened this issue Aug 31, 2015 · 27 comments

Comments

@mjgiarlo
Copy link

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.

@abramhindle
Copy link

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.

@chrissimpkins
Copy link
Member

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?

@abramhindle
Copy link

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.

@mbunkus
Copy link

mbunkus commented Aug 31, 2015

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.

@Paethon
Copy link

Paethon commented Aug 31, 2015

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.

@mjgiarlo
Copy link
Author

@chrissimpkins 👏 The OTF font works A-OK for me too. That suggests two courses of action to me:

  1. Change the README to recommend using OTF fonts (#worksforme)
  2. "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!)

@XANi
Copy link

XANi commented Aug 31, 2015

OTF one still have weird vertical spacing issue, compare (dejavu, in plain terminal)
zaznaczenie_2015-08-31_002

to (hack otf, but it is same for ttf)
zaznaczenie_2015-08-31_001

@abramhindle
Copy link

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.

@eneq
Copy link

eneq commented Aug 31, 2015

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.

@ghost
Copy link

ghost commented Aug 31, 2015

👍 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.

@chrissimpkins
Copy link
Member

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.

@chrissimpkins
Copy link
Member

and thanks for sharing the fix!

@mjgiarlo
Copy link
Author

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
#38 (comment).

@ghost
Copy link

ghost commented Aug 31, 2015

@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):
screenshot_20150831_151902

Not really sure what I'd be looking for, to be honest.

@schauveau
Copy link

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)

@schauveau
Copy link

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

@eneq
Copy link

eneq commented Aug 31, 2015

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...

hack-win
dejavu
hack

@fommil
Copy link

fommil commented Sep 1, 2015

👍 seeing same thing with TTF font in Debian unstable Emacs 24.5 fixed by OTF

@chrissimpkins chrissimpkins changed the title Increased font spacing in Emacs [Linux] Increased font spacing in Emacs Sep 2, 2015
@schauveau
Copy link

Have a look to #56
The TTF for build v2.011 mentioned in one of the later comments seems to solve the spacing problem

@mjgiarlo
Copy link
Author

mjgiarlo commented Sep 2, 2015

I'm not seeing any issues with the v2.010 OTF fonts, FWIW. Thanks though @schauveau

@jimvanm
Copy link

jimvanm commented Oct 2, 2015

I have the exact same issue, in Windows, using UltraEdit (currently 21.30.0.1010, but earlier versions too). Only the 'regular' Hack font has the issue. The rest line up OK. The problem manifests itself as the cursor ending up in the wrong place. It's as if the cursor knows it's a fixed-width font, but the render of the font adds a few points to the spaces, so the cursor does not line up visually with the font it's affecting. I've attached a gif that attempts to demonstrate.
ezgif-3568225737

@chrissimpkins
Copy link
Member

is this with the most recent version of Hack? v2.015

@jimvanm
Copy link

jimvanm commented Oct 2, 2015

I did install the 2.015 version, but it didn't take. I uninstalled Hack completely, rebooted, and tried again. It appears to be working correctly now. Thanks for the reply.

@chrissimpkins
Copy link
Member

excellent, possibly just a font caching issue then. let me know if you see any other issues.

@jimvanm
Copy link

jimvanm commented Oct 5, 2015

It's looking good.

Thanks so much for creating and releasing this font. It is such a pleasure
to view code with it!

Regards,

Jim

On Fri, Oct 2, 2015 at 9:14 AM, Chris Simpkins [email protected]
wrote:

excellent, possibly just a font caching issue then. let me know if you see
any other issues.


Reply to this email directly or view it on GitHub
#38 (comment).

@chrissimpkins
Copy link
Member

It's great to hear that! Thank you very much for the feedback. I really appreciate it. Please let me know if you run into any other issues.

@ronilaukkarinen
Copy link

Removing all traces of Hack and reinstalling OTF fixed this for me as well. I'm on OS X and Sublime Text 3 (related tweet).

OTF version is slightly sharper for some reason. Better, actually.

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

No branches or pull requests

12 participants