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

Nunito Character Sizes Inconsistent with Certain "font-size" Values #632

Closed
thomas-j-moffett opened this issue Feb 3, 2017 · 44 comments · May be fixed by m4rc1e/NunitoFont#3
Closed

Nunito Character Sizes Inconsistent with Certain "font-size" Values #632

thomas-j-moffett opened this issue Feb 3, 2017 · 44 comments · May be fixed by m4rc1e/NunitoFont#3
Assignees

Comments

@thomas-j-moffett
Copy link

thomas-j-moffett commented Feb 3, 2017

This is happening for me on Windows 10 on latest Chrome, Firefox and IE 11 (but doesn't seem to be on Microsoft Edge).

I tested the problematic font-size that I was having on the Google fonts page and it produced the same results:
image
(click image for larger size)

The way I tried that was to go to this specimen page, https://fonts.google.com/specimen/Nunito, and select the element (shown in the picture above) and add a font-size: 0.8571rem; property to the styles (using Chrome). This resulted in a computed font-size: 11.994px, which is exactly the font-size I was seeing on my site that was having the issue. I noticed that the issue seems to go away (haven't done extensive testing though) when the computed font size is somewhere between 12.5px and 13px and higher.

I guess this is mostly an issue with the capital letters, however, I am using all uppercase letters for some buttons and other things on the site I am working on, and it is causing very noticeable differences for letters within the same word.

I wanted to add that I tried this same thing on the Muli font (since I was looking at that as a possibility instead of Nunito), and Muli does not have this issue.

**UPDATE: I investigated this issue a little more and I guess it might not be caused by a fractional computed font-size value. I tried font-size of 11px and 12px directly and it seemed to be an issue for those cases and just happened that my fractional value fell in that range, but 10px seemed normal and 13px and above as well (didn't try less than 10px).

@thomas-j-moffett thomas-j-moffett changed the title Nunito Character Sizes Inconsistent with Fractional "font-size" Nunito Character Sizes Inconsistent with Certain "font-size" Values Feb 3, 2017
@davelab6
Copy link
Member

@tmoffett-centrify thanks for reporting this!

It looks like ttfautohint (maintained by @lemzwerg) is doing this, and it might be possible to tweak its args to prevent this.

Meanwhile @m4rc1e and @felipesanches are planning to re-ttfautohint the whole GF collection, so it would be good to get to the bottom of this :)

@davelab6 davelab6 added this to the Bugs in Font Files Requiring Rebuild milestone Feb 10, 2017
@lemzwerg
Copy link

This is a bug in FreeType's auto-hinter (and thus in ttfautohint also). Will fix it soon.

@lemzwerg
Copy link

Fix now in git.

hubot pushed a commit to aosp-mirror/platform_external_freetype that referenced this issue Feb 13, 2017
Problem reported as

  google/fonts#632

The font in question (Nunito) has values 705 and 713 for the
reference and overshoot values, respectively, of the first blue
zone.  Blue zone 2, however, has value 710 for both the reference
and overshoot.  At 12ppem, reference and overshoot of blue zone 0
becomes 8px, while blue zone 2 becomes 9px.

A peculiarity of this font is that the tops of isolated vertical
stems like `N' have a slight overshoot also.  The auto-hinter tries
to find the nearest blue zone using the *original* coordinates.  For
vertical stems, this is value 713.  For normal horizontal tops like
in character `E', this is value 710.  Since value 713 is mapped to
8px but value 710 to 9px, `N' and similar characters are one pixel
higher than `E', which looks very bad.

This commit sanitizes blue zones to avoid such a behaviour.

* src/autofit/aflatin.c (af_latin_sort_blue): New function.
(af_latin_metrics_init_blues): Sort blue values and remove overlaps.
@davelab6
Copy link
Member

davelab6 commented Feb 13, 2017 via email

@thomas-j-moffett
Copy link
Author

Cool! Glad to see this addressed so quickly! Thanks!

@davelab6
Copy link
Member

davelab6 commented Feb 16, 2017 via email

@lemzwerg
Copy link

Well, with a git version of FreeType you get immediately better results if auto-hinting is activated ('slight hinting') on a GNU/Linux box...

@thomas-j-moffett
Copy link
Author

@davelab6 Well, I've seen some projects where issues go on for years not addressed at all, so I was glad to see that you guys jumped on this one quickly and have a resolution. Thanks!

mydongistiny pushed a commit to BenzoRoms/external_freetype that referenced this issue Apr 3, 2017
Problem reported as

  google/fonts#632

The font in question (Nunito) has values 705 and 713 for the
reference and overshoot values, respectively, of the first blue
zone.  Blue zone 2, however, has value 710 for both the reference
and overshoot.  At 12ppem, reference and overshoot of blue zone 0
becomes 8px, while blue zone 2 becomes 9px.

A peculiarity of this font is that the tops of isolated vertical
stems like `N' have a slight overshoot also.  The auto-hinter tries
to find the nearest blue zone using the *original* coordinates.  For
vertical stems, this is value 713.  For normal horizontal tops like
in character `E', this is value 710.  Since value 713 is mapped to
8px but value 710 to 9px, `N' and similar characters are one pixel
higher than `E', which looks very bad.

This commit sanitizes blue zones to avoid such a behaviour.

* src/autofit/aflatin.c (af_latin_sort_blue): New function.
(af_latin_metrics_init_blues): Sort blue values and remove overlaps.

Signed-off-by: mydongistiny <[email protected]>
@nolde
Copy link

nolde commented Nov 16, 2017

Just adding further info:

I have been noticing the same issue with Nunito on our website, with uppercase glyphs in small font sizes in Windows only.

On the image below, you can see that the N looks larger than the other letters:

nunito_00

On the next one, DO looks smaller than WN:

nunito_01

The results are consistent between different browsers in Windows. Folks using mac over here don't experience the issue.

@davelab6
Copy link
Member

This is definitely a ttfautohint issue, but according to @lemzwerg above the latest version of ttfautohint should fix this.

@alexeiva please confirm if this is fixed when you prepare the next release of Nunito :)

