Skip to content
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

[Linux] letter-height of 'u' wrong in emacs #56

Closed
duud opened this issue Aug 31, 2015 · 33 comments
Closed

[Linux] letter-height of 'u' wrong in emacs #56

duud opened this issue Aug 31, 2015 · 33 comments
Assignees

Comments

@duud
Copy link

duud commented Aug 31, 2015

screenshot

@chrissimpkins
Copy link
Member

Can you give me your platform, emacs version, and any hinting settings that you are using? Thanks

@duud
Copy link
Author

duud commented Aug 31, 2015

Linux, emacs 24.5.1, otf (ttf renders with far to large letter-spacing for me)

<match target="font">
  <test name="family">
    <string>Hack</string>
  </test>
  <edit name="antialias" mode="assign">
    <bool>true</bool>
  </edit>
  <edit name="hinting" mode="assign">
    <bool>true</bool>
  </edit>
  <edit name="hintstyle" mode="assign">
    <const>hintslight</const>
  </edit>
  <edit name="autohint" mode="assign">
    <bool>false</bool>
  </edit>
</match>

´´´

@chrissimpkins
Copy link
Member

looking into it. thank you

@duud
Copy link
Author

duud commented Sep 1, 2015

I have to thank

@mmlb
Copy link

mmlb commented Sep 1, 2015

I'm also seeing this in chrome on linux, not sure how to get info on settings

@duud
Copy link
Author

duud commented Sep 1, 2015

The font configuration is still a mess in linux....
Not all of the settings I've posted above are actually applied. I have this xrdb settings:

xrdb -query | grep Xft
Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

The settings of fontconfig which I posted above are all aplied expect for hintstyle, very strange, this bug seems to be there for ages ... So hintfull is used instead of hintslight. If I change the xrdb settings to hintslight the problem disappears. So it's rendered wrong only if hintfull is used.

@chrissimpkins
Copy link
Member

Are there any other (new) hinting issues when you switch from full to slight?

@duud
Copy link
Author

duud commented Sep 1, 2015

Slight renders fine.
But I can't change my xrdb settings to slight permanently, it's a global setting and I need it for other application/font combinations which ignore the fontconfig settings :)

@laptop006
Copy link

I'm seeing this in konsole (qt5) with slight:

$ xrdb -query | grep Xft
Xft.hintstyle:  hintslight
Xft.rgba:       rgb

@schauveau
Copy link

Try that in your .emacs
(set-frame-font "Hack:size=13:hintstyle=hintmedium")

@alerque
Copy link
Member

alerque commented Sep 1, 2015

The problem I reported in #64 is possibly a variation on this problem.

@duud
Copy link
Author

duud commented Sep 1, 2015

Thx for (set-frame-font "Hack:size=13:hintstyle=hintmedium")
I didn't know that it is possible to specify fontconfig settings in emacs.
Where is it documented?, I can't still find it.
I did some test using set-frame-font settings, the problem appears only on full hinting.

chrissimpkins: This setting are a good way to test rendering on linux

@schauveau
Copy link

I believe that this syntax is not specific to emac. This is the font naming scheme of Fontconfig.
See the "Font Names" section in http://www.freedesktop.org/software/fontconfig/fontconfig-user.html

Remark: I just noticed that hack-13 and hack:size=13 are not giving the same font size. The proper way seems to be hack-13

@andyleejordan
Copy link

Thanks for that link @schauveau. Both hingtslight and hintmedium fix the height of "u," but otherwise do not look as good as hintfull. Using the OTF fonts for the same reason, TTF renders with strange spacing.

My setup is a bit strange. Emacs 24.5.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.28) , compiled from source using GTK2 on Arch Linux. The X server is actually MobaX, part of MobaXterm on Windows 10.

@andyleejordan
Copy link

