New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 608338 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue skia:5328

Blocking:
issue 589462



Sign in to add a comment

Use SkPaint::measureText() when computing glyph bounds

Project Member Reported by fmalita@chromium.org, May 2 2016

Issue description

Blink is currently computing glyph bounds by converting the glyph to a path and then using SkPath::getBounds():https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp&l=384

This is convoluted, and sometimes inaccurate (e.g.  issue 601968 ).  Instead we should use the canonical SkPaint::measureText() API.

A quick test CL yields mostly expected diffs on Win/Linux, but lots of jarring diffs on Mac: http://crrev.com/1889793006/#ps20001

(I took a stab at classifying the diffs here: https://bugs.chromium.org/p/chromium/issues/detail?id=601968#c5)

Turns out measureText() is less accurate than getTextPath+getBounds on Mac only - we need to fix that before switching Blink to measureText().
 

Comment 1 by e...@chromium.org, May 2 2016

We should be able to get the bounds for each glyph (and then offset it by the advance) instead. Ideally from skia but failing that we could get it from harfbuzz. Perhaps that's a viable workaround for Mac?
Cc: jbroman@chromium.org
 Issue 601968  has been merged into this issue.
Emil is it possible for a text export on your team to take on this bug?
s/export/expert/ :)

Comment 5 by e...@chromium.org, May 17 2016

Cc: behdad@chromium.org
Labels: -Pri-3 Pri-2
Yeah, I think Behdad and Drott had some ideas around this. 

Comment 6 by drott@chromium.org, May 23 2016

Status: ExternalDependency (was: Available)
This depends on  https://bugs.chromium.org/p/skia/issues/detail?id=5328 to fix this properly, without rebaselining a lot of tests again once the glyph bounds on Mac are not overreported anymore.

Comment 7 by e...@chromium.org, May 24 2016

Blockedon: skia:5328

Comment 8 by drott@chromium.org, Jul 6 2016

Blocking: 589462

Comment 9 by drott@chromium.org, Aug 3 2016

This is now fixed and unified to be font based glyph metrics for all platforms except Mac, where we're blocked on skia:5238 (too large metrics returned on Mac), see  issue 610313  and https://codereview.chromium.org/1980913002

Comment 10 by e...@chromium.org, Sep 30 2017

Status: WontFix (was: ExternalDependency)

Sign in to add a comment