@alexeiva
Copy link
Collaborator

By default Glyphs generates CFF based webfonts. To avoid this @schriftgestalt recommends adding a Save as TrueType custom parameter. https://forum.glyphsapp.com/t/ttfautohint-different-from-project/3186/5

Can this be the issue?

@davelab6
Copy link
Member

davelab6 commented Nov 24, 2017 via email

@ben4d85
Copy link

ben4d85 commented Feb 3, 2018

I am experiencing the exact same issue when using text-transform: uppercase; font-size: 12px; with Nunito on Windows, Chrome.

Any update on when an actual fixed Nunito font will be available for download on Google Fonts?

@rwsansom
Copy link

rwsansom commented Feb 8, 2018

Sadly, the designer of Nunito, Vernon Adams, passed away in 2016 - so unless Google Fonts can fix the font on his behalf, it's unlikely this issue will be resolved.

You can read more about Vernon at SansOxygen.com/Donate. He was a talented designer.

@alexeiva
Copy link
Collaborator

Re-generating from GlyphsApp with ttfautohint on did not fix issue.
Tested on Windows 10, and 7, Chrome 63

@ 11-12px the x-height jump is evident

screen shot 2018-02-27 at 11 03 01 pm

screen shot 2018-02-27 at 11 06 55 pm

Below is a test with no hinting. The issues is fixed at the expense of poor rendering of other sizes.
screen shot 2018-02-27 at 11 53 31 pm

I need to experiment with custom options like increase-x-height=1 and others.

@alexeiva
Copy link
Collaborator

Exported from Glyphs with no hinting, used ttfa options ttfautohint -v -a nnn. This fixed the issue:

screen shot 2018-02-28 at 12 32 41 am

I made a testing html here: http://www.cyreal.org/test4/index.html

@nolde
Copy link

nolde commented Feb 28, 2018

Accessing http://www.cyreal.org/test4/index.html in Windows 10, Chrome 63.0.3239.132 64-bit, I see no mismatching size artefacts on the font. Looks good!

@alexeiva
Copy link
Collaborator

@nolde thank you for the confirmation.

Here is a pre-release with the fixed fonts: https://github.com/alexeiva/NunitoFont/releases/tag/v3.502

@alexeiva
Copy link
Collaborator

@davelab6 fixed now

@ben4d85
Copy link

ben4d85 commented Apr 25, 2018

@alexeiva Will this fix be applied to the version of Nunito on Google Fonts?

<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

As is, the height of uppercase letters on smaller font sizes is still inconsistent:
nunito-height-issue

@alexeiva
Copy link
Collaborator

@m4rc1e is responsible for pushing this out

@m4rc1e
Copy link
Collaborator

m4rc1e commented Apr 29, 2018

@alexeiva I'll inspect what you've done. If its fine, we'll make a pr to the official googlefonts Nunito repo.

@m4rc1e
Copy link
Collaborator

m4rc1e commented Apr 29, 2018

@alexeiva @ben4d85 I haven't been able to replicate this issue on any of the browsers listed. I wonder if the users raising this issue are using custom rasterization settings?

Anyways, if people want to test this themselves, I've uploaded Alexeiva's version against the current hosted GF version.

http://www.gf-regression.com/compare/9c0b77a8-eeef-4af1-9700-ecfcf13b9a0d

Toggle the before and after button and let me know what you think.

@nolde
Copy link

nolde commented Apr 29, 2018

Using the gf-regression link left by @m4rc1e , I can see the following results:

FONT BEFORE:

image
notice H, I and N sizes

FONT AFTER:

image
all good!

The issue seems to be fixed, no size differences between glyphs.

And about the reproducibility, @m4rc1e , it seems to be related to very small font-sizes and Windows, not browsers. It is also affected by the system's DPI settings.

@m4rc1e
Copy link
Collaborator

m4rc1e commented Apr 30, 2018

@nolde Interesting thank you very much for checking!

This release also has significant improvements over the version currently served. I'll get it pr'd into the upstream then push it here.

@davelab6
Copy link
Member

<3 it

@nolde
Copy link

nolde commented Apr 30, 2018

Thanks a lot for the pull request, @m4rc1e !

Quick question: how long after the merge does it become available through https://fonts.googleapis.com ?

@m4rc1e
Copy link
Collaborator

m4rc1e commented May 1, 2018

'It depends'. The family usually goes through another round of checks and is then pushed. Could be a week, could be longer.

@ben4d85
Copy link

ben4d85 commented May 2, 2018

To confirm, using the gf-regression link left by @m4rc1e , the problem of size difference between glyphs does appear for Fonts Before, but does not appear for Fonts After. So it seems to be fixed!

Please update this thread once the new version is available through https://fonts.googleapis.com/

Thanks for your help! Can't wait to use this!

@nolde
Copy link

nolde commented Jun 29, 2018

The following screenshot was taken today:

nunito-still-broken

Nunito font coming from https://fonts.googleapis.com is still showing this problem. We are now around two months from the fix; any idea on why it is not deployed yet?

Sorry for being annoying, I just want to know if I can drop my workaround for small font sizes or not. =)

@davelab6
Copy link
Member

davelab6 commented Jun 29, 2018 via email

@brandynmorelli
Copy link

@davelab6 - Any hope of this getting shipped soon? :)

@rtud
Copy link

rtud commented Sep 10, 2018

@davelab6: Any update on when this will be live? Looking forward to using Nunito in an active project. Thanks!

@thomas-darling
Copy link

@davelab6 We really need the fix for this - any update on when we can expect it to be released?

@thomas-darling
Copy link

@davelab6 This problem was reported more than a year ago, and now another month has passed without any update or fix. I understand we're all busy here, but if the issue is fixed and it just need to be released, it really shouldn't take this long.

Issues like this affect our customers perception of the quality of our products, and it forces us to make less than ideal design choices, in an attempt to avoid those font sizes. That's not a sustainable situation, and if this is the level of support we can expect from Google fonts, then we're better off giving up on it.

@davelab6
Copy link
Member

davelab6 commented Oct 9, 2018

@m4rc1e you said,

I'll get it pr'd into the upstream then push it here

googlefonts/nunito#12 was the upstream PR which was merged

But AFAIK there hasn't yet been a PR to this repo, is that right?

@lynn
Copy link

lynn commented Oct 24, 2018

@davelab6 @m4rc1e A project I'm on could really use this fixed :) Any updates?

@Zeroto
Copy link

Zeroto commented Jun 18, 2019

@m4rc1e Any updates on this? google fonts still seems to supply the version with the problem.

@m4rc1e
Copy link
Collaborator

m4rc1e commented Jun 19, 2019

@Zeroto finalising #1549 now.

@nolde
Copy link

nolde commented Jul 29, 2019

What's the current status?

@fatcatx
Copy link

fatcatx commented Jul 29, 2019

Nunito Sans is the fixed version

https://fonts.google.com/specimen/Nunito+Sans

@nolde
Copy link

nolde commented Jul 30, 2019

Yep, it seems to be for the fonts dashboard.
I got the wrong one yesterday, but it must have been caching on my side. I'll recheck and report back.

EDIT: Plain Nunito is not fixed.
https://fonts.google.com/specimen/Nunito
image

@ketonik
Copy link

ketonik commented Jan 5, 2020

Same issue with Titillium Web

https://fonts.google.com/specimen/Titillium+Web?selection.family=Titillium+Web

On macOS 10.6 to 10.14..x it look perfect at defined pt/px font size or any zoomed size.

Windows and Linux, the digits are very much noticeably a different height

Digits 1, 4, 5, 7
much lower than (1 pixel less)
Digits 2, 3, 6, 8, 9, 0

0 next to 4, the 4 is tiny
Put a 1, 4, 5, 7 next to a capital letter A, H M etc, again, digits look tiny and very wrong.

On Linux change the zoom in browser and the difference in digit height is less noticeable, I don't have Windows now to look bit probably is similar observation.

@nolde
Copy link

nolde commented Jan 5, 2020

Hello!

Just confirming that, after the merge in 21 Nov 2019, I cannot reproduce the issue using the fonts dashboard.

Seems finally fixed.
Thanks!

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

Successfully merging a pull request may close this issue.