I have no clue why, but using autohint=true helps massively (and it's defaulting to false). I also found that my default rgba settings were bad, and using rgba=rgb.

So I'm using this with good results (and the OTF fonts):

(set-face-attribute 'default nil :font "Hack-12:hintstyle=hintfull:autohint=true:rgba=rgb")

I fiddled with most of the available fonts-conf options, but none of them fixed the spacing of the TTF fonts. I would encourage people to just fiddle with all the options as well to see where it gets them. I expected width=ultracondensed/condensed/etc. to change it, but alas, no change at all.

P.S. due to no reason I can think of, my issue with the height of u has gone away, even with hintfull.

@chrissimpkins
Copy link
Member

P.S. due to no reason I can think of, my issue with the height of u has gone away, even with hintfull.

...

@duud
Copy link
Author

duud commented Sep 2, 2015

The reason is the font size.
It appears only on some sizes!!!!, 12 renders fine for me, try 11 or 10 and you'll get your 'u'.

@chrissimpkins the ttf fonts in your developement branch don't have the letter spacing issue for me

@chrissimpkins
Copy link
Member

the ttf fonts in your developement branch don't have the letter spacing issue for me

@duud : you are referring to the v2.011 development branch release? This was a fix for a glyph that included an empty character position with an em box (middle dot glyph) that was set to a very large width. I wonder if this led to problems with the horizontal metrics tables.

@duud
Copy link
Author

duud commented Sep 2, 2015

Yes, I used the v2.011 dev-branch and it has no letter spacing
problems, however the ttf renders different than otf for me, the size
differs and it reacts differently to hinting settings, I prefer the otf
version

the ttf fonts in your developement branch don't have the letter spacing issue for me
@duud : you are referring to the v2.011 development branch release? This was a fix for a glyph that included an empty character position with an em box (middle dot glyph) that was set to a very large width. I wonder if this led to problems with the horizontal metrics tables.


Reply to this email directly or view it on GitHub:
#56 (comment)

@chrissimpkins
Copy link
Member

@lemzwerg: Werner, does ttfautohint modify the gasp table in the ttf files? These releases (both the current release 2.010 and 2.011) have a gasp table as follows on build (and prior to the autohint):

PPM Range Handled With
0 - 9 Smoothing
9 - 16 Instructions
17 + Instructions + Smoothing

I'm wondering if this could explain why we are seeing these type size dependent issues that seem to be influenced by the level of hinting that is applied to the glyphs. It's not clear why the u appears to be the only glyph with issues here.

There is a similar issue in #32 where bold glyphs are not aligned on the baseline with the regular set glyphs in a type size dependent fashion. In that case, it appears to be a cross-platform, cross-editor issue.

@chrissimpkins chrissimpkins changed the title letter-height of 'u' wrong in emacs [Linux] letter-height of 'u' wrong in emacs Sep 2, 2015
@lemzwerg
Copy link

lemzwerg commented Sep 2, 2015

ttfautohint replaces the gasp table; it will be set up to always use grayscale rendering, for all sizes, with grid-fitting for standard hinting, and symmetric grid-fitting and symmetric smoothing for horizontal subpixel hinting (ClearType).

Note, however, that the reported issue is related to the OpenType version of Hack, which uses PS outlines. This has nothing to do with ttfautohint.

I guess that the PS hints for the 'u' glyph are not fully correct, leading to the visual artifact.

@chrissimpkins
Copy link
Member

@lemzwerg ah, yes. You are correct. Thank you very much. I am mixing up the issues. #32 does involve the ttf files and has a similar alignment vs size issue.

I will take a look at the PostScript hints to see if there is a problem.

@chrissimpkins
Copy link
Member

@duud what hinting settings are you using in the ttf files and what are you seeing that leads to your preference for the otf builds?

@chrissimpkins
Copy link
Member

Tentative fix at this point is to switch to the new ttf build in emacs (v2.011). Let's keep this open to discuss rendering issues in these new files. Perhaps there are some settings optimizations that will lead improvement (see @duud message above re: concern about how hinting renders vs. otf files)

Download Links

Regular
Oblique
Bold
Bold Oblique

@chrissimpkins
Copy link
Member

I will build another set of otf files off of the v2.011 source once I check the hints and will push that for you to try as well if it looks better on your system.

@schauveau
Copy link

I just tried the v2.011 TTF and both the 'u' problem and the emacs spacing bugs seem to be gone.
Also, fc-query now report a proper spacing unlike with the previous TTF:

fc-query Hack-Regular-2_011.ttf | grep spacing

    spacing: 100(i)(s)

@duud
Copy link
Author

duud commented Sep 3, 2015

what hinting settings are you using in the ttf files and what are you seeing that leads to your preference for the otf builds?

@chrissimpkins This is all crazy - but with the ttf version fontsize 10 renders to small in xterm size 11 is to large, otf size 10 is in between and is perfect, also the ttf version has almost no visual difference between hintslight and hintfull so that ttf + hintfull almost= ttf + hintslight almost= otf + hintslight, whereas otf+hintfull renderds clearly bfrighter and somewhat bolder.

@chrissimpkins
Copy link
Member

Also, fc-query now report a proper spacing unlike with the previous TTF

@schauveau metrics tables were affected by this bug. hopefully addressed now. will release this bugfix this week.

@chrissimpkins
Copy link
Member

Are you still using otf files here? Would you be willing to give the new v2.014 test build of the ttf files a try and let me know how the changes affect the rendering issues that were reported (as side notes) in this thread?

Available in #111

@chrissimpkins chrissimpkins self-assigned this Oct 3, 2015
@MarkusKull
Copy link

Experiencing a similar issue under linux (debian testing) with fonts-hack-otf 2.019-1, but with too small (height) 'u' for certain text sizes. fonts-hack-ttf fixes it, but has different line-height (smaller). My workaround is fonts-hack-otf with text size 10.1 instead of 10.

@alerque
Copy link
Member

alerque commented Mar 11, 2016

Hey @MarkusKull you are not the first to notice the line height and prefer the OTF. I ran into this a while back and never got around to reporting it, but I just opened an issue for it at #188. Some feedback there about the line-height issue would be appreciated.

@chrissimpkins
Copy link
Member

Yes, this original report remains on the to do list. I think that this is going to be a hinting issue that we will need to look into. We are currently using the autohinter in FontLab Studio and I am not certain why it is leading to this problem. If anyone is motivated to explore this themselves, you might try the Adobe autohinter that is part of their Adobe font development kit. If you can come up with a set of specs that correct the problem, I am more than happy to include them in the workflow for our builds pronto. For now, we are working to make a solid set of ttf builds and will then turn our attention to the otf builds. There are lots of reasons for this, but the primary one is that I have a great deal more flexibility and control over the ttf hints at the moment and this has been a critical issue for screen use at small text sizes.

@chrissimpkins
Copy link
Member

otf builds were eliminated as of v3.000. Please update to ttf builds and let us know if you continue to experience problems. Thanks for the report!

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

No branches or pull requests

9 participants