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

Issue 882577 link

Starred by 6 users

Issue metadata

Status: Verified
Owner:
Closed: Sep 17
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-09-14
OS: Linux
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Full hinting FontConfig settings are ignored

Project Member Reported by derat@chromium.org, Sep 10

Issue description

After upgrading from M68 to M69, Linux Chrome is ignoring my FontConfig settings and rendering all text with slight hinting instead of full hinting. Here's what my $HOME/.fonts.conf contains:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="rgba" mode="assign"><const>none</const></edit>
  </match>
</fontconfig>

I added additional logging to ui/gfx/font_render_params_linux.cc in ToT Linux Chrome (r590026):

-  if (delegate)
+  if (delegate) {
     params = delegate->GetDefaultFontRenderParams();
+    LOG(ERROR) << "XXX default: hinting=" << params.hinting
+               << " autohinter=" << params.autohinter
+               << " subpixel_pos=" << params.subpixel_positioning
+               << " subpixel_ren=" << params.subpixel_rendering;
+  }
   QueryFontconfig(actual_query, &params, family_out);
+  LOG(ERROR) << "XXX query:   hinting=" << params.hinting
+             << " autohinter=" << params.autohinter
+             << " subpixel_pos=" << params.subpixel_positioning
+             << " subpixel_ren=" << params.subpixel_rendering;

I can see that LinuxFontDelegate::GetDefaultFontRenderParams() returns the correct hinting setting, but they're overridden by the call to QueryFontconfig():

default: hinting=3 autohinter=0 subpixel_pos=1 subpixel_ren=0
query:   hinting=1 autohinter=0 subpixel_pos=1 subpixel_ren=0
final:   hinting=1 autohinter=0 subpixel_pos=0 subpixel_ren=0

When I make GetFontRenderParams set params.hinting back to FULL before returning, I see full hinting again in much of the UI (but not tabs, oddly). (A lot of web content doesn't honor my hinting settings either, but that's a separate issue.)

QueryFontconfig hasn't changed since 2016, so I suspect that the regression was introduced by the FontConfig roll at https://crrev.com/c/1138543 on July 16 for  issue 857511 . This was right before the M69 branch on July 19.

Side question: why didn't the unit tests in ui/gfx/font_render_params_linux_unittest.cc catch this?
 
Owner: thomasanderson@chromium.org
Is this what is causing  Issue 881366 ?
> Is this what is causing  Issue 881366 ?

No since fontconfig is only used on Linux but that bug lists Windows and Mac as affected OSes.
I see the issue go away with the following steps:

1. Start with Chromium 1929034cb6471d9cf0c37a72595454f5c3d605f9 (r590026, 2018-09-10).
2. Reset //src/third_party/fontconfig to 34db191c01779928ad17c1cfe9f5ad50de64bbbb (r523918, 2017-12-13) -- this is just a build fix for the next step.
3. Set //src/third_party/fontconfig/src to b546940435ebfb0df575bc7a2350d1e913919c34 (2017-09-17) and cherry-pick 1451f82 to fix compilation (there were a few easy merge conflicts).

After this, I see fully-hinted fonts again (revert.png). Without it, I see light hinting (tot.png).

So I think that whatever changed in FontConfig to break this was between b546940435ebfb0df575bc7a2350d1e913919c34 and 1451f829e750926cec27855eded71c24ac7ac7c6.
revert.png
22.7 KB View Download
tot.png
26.1 KB View Download
#5: That appears to fix it -- thanks!
Labels: Merge-Request-70 Merge-Request-69
Status: Started (was: Assigned)
Requesting merge of (Linux-only) change from c#7 to M69 and M70.  This bug causes user font configuration to be ignored, so this is a pretty serious regression.
Project Member

Comment 9 by sheriffbot@chromium.org, Sep 13

Labels: -Merge-Request-69 Merge-Review-69 Hotlist-Merge-Review
This bug requires manual review: Request affecting a post-stable build
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
derat@, thanks for bisecting this! And Thomas, thank you for the quick resolution.

> Side question: why didn't the unit tests in ui/gfx/font_render_params_linux_unittest.cc catch this?

Thomas, any idea how we could better catch such regressions early in the future and why this test didn't trigger?

#10: Speculating wildly about why tests didn't catch this: based on the description at https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/110, it sounds like the bug was around FontConfig no longer reading ~/.fonts.conf. We might be able to cover that by setting $HOME in unit tests, but it also looks like FC itself has a test for this now (although I'm not sure when/if those get run in the course of FC development).
We didn't see any regressions because we try hard not to read any user font settings in our tests.  Like derat pointed out, fontconfig now has a test for this, so think we should rely on fontconfig's test suite for this type of issue.  Maybe we could add a note in README.chromium to run the fc test suite before rolling?
Project Member

Comment 13 by bugdroid1@chromium.org, Sep 13

Labels: merge-merged-3551
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a5896e82f1715c84d742efe0fdac9f2584f8dd6e

commit a5896e82f1715c84d742efe0fdac9f2584f8dd6e
Author: Tom Anderson <thomasanderson@chromium.org>
Date: Thu Sep 13 22:28:31 2018

Update fontconfig to ba206df9b9a7ca300265f650842c1459ff7c634a

This fixes settings from ~/.fonts.conf not being respected.

BUG= 882577 
R=​derat

Change-Id: I92a2fad0918ef3f4e5a9758efcc437beb3c20850
Reviewed-on: https://chromium-review.googlesource.com/1222728
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#590878}(cherry picked from commit d9d67cb2c7edcd68d9735a3ef349714d6b69cd3e)
Reviewed-on: https://chromium-review.googlesource.com/1226253
Reviewed-by: Krishna Govind <govind@chromium.org>
Cr-Commit-Position: refs/branch-heads/3551@{#5}
Cr-Branched-From: 08c03be7fdeabd63de8e4efca4c562a2f5a70ba9-refs/heads/master@{#590850}
[modify] https://crrev.com/a5896e82f1715c84d742efe0fdac9f2584f8dd6e/DEPS
[modify] https://crrev.com/a5896e82f1715c84d742efe0fdac9f2584f8dd6e/third_party/fontconfig/README.chromium
[modify] https://crrev.com/a5896e82f1715c84d742efe0fdac9f2584f8dd6e/third_party/fontconfig/include/config.h
[modify] https://crrev.com/a5896e82f1715c84d742efe0fdac9f2584f8dd6e/third_party/fontconfig/include/src/fcalias.h
[modify] https://crrev.com/a5896e82f1715c84d742efe0fdac9f2584f8dd6e/third_party/fontconfig/include/src/fcaliastail.h
[modify] https://crrev.com/a5896e82f1715c84d742efe0fdac9f2584f8dd6e/third_party/fontconfig/include/src/fcstdint.h

Labels: -Merge-Request-70 Merge-Approved-70
branch:3538
Project Member

Comment 15 by bugdroid1@chromium.org, Sep 13

Labels: -merge-approved-70 merge-merged-3538
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0dba86d97c522758b0cc0427b51cdf2b71c70fea

commit 0dba86d97c522758b0cc0427b51cdf2b71c70fea
Author: Tom Anderson <thomasanderson@chromium.org>
Date: Thu Sep 13 23:10:53 2018

Update fontconfig to ba206df9b9a7ca300265f650842c1459ff7c634a

> This fixes settings from ~/.fonts.conf not being respected.
>
> BUG= 882577 
> R=derat
>
> Change-Id: I92a2fad0918ef3f4e5a9758efcc437beb3c20850
> Reviewed-on: https://chromium-review.googlesource.com/1222728
> Reviewed-by: Dan Erat <derat@chromium.org>
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#590878}

BUG= 882577 
TBR=derat
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true

Change-Id: I7206b3f7c320b548972de56f5c3fa4ec86adbc67
Reviewed-on: https://chromium-review.googlesource.com/1226201
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/branch-heads/3538@{#391}
Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811}
[modify] https://crrev.com/0dba86d97c522758b0cc0427b51cdf2b71c70fea/DEPS
[modify] https://crrev.com/0dba86d97c522758b0cc0427b51cdf2b71c70fea/third_party/fontconfig/README.chromium
[modify] https://crrev.com/0dba86d97c522758b0cc0427b51cdf2b71c70fea/third_party/fontconfig/include/config.h
[modify] https://crrev.com/0dba86d97c522758b0cc0427b51cdf2b71c70fea/third_party/fontconfig/include/src/fcalias.h
[modify] https://crrev.com/0dba86d97c522758b0cc0427b51cdf2b71c70fea/third_party/fontconfig/include/src/fcaliastail.h
[modify] https://crrev.com/0dba86d97c522758b0cc0427b51cdf2b71c70fea/third_party/fontconfig/include/src/fcstdint.h

NextAction: 2018-09-14
pls update bug with Dev/canary result tomorrow morning on version 71.0.3551.3 or higher.
The NextAction date has arrived: 2018-09-14
Cc: krajshree@chromium.org
Labels: Needs-Feedback
thomasanderson@ - Could you please provide manual repro steps to verify the fix from TE-end.
Thanks...!!
#18: Put the config I pasted above into ~/.fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="rgba" mode="assign"><const>none</const></edit>
  </match>
</fontconfig>

When you start Chrome, font rendering should look similar to revert.png from #4 rather than tot.png. Feel free to attach a screenshot if you need me to take a look. Thanks!
derat@ I'm unable to reproduce the issue on stable (I'm seeing changes in ~/.fonts.conf reflected in Chrome).  Could you provide verification that the issue is fixed on 71.0.3551.3 ?  The package is at go/brwdj
Screenshot from 2018-09-14 10-35-58.png
166 KB View Download
Cc: derat@chromium.org
+  derat@, could you ptal comment #20 pls?
Yes, I downloaded chrome-linux64.zip from that directory and can confirm that my hinting settings are honored now. See the attached screenshot.
snap-123549.png
69.0 KB View Download
For comparison, here's what stable (69.0.3497.92) looks like for me on the same system.
snap-123757.png
92.0 KB View Download
Labels: -Merge-Review-69 Merge-Approved-69
Approving merge to M69 branch 3497 based on comments #8, #22. Pls merge ASAP. Thank you.
Project Member

Comment 25 by bugdroid1@chromium.org, Sep 14

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/40144de10375216b3ed67ee9364b880d6bf963c0

commit 40144de10375216b3ed67ee9364b880d6bf963c0
Author: Tom Anderson <thomasanderson@chromium.org>
Date: Fri Sep 14 20:01:23 2018

[Merge to M69] Update fontconfig to ba206df9b9a7ca300265f650842c1459ff7c634a

> This fixes settings from ~/.fonts.conf not being respected.
>
> BUG= 882577 
> R=derat
>
> Change-Id: I92a2fad0918ef3f4e5a9758efcc437beb3c20850
> Reviewed-on: https://chromium-review.googlesource.com/1222728
> Reviewed-by: Dan Erat <derat@chromium.org>
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#590878}

BUG= 882577 
TBR=derat
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true

Change-Id: I200f8ec878a85ff446d2b86408db3c8d81f65a7e
Reviewed-on: https://chromium-review.googlesource.com/1225887
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#941}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/40144de10375216b3ed67ee9364b880d6bf963c0/DEPS
[modify] https://crrev.com/40144de10375216b3ed67ee9364b880d6bf963c0/third_party/fontconfig/README.chromium
[modify] https://crrev.com/40144de10375216b3ed67ee9364b880d6bf963c0/third_party/fontconfig/include/config.h
[modify] https://crrev.com/40144de10375216b3ed67ee9364b880d6bf963c0/third_party/fontconfig/include/src/fcalias.h
[modify] https://crrev.com/40144de10375216b3ed67ee9364b880d6bf963c0/third_party/fontconfig/include/src/fcaliastail.h
[modify] https://crrev.com/40144de10375216b3ed67ee9364b880d6bf963c0/third_party/fontconfig/include/src/fcstdint.h

Unable to reproduce the issue on ubuntu 17.10 using chrome stable #69.0.3497.81 and dev #71.0.3551.3 as per comment #19. Observed that full hinting FontConfig settings are not ignored and it is as per tot.png in comment #4.
Attached  screen shots for reference.

derat@ - Could you please check the attached screen shots and please help us in verifying the fix from your end.

Thanks...!!
882577@M69.png
131 KB View Download
882577@M71.png
131 KB View Download
Labels: -Hotlist-Merge-Review -Needs-Feedback
Status: Verified (was: Started)
Yep, 69.0.3497.100 is fixed -- see the attached screenshot.

Re #26, it looks like the system that produced those screenshots isn't configured to use full hinting. Linux font configuration is a disaster, but I can confirm that the regression appears to be fixed by the merge.
snap-124806.png
32.8 KB View Download
Thank you derat@ for verification on chrome stable #69.0.3497.100.
derat@, can you please help us to verify this fix on today's beta RC# 70.0.3538.22 (Build Console: https://goto.google.com/vgblt) ?

Thank you!
Yep, that one's fine too.
snap-121541.png
28.0 KB View Download
Thank you so much for the quick confirmation.
Working for me in chromium 69.0.3497.100. I use hintslight but setting fontconfig to hintfull chromium honors it correctly.
Cc: susan.boorgula@chromium.org
 Issue 887584  has been merged into this issue.

Sign in to add a comment