[layoutng] NG text width is off by one compared to legacy |
||
Issue descriptionWe may end up wontfixing this, but filing this for reference... Testcase: <!DOCTYPE html> <div style="whitespace: nowrap; float: left; text-rendering: optimizeSpeed;">P c</div> On my machine, legacy computes the width at 20px, NG computes 19px. This shouldn't be a kerning issue as optimizeSpeed should disable that. Koji has suggested other potential reasons: "It is possible, legacy shapes each word (split by spaces) and accumulate them, while NG shapes each "run" (split by font or Unicode script.) HarfBuzz uses 16 bits fixed point, while Blink uses float for glyphs and LayoutUnit for boxes." I don't know how much time we want to spend on figuring this out, but I at least was surprised that we differ even for such a simple testcase.
,
Jun 27 2018
Oh, using those properties does make us match. I wonder if we should sprinkle that into some tests...
,
Jun 27 2018
Ah, in that case the root cause of the problem you're seeing is likely that the font in question kerns with space characters. In legacy we intentionally ignore that in some cases as a performance optimization while NG respects it.
,
Jun 27 2018
Closing as wontfix. Thanks for pointing out font-variant-ligatures! |
||
►
Sign in to add a comment |
||
Comment 1 by e...@chromium.org
, Jun 27 2018