New issue
Advanced search Search tips

Issue 839214 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Bad kerning in M68 (Roboto)

Reported by jonat...@titanous.com, May 3 2018

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 10635.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3416.0 Safari/537.36
Platform: 10635.0.0 (Official Build) dev-channel eve

Steps to reproduce the problem:
1. Look at text.

What is the expected behavior?

What went wrong?
After updating from M67 to M68, the text kerning is noticeably terrible.

Did this work before? N/A 

Chrome version: 68.0.3416.0  Channel: dev
OS Version: 10635.0.0
Flash Version:
 
Screenshot 2018-05-02 at 22.57.33.png
92.3 KB View Download
Components: -UI UI>Browser>Omnibox
Cc: tapted@chromium.org
Labels: -Type-Bug Type-Bug-Regression
tapted@, you're been messing with fonts recently.  Should you own this?
Cc: sgabr...@chromium.org bettes@chromium.org
Summary: Bad kerning in M67 (Roboto 15pt vs Roboto 14pt) (was: Bad kerning in M68)
I think this is WAI, but +UX for opinions.

The only change is to increase the omnibox font size from 14pt Roboto to 15pt Roboto. The larger font size is going to align to pixels differently, but it looks correct to me. E.g. the kerning in webcontents of Roboto at the same size looks identical.

To change this, we'd probably need a new Roboto with different kerning at 15pt.
14pt.png
224 KB View Download
15pt.png
246 KB View Download
Cc: bunge...@chromium.org mtklein@chromium.org
Components: -UI>Browser>Omnibox Internals>Skia Blink>Fonts
Owner: herb@chromium.org
Summary: Bad kerning in M68 (Roboto) (was: Bad kerning in M67 (Roboto 15pt vs Roboto 14pt))
Ah, actually this does seem to be better in m65. So perhaps this is a recent Skia change that affected webcontents similarly. (i.e. not omnibox-specific)

Maybe related to https://skia-review.googlesource.com/12492 ?
m65-14pt.png
283 KB View Download

Comment 7 by herb@google.com, May 8 2018

To be clear:
In #5 do you mean https://skia-review.googlesource.com/c/skia/+/125300 instead of 12492?

In #1, the complaint is that the spacing between the x and the t in text is too tight? And, also the spacing of the r and the n are too tight?

In #4, 14pt example, is the complaint that the t and the e of text are too far apart?
Yeah the "text" is what stood out to me (but maybe the original reporter noticed other things). In m68 (at both point sizes), the 'e' seems shifted to the right, whereas in earlier milestones the 'e' looks centered between the first 't' and the 'x'.

And yeah 125300 is the CL (I was trying to link to 124921 but lost a digit). Note I'm not sure whether that CL actually impacts this stuff - I just grepped for 'kerning' changes in the right timeframe.

Comment 9 by herb@google.com, May 8 2018

Owner: tapted@chromium.org
Currently, I suspect that Skia is not involved even though the CL seems very alluring. Skia only kerns when the DrawText call is used. I doubt that you are using that call because it does not handle text shaping and and parts of unicode correctly, and it is not called by any product we know of. I suspect you are looking at a FreeType library change or a Roboto change.
Kerning seems definitely correct in #6.

Comment 11 by e...@chromium.org, May 8 2018

