Text smoothing differences, M57 vs M59

95 views
Skip to first unread message

Bear Travis

unread,
Aug 30, 2017, 7:38:49 PM8/30/17
to skia-discuss
Hi there,

I've noticed some significant differences in text antialiasing when moving from M57 to M59 on Win 10. The edges seem much softer / lighter in M59, particularly with light typefaces. I would like to keep more in line with the M57 behavior, as it seems closer to that of the native text components. Was this change expected, or has it been adjusted since M59?

I've attached an example of rendering the Roboto font family, with M57 on the left and M59 on the right.



Thanks for your help tracking this down,

-Bear

Further details:

OS version
Win 10 Version 1703 (OS Build 15063.540)

Skia versions
M59 cc13419addb1ca867a992f96ff4455e02cb829be
M57 e3917fd5ca950222facf027a73d95c8339bced54

Skia paint settings
paint->setAntiAlias(true);
paint->setDevKernText(false);
paint->setSubpixelText(true);
paint->setHinting(SkPaint::kNo_Hinting);

Corey Lucier

unread,
Aug 31, 2017, 8:02:38 AM8/31/17
to skia-discuss
For what it's worth this is one thing that was fixed leading into M59, and it did help on a number of use cases but it seems as though things went south elsewhere.

Here is one example from a customer, a before and after if you will..the top image is from M57, the bottom is M59, note the bad artifacts on the O and e Cyrillic shapes.


and now with M59:




We're trying to track down the specific font face used in the Cyrillic case.

So in general we haven't integrated with M60 and beyond yet to know if this has been addressed so wondering first if any changes have been made in this area since M59. 


Corey Lucier

unread,
Aug 31, 2017, 8:03:52 AM8/31/17
to skia-discuss
Sorry, this is what was fixed leading into M59 - https://bugs.chromium.org/p/skia/issues/detail?id=6487

Ben Wagner

unread,
Aug 31, 2017, 10:29:28 AM8/31/17
to skia-d...@googlegroups.com
I think the difference is that we now support SkPaint::kNo_Hinting on Windows (for new enough versions of DirectWrite), the commit you're probably looking for is 22253064ceee1dd9fcd26b7d6d69505cba76bb33 . If you want the old behavior, I think you can get it by using SkPaint::kSlight_Hinting or SkPaint::kNormal_Hinting .

On Thu, Aug 31, 2017 at 8:03 AM, Corey Lucier <corey....@gmail.com> wrote:
Sorry, this is what was fixed leading into M59 - https://bugs.chromium.org/p/skia/issues/detail?id=6487

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Corey Lucier

unread,
Aug 31, 2017, 11:15:28 AM8/31/17
to skia-discuss
But then would the issues related to those changes regress in any way? 6487 etc?

Ben Wagner

unread,
Aug 31, 2017, 11:26:32 AM8/31/17
to skia-d...@googlegroups.com
6487 I believe has more to do with whether or not vertical anti-aliasing is used or not. This case is more about whether or not any hinting is used or not. In all of the images on this thread so far, the 'before' image is obviously doing at least some horizontal stem snapping to the pixel grid, where the 'after' are not. This (and the timing) would indicate that the change in Skia is that Skia now actually does no hinting on Windows with SkPaint::kNo_Hinting specified (and that is supported). Note that the DirectWrite on Windows 7 does not support no-hinting, so if you run these examples on Windows 7 I expect you will still see the 'before' behavior.

On Thu, Aug 31, 2017 at 11:15 AM, Corey Lucier <corey....@gmail.com> wrote:
But then would the issues related to those changes regress in any way? 6487 etc?

--

Bear Travis

unread,
Aug 31, 2017, 6:25:04 PM8/31/17
to skia-discuss
Thanks for the info! It looks like hinting should help get us closer to our desired result. I think it should work well for us, except for in the Before the Rain case below.

A couple follow-up questions:

I'm still seeing a slight difference between the M57 no-hint behavior and the M59 slight/normal hint behavior, could this possibly be because of the fix for 6487?
I'm not seeing a difference between slight and normal hinting on M59 Windows. Are there some test cases where this would be more obvious, or is there a chance they are the same on Win 10 1703?
I'm also seeing a slight regression towards 6487 with hinting turned on. It happens at smaller font sizes then before (around size 20 or smaller). Is there any potential way to correct this?

Some images to help explain the rambling:


A close-up view so you can see the diff (the slightly darker 'n' in Thin is with hinting in M59):


The hinting / no hinting behavior for the Before the Rain font:

Thanks again for your help,

-Bear

On Thursday, August 31, 2017 at 8:26:32 AM UTC-7, bungeman wrote:
6487 I believe has more to do with whether or not vertical anti-aliasing is used or not. This case is more about whether or not any hinting is used or not. In all of the images on this thread so far, the 'before' image is obviously doing at least some horizontal stem snapping to the pixel grid, where the 'after' are not. This (and the timing) would indicate that the change in Skia is that Skia now actually does no hinting on Windows with SkPaint::kNo_Hinting specified (and that is supported). Note that the DirectWrite on Windows 7 does not support no-hinting, so if you run these examples on Windows 7 I expect you will still see the 'before' behavior.
On Thu, Aug 31, 2017 at 11:15 AM, Corey Lucier <corey....@gmail.com> wrote:
But then would the issues related to those changes regress in any way? 6487 etc?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Ben Wagner

unread,
Sep 1, 2017, 9:50:16 AM9/1/17
to skia-d...@googlegroups.com
On Thu, Aug 31, 2017 at 6:25 PM, Bear Travis <bear....@gmail.com> wrote:
Thanks for the info! It looks like hinting should help get us closer to our desired result. I think it should work well for us, except for in the Before the Rain case below.

A couple follow-up questions:

I'm still seeing a slight difference between the M57 no-hint behavior and the M59 slight/normal hint behavior, could this possibly be because of the fix for 6487?

Could be, we're now trying to actually respect the 'gasp' table mostly. This means that more fonts that ask to be ugly (no vertical anti-aliasing) will be drawn ugly. This is mostly due to fonts that look really bad if we do otherwise.
 
I'm not seeing a difference between slight and normal hinting on M59 Windows. Are there some test cases where this would be more obvious, or is there a chance they are the same on Win 10 1703?

There is currently no difference between full, normal, and slight hinting with DirectWrite.
 
I'm also seeing a slight regression towards 6487 with hinting turned on. It happens at smaller font sizes then before (around size 20 or smaller). Is there any potential way to correct this?

It's probably because we're actually doing what the font asked to do.
 

Some images to help explain the rambling:


A close-up view so you can see the diff (the slightly darker 'n' in Thin is with hinting in M59):



We're now using the newer DirectWrite rendering interface when available. Unfortunately when calling through the new interface the rendering will be slightly different (it's so bad with aliased text that we use the old interface in that case). It does appear that DirectWrite tweaked its hinting hinting somehow.
 
The hinting / no hinting behavior for the Before the Rain font:

Before the Rain should get its 'gasp' table updated.
 
Thanks again for your help,

-Bear

On Thursday, August 31, 2017 at 8:26:32 AM UTC-7, bungeman wrote:
6487 I believe has more to do with whether or not vertical anti-aliasing is used or not. This case is more about whether or not any hinting is used or not. In all of the images on this thread so far, the 'before' image is obviously doing at least some horizontal stem snapping to the pixel grid, where the 'after' are not. This (and the timing) would indicate that the change in Skia is that Skia now actually does no hinting on Windows with SkPaint::kNo_Hinting specified (and that is supported). Note that the DirectWrite on Windows 7 does not support no-hinting, so if you run these examples on Windows 7 I expect you will still see the 'before' behavior.

On Thu, Aug 31, 2017 at 11:15 AM, Corey Lucier <corey....@gmail.com> wrote:
But then would the issues related to those changes regress in any way? 6487 etc?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

Bear Travis

unread,
Sep 1, 2017, 7:02:56 PM9/1/17
to skia-discuss
Thank you for all the info! It's been incredibly helpful in understanding the issue. Doing a couple last comparisons, and then we're looking to turn hinting on.

-Bear
Reply all
Reply to author
Forward
0 new messages