reassign 798805 fonts-cantarell clone 798805 -1 retitle 798805 fonts-cantarell: Switch to autohinting to work around blurry rendering with CFF severity 798805 grave tags 798805 + patch # Include fontconfig <match> below in 31-cantarell.conf retitle -1 fonts-cantarell: Hints do not accurately identify font stems tags -1 + upstream thanks
On Thu, Sep 17, 2015 at 04:25:30PM -0700, Steve Langasek wrote: > On Sat, Sep 12, 2015 at 09:35:16PM -0700, Josh Triplett wrote: > > Would help if I actually attached the screenshots. > > Could you please provide for comparison a screenshot using the Cantarell > font when using the older version of freetype (with CFF disabled)? Attached. Notice the rendering behavior on the vertical lines in "Interface". With the new version, each vertical line gets smeared across three pixels, two very faint gray and one solid black. With the older version, each vertical line renders as a very dark line and a solid black line, which does not produce the headache-inducing blurry effect. You can see a similar effect in the rendering of other characters, such as the curve of the 'e'. Notice how the rendering with 2.6-1 has far more light-grey pixels on the edges, while the previous version had a well-defined edge stopping with a dark pixel. Certainly Cantarell could have better hinting than it does, but the new version of libfreetype6 has definitely regressed in the quality of its rendering of Cantarell. Now, that said, with some further investigation at other sizes, I noticed something interesting. With the new version, Cantarell renders blurry at all sizes (or all those I tried, anyway). However, even with the old version, a few sizes of Cantarell render with a similar blurriness. The new version still seems worse, but there certainly seems room to blame Cantarell as well. > I can certainly see the differences between the two screenshots, but what I > see when looking at the Sans screenshot is the shaping is horrible - with > the F and T in the headers very crisp but horribly shaped, and the shaping > on "Window Titles" so bad that the dot of the i sits *above* the cross of > the T. So I would have a hard time arguing that this behavior is more > correct than the behavior shown with Cantarell, which has definitely traded > off crispness for correctness of shape, and I would like to directly compare > before/after of the change in freetype. That sounds like the standard difference between Windows-style font rendering and Apple-style font rendering. Apple-style ignores pixels and considers font shape sacrosanct, so it gives better font shape at the expensive of blurriness. Windows-style acknowledges the limits of DPI and snaps to pixels, giving crisper fonts at the expense of font shape. Hints allow the renderer to implement such snapping to pixels, while in the absence of good hints (or autohints), rendering has nothing to go on but the font shape, and thus ends up with Apple-style rendering. So if you find the new, blurry rendering more to your personal tastes, you might prefer Apple-style rendering in general, favoring font shape over cripsness. > The other things I notice here: > > - Your screenshots show an antialiasing setting of "grayscale". A > zoomed-in view of both screenshots shows that this setting is being > respected. In your previous screenshots for bug #730742, it appears that > subpixel antialiasing was in play. Is this because you had different > fontconfig settings selected at that time, or is it because the earlier > freetype was not correctly respecting the "grayscale" setting? The former. > - You have a hinting setting of "medium". How does the appearance of this > font vary for you with different values of hinting? Is there no other > value for the hinting setting that gives the crispness you're looking > for, or is there some other reason that these other hinting settings are > unsatisfactory for you? As far as I can tell, Cantarell looks *identical* with all values of hinting; in all cases it looks identically blurry. > The Adobe CFF behavior I'm seeing (both in your new screenshots and in my > local testing) suits *my* personal tastes just fine. Unless you can point > to a specific way in which freetype is buggy when using the Adobe CFF engine > and either misinterpreting a font or failing to respect fontconfig > preferences, I can't see disabling Adobe CFF again in Debian. > > In the original bug, there was a comment indicating that a new version of > fontconfig would be released soon that included a configuration setting for > handling different hint styles for CFF fonts vs. others: > > https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=88;bug=730742 That change doesn't actually solve the problem, though. Note my subsequent comments, first suggesting that that fontconfig snippet seemed to fix the problem, but then noting that "some things still render differently", such as tab labels. And guess what font tab labels render in? :) So, that fontconfig snippet doesn't actually fix the rendering of Cantarell. > There were also the comments on the upstream list that the Cantarell font > itself showed buggy hints: > > http://lists.nongnu.org/archive/html/freetype/2014-01/msg00011.html That would certainly explain a great deal. If Cantarell's hints don't actually accurately reflect the "important stems", that sounds like a bug in Cantarell, which could then make Cantarell more sensitive to the details of font rendering. > There is a new upstream version of Cantarell in Debian since that mail was > written (0.0.16-1, uploaded Sep 2014). I had assumed that this release > specifically addressed these bugs in the font hints. Was this not the case? A quick check upstream confirms that the hints did not change in 0.0.16. Nor have the hints for Cantarell Regular changed after 0.0.16, either. > Particularly as we have other users specifically requesting the CFF engine > (bug #795653) because it substantially improves the display of other fonts, > I don't think we should keep this functionality disabled in freetype > indefinitely to accommodate a buggy font, even if this font is a default for > GNOME. If no one is going to take care of the bugs on this font, maybe it's > not a good choice of default. > > There's also a bug report about cantarell in Fedora, including a fontconfig > setting that would avoid the use of CFF specifically for this font until the > bug can be fixed: > > https://bugzilla.redhat.com/show_bug.cgi?id=1062903 That setting actually switches to the autohinter rather than the font's own hints. Which does indeed seem to work around the problem. With that setting, libfreetype6 2.6-1 renders Cantarell crisply again. That seems like an appropriate workaround to put in place. Copying it here for the record: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE fontconfig SYSTEM "../fonts.dtd"> <fontconfig> <match target="font"> <test name="family"> <string>Cantarell</string> </test> <edit name="autohint" mode="assign"> <bool>true</bool> </edit> </match> </fontconfig> (The match section could go in the existing 31-cantarell.conf in fonts-cantarell.) This doesn't seem like the right permanent fix, as a look at the upstream Cantarell repository turns up mentions that the autohinter doesn't always do a good job either, but nonetheless it produces much better results than 2.6-1's default rendering. So, until the hints get fixed, this workaround works. > On Thu, Sep 17, 2015 at 09:48:57AM -0700, j...@joshtriplett.org wrote: > > Any feedback on this bug? This issue makes GNOME's UI painfully blurry, > > and the version with this issue just migrated to testing today, exposing > > many more people to this issue. > > Of course, if you considered this bug severe enough to warrant keeping the > package out of testing, the correct thing to have done was to file the bug > at severity: serious. I didn't feel I could justify more than "a bug which has a major effect on the usability of a package, without rendering it completely unusable to everyone." The package certainly isn't "unusable to everyone", not least of which because only Cantarell seems affected, and not everyone uses that font, though many Debian users do. > At the moment, my inclination is to reassign this bug to the fonts-cantarell > package. With the control commands at the top of this mail, I've generated two such bugs against fonts-cantarell: one about its hints, and one to include the above fontconfig snippet. - Josh Triplett