run_layout_test canvas font rendering has broken hinting/spacing |
|||||||||
Issue descriptionWhile trying to create a test to check the fix for crbug.com/730661 , I created the tests attached to this bug. Both html renders identically on Chrome or Content Shell (see attached img1.png). When I run on layout tests, the expected runs as img1.png, but the actual test renders as img2.png. Help?
,
Jun 14 2017
,
Jun 14 2017
kojii@ or ksakamoto@ might have run across something like this when working with fonts.
,
Jun 15 2017
Which platform is it failing? As a general rule, text is not as linear as graphics is; i.e., 1px font scaled by 100 does not guarantee to match to 100px font. This is for better readability. Even within Blink, it may vary by versions or by fonts. Can we test without relying on it?
,
Jun 15 2017
,
Jun 15 2017
This was on Linux. I know that text is not linear, but on my compiled browser, those two methods render identical results. Only on run_layout_tests I get this weird kerning/hinting, and the fonts are the correct size. So I don't think it's a size problem. The bug is that there's something that run_layout_tests triggers that make content_shell - on this example - draw the font with the correct size, but with the spacing be completely off.
,
Jun 15 2017
Spacing is also not linear, small fonts tend to have more tracking than large fonts (ratio-wise), so the result looks normal to me, and I'm more surprised it works on your local machine. But you seem to be aware of these. If the question is to infra to know the diff between normal Ubuntu and try bots, I don't know the answer, sorry. Such font difference isn't rare for me, I used to try to fix tests in such cases. I'm also curious what infra is using. Sorry again that I don't seem to be a help.
,
Jun 28 2017
I understand this. But my issue is: we are having different behavior on spacing between run_layout_tests and chrome/content_shell. I'd like to know where this is coming from.
,
Jun 28 2017
> different behavior on spacing between run_layout_tests and chrome/content_shell Oh, I misunderstood, sorry. I see. On the same machine, or bot? +cc drott@, our linux font experts, but from symptom, it sounds like test runner setting up different font for serif to me. How test runner sets up environment is a great unknown and we hit mysterious behavior several times too, I'm not sure if anyone knew the answer. Sorry, not helping much.
,
Jun 28 2017
That's on the same machine.
,
Jun 28 2017
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/fonts/linux/FontRenderStyle.cpp?l=101 Also see FontPlatformDataLinux SetupPaint(). IsRunningLayoutTest() usually disables subpixel positioning to reduce layout test font differences, with the exception of fast/text/sub-pixel/. Recently, I refurbished this on Windows so that if antialiasing is disabled, subpixel positioning is, too, compare: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp?q=FontPlatformData&sq=package:chromium&dr=CSs&l=64 If you're comparing Canvas to non Canvas rendering, there might be differences in how the SkPaint is set up.
,
Jun 29 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 18
fserb@, if you disable various bits that depend on IsRunningLayoutTest() as suggested by drott@, do you still observe the behavior? Assigning back to you to determine if it is such a deliberate difference when running layout tests or not. If it is, possibly it's still not the best setup, of course.
,
Jul 23
I disabled everything I could find on platform/font related to IsRunningLayoutTest() and I still get the same broken behavior. Even thought the subpixel position may be to blame, I don't think is the IsRunningLayoutTest, because both expected and non-expected run with this flag on.
,
Jul 24
How about if you simply load this test manually in content_shell? I guess that looks different from when doing the same in a chrome binary built from the same tree?
,
Jul 24
With content_shell they both look correct.
,
Jul 25
So it looks correct in content_shell manually, but not when content_shell is running layout tests? Even if it isn't because of IsRunningLayoutTest, it does seem like it's because of different settings when running tests. drott@, do you know of other font-related differences that don't boil down to IsRunningLayoutTest?
,
Jul 25
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by fs...@chromium.org
, Jun 14 2017