Components: -Blink>Fonts UI>Browser>Omnibox
(removing Blink>Fonts as the omnibox isn't rendered using the blink text stack)

Labels: Needs-Feedback
Owner: ----
jonathan@titanous.com: can you go to https://typekit.com/fonts/roboto and do a side-by-side comparison? (i.e. set point size to 15pt, set some text, and scroll down to Roboto Regular)

None of my attempts show the level of badness in your screengrab -- all the changes I see are identical between blink and omnibox in each revision.

Comment 13 by k...@chromium.org, May 9 2018

Cc: malaykeshav@chromium.org
In another thread about bad kerning in 68 on ChromeOS, someone pointed out https://crrev.com/c/1027005.
I've attached a comparison. One thing I noticed is that the kerning was jumping around a lot in the suggestion dropdown as I typed (not in the address bar though).
Screenshot 2018-05-09 at 11.01.09.png
80.9 KB View Download
Project Member

Comment 15 by sheriffbot@chromium.org, May 9 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
It looks like if I specifically toggle chrome://flags#enable-pixel-canvas-recording to disabled, the kerning improves quite a bit.
Or at least it stops jumping around in the suggestion box. Attached a screenshot with that flag disabled.
Screenshot 2018-05-09 at 11.09.08.png
73.0 KB View Download
Owner: osh...@chromium.org
This is due to https://chromium-review.googlesource.com/c/chromium/src/+/1027005

#16 - One of the primary reasons to introduce pixel canvas was to solve text kerning at dsf > 1. Its strange that disabling it helps.

@oshima - thoughts?
I think there are still kerning problems with it disabled, but it definitely stops the kerning from jumping around in the omnibox dropdown while typing.
Adding more screenshots for comparison.
Text Kerning_Subpixel_Positioning_Disabled_Pixel_Canvas_Disabled.png
117 KB View Download
Text kerning _Subpixel_Positioning_Enabled_Pixel_Canvas_Disabled.png
129 KB View Download
Text Kerning_Subpixel_Positioning_Enabled_Pixel_Canvas_Enabled.png
140 KB View Download
Text Kerning_Subpixel_Positioning_Disabled_Pixel_Canvas_Enabled.png
118 KB View Download
The above screen shots are for device scale factor of 2x.
 - Toggling Pixel canvas seems to have no effect.
 - Disabling subpixel positioning gives a much sharper result.


For device scale factors other than an integer we can see the difference in Toggling Pixel Canvas. However, enabling subpixel positioning seems to help.


TextKerning_130_SP_Disabled_PC_Enabled.png
156 KB View Download
TextKerning_130_SP_Enabled_PC_Enabled.png
171 KB View Download
TextKerning_130_SP_Enabled_PC_Disabled.png
169 KB View Download
TextKerning_130_SP_Disabled_PC_Disabled.png
155 KB View Download
Cc: derat@chromium.org
More screenshots for 1.6x scale factor.

Looking at the screenshots, I think we still need Subpixel positioning as it provides improvement on fractional scale factors when combined with pixel canvas.
TextKerning_160_SP_Disabled_PC_Disabled.png
669 KB View Download
TextKerning_160_SP_Enabled_PC_Disabled.png
703 KB View Download
TextKerning_160_SP_Enabled_PC_Enabled.png
703 KB View Download
TextKerning_160_SP_Disabled_PC_Enabled.png
672 KB View Download
#24: Thanks for the comparison screenshots! Yeah, it looks to me like we need to keep subpixel positioning enabled, at least in those cases.
Uploading a patch to enable subpixel positioning for non integral dsf.
Looks like a bug in rendertext?

Jumping in the candidate window looks different bug. Can we re-enable it for the native ui for the time being?

Project Member

Comment 28 by bugdroid1@chromium.org, May 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f00044b1973636900b1e65818e162dbb93efdeb9

commit f00044b1973636900b1e65818e162dbb93efdeb9
Author: Malay Keshav <malaykeshav@chromium.org>
Date: Tue May 15 17:30:30 2018

Enable subpixel positioning for chrome os for fractional dsf

This patch enables the font subpixel positioning for the browser ui
and blink for fractional device scale factors.

It also adds a switch to force disable subpixel positioning for
easier debugging and testing on devices.

Bug:  839214 
Change-Id: If8fd7dbc39ac3950bc27b5b7435b482fb4931065
Component: Font, subpixel positioning, kerning
Reviewed-on: https://chromium-review.googlesource.com/1053289
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558764}
[modify] https://crrev.com/f00044b1973636900b1e65818e162dbb93efdeb9/ash/display/display_manager_unittest.cc
[modify] https://crrev.com/f00044b1973636900b1e65818e162dbb93efdeb9/ui/gfx/font_render_params_linux.cc
[modify] https://crrev.com/f00044b1973636900b1e65818e162dbb93efdeb9/ui/gfx/font_render_params_linux_unittest.cc
[modify] https://crrev.com/f00044b1973636900b1e65818e162dbb93efdeb9/ui/gfx/switches.cc
[modify] https://crrev.com/f00044b1973636900b1e65818e162dbb93efdeb9/ui/gfx/switches.h

Status: Fixed (was: Unconfirmed)

Sign in to add a comment