changing the fontconfig hintstyle using a family match section is ignored for web fonts
Reported by
richard....@gmail.com,
Jun 11 2018
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36 Example URL: https://store.google.com/us/product/google_pixelbook_specs?hl=en-US Steps to reproduce the problem: 1. edit ~/.config/fontconfig/fonts.conf and enable full hinting: <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="lcdfilter" mode="assign"><const>lcddefault</const></edit> <edit name="rgba" mode="assign"><const>rgb</const></edit> </match> 2. edit ~/.config/fontconfig/fonts.conf and override hintstyle just for Google's "Product Sans" webfont various ways (covering all my bases): <match target="font"> <test name="family"> <string>@font-face:Product Sans</string> </test> <edit name="hintstyle" mode="assign"><const>hintslight</const></edit> </match> <match target="pattern"> <test name="family"> <string>@font-face:Product Sans</string> </test> <edit name="hintstyle" mode="assign"><const>hintslight</const></edit> </match> <match target="font"> <test name="family"><string>Product Sans</string></test> <edit name="hintstyle" mode="assign"><const>hintslight</const></edit> </match> <match target="font"> <test name="family"><string>@font-face:Product Sans</string></test> <edit name="hintstyle" mode="assign"><const>hintslight</const></edit> </match> 3. Full-restart Chrome. 4. Visit a page that loads "Product Sans" as a webfont, like the pixelbook product page above, with a Father's Day promotional banner at the top showcasing the bug. What is the expected behavior? The fontconfig override should render it using hintstyle=hintslight. You can see the expected rendering by editing ~/.config/fontconfig/fonts.conf and adjusting the catchall hintstyle to hintslight and restarting Chrome. What went wrong? The per-family override for hintstyle is ignored and it is rendered as hintstyle=hintfull. If you download the Product Sans truetype fonts out of band, install them into ~/.fonts, run "fc-cache -v", and restart Chrome the fontconfig override does work as expected. To me this implies that fontconfig may not be fully consulted for webfonts. As my example is a time-sensitive promotion, I've extracted a reproduction snippet of html+css and attached it here. Also I've included screenshots from Chrome 67 and Firefox 60 for the various renderings. Important reproduction detail: If the html file is served over file:// it behaves differently, so please reproduce using http:// or https:// There's a hosted snippet available here: https://richardboyer.net/fontbug.html Does it occur on multiple sites: Yes Is it a problem with a plugin? N/A Did this work before? N/A Does this work in other browsers? Yes Chrome version: 67.0.3396.62 Channel: stable OS Version: ubuntu 16.04.4 Flash Version: If I repeat the test above using Firefox 60 it does the correct thing and does not treat webfonts differently for the purposes of fontconfig consultation.
,
Jun 12 2018
,
Jun 18 2018
Able to reproduce the issue on Windows 10, mac 10.13.3 and Ubuntu 17.10 using chrome reported version #67.0.3396.62 and latest canary #69.0.3463.0. Bisect Information: ===================== Good build: 64.0.3260.0 Bad Build : 64.0.3261.0 Change Log URL: https://chromium.googlesource.com/chromium/src/+log/996d9b188fc8d6987fc1129e93aebd8c3ef89635..cc22f53f9455428f8d6ad59633730e6d4e7b5273 From the above change log suspecting below change Change-Id: Id563168037045e38bd64c6ee6ab6e632886ffb68 Reviewed-on: https://chromium-review.googlesource.com/749148 drott@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner. Thanks...!!
,
Jun 19 2018
Re #3, Fontconfig is only available on Linux, this issue cannot be reproduced on Windows. Also, this is not a regression. The bisected commit is highly unlikely to have anything to do with the original report. Richard, you're saying Firefox is consulting Fontconfig for Product Sans - did you test this in FF after you installed the font locally or without the font locally installed? I do not think we should consult FontConfig for web fonts only on the basis of family name matching - we cannot be certain that the webfont and the local font for which the preferences are applied are identical. So, only the case where the font is matched by the local() src: line in the CSS, FontConfig rendering settings should apply. I'll close this as working as intended, please reopen if you feel strongly otherwise. |
||||
►
Sign in to add a comment |
||||
Comment 1 by junov@chromium.org
, Jun 11 2018