Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631284 - www-client/firefox - Subpixel font rendering broken with >=media-libs/freetype-2.8.1
Summary: www-client/firefox - Subpixel font rendering broken with >=media-libs/freetyp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-17 23:19 UTC by fcool
Modified: 2019-03-31 15:08 UTC (History)
24 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
urxvt (screenshot_20170918_212632.png,442.62 KB, image/png)
2017-09-18 19:28 UTC, manwe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fcool 2017-09-17 23:19:00 UTC
https://sourceforge.net/projects/freetype/files/freetype2/2.8.1/

"By default, FreeType now offers high quality LCD-optimized output without resorting to ClearType techniques of resolution tripling and filtering. In this method, called Harmony, each color channel is generated separately after shifting the glyph outline, capitalizing on the fact that the color grids on LCD panels are shifted by a third of a pixel. This output is indistinguishable from ClearType with a light 3-tap filter."

See Firefox bugs:
https://bugzilla.mozilla.org/show_bug.cgi?id=1393467
https://bugzilla.mozilla.org/show_bug.cgi?id=1400721

Temporary fix:
Go to about:config in Firefox and change the values of `gfx.canvas.azure.backends` and `gfx.content.azure.backends` to `cairo` instead of `skia`
Comment 1 jorgicio 2017-09-18 15:31:48 UTC
Not only Firefox is broken. Wine is too.
It segfaults everytime I want to run an .exe file or winecfg.

So I reverted back to 2.8 and now all is working.
Comment 2 manwe 2017-09-18 19:28:26 UTC
Created attachment 495274 [details]
urxvt

Not only firefox or wine are broken. Here comparison of urxvt with freetype 2.8 (on the right) and 2.8.1 (on the left): 

URxvt.font: xft:Hasklig:size=9:lang=pl:antialias=true:hinting=slight
Comment 3 Marcin Kowalski 2017-09-19 06:13:13 UTC
confirming this, i have all sorts of display artifacts around fonts in firefox. 

downgrading freetype to 2.8 solved the problem.
Comment 4 Jan Psota 2017-09-19 09:28:35 UTC
With freetype-2.8.1 wine-* fail not only to run, but merge too.
Comment 5 Phil Stracchino (Unix Ronin) 2017-09-19 11:56:15 UTC
Unsurprisingly, this also affects mail-client/thunderbird.
Comment 6 Phil Stracchino (Unix Ronin) 2017-09-19 11:58:59 UTC
(In reply to Phil Stracchino (Unix Ronin) from comment #5)
> Unsurprisingly, this also affects mail-client/thunderbird.

Sorry about that, premature send...

The problem is particularly apparent with bolded fonts.
Comment 7 Jory A. Pratt gentoo-dev 2017-09-19 12:52:23 UTC
This bug will be addressed in firefox-52.4 and firefox-56.0 on final release.
Comment 8 Rafał Mużyło 2017-09-19 16:14:59 UTC
wine problem is (at least for the moment) an unrelated one.

A part of it would be the following change (at least this *seems* to be a fix of this part):

- if(font->ft_face->charmap->encoding == FT_ENCODING_NONE) {
+ if(!font->ft_face->charmap || font->ft_face->charmap->encoding == FT_ENCODING_NONE) {

in get_glyph_index in dlls/gdi32/freetype.c (wine bug #43715).

The other is more tricky, as wine upstream will likely need to recreate sfd files with higher resolution (wine bug #43716).
Comment 9 fcool 2017-09-20 13:06:52 UTC
I copied these two patches[*] from Arch Linux to /etc/portage/patches/www-client/firefox-55.0.2 and Firefox fonts are atleast readable now with freetype-2.8.1 and the default Skia backend. Might be an option for backporting but that's up to the Gentoo Mozilla team. I didn't do extensive testing or anything, simply checked https://www.wikipedia.org/ (many languages, good for testing font rendering).

[*] https://git.archlinux.org/svntogit/packages.git/tree/trunk/harmony-fix.diff?h=packages/firefox
[*] https://git.archlinux.org/svntogit/packages.git/tree/trunk/clip-ft-glyph.diff?h=packages/firefox
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2017-09-20 14:00:20 UTC
Firefox 56 and 52.4 are eight days away; the official fix will hit the gentoo repo then.
Comment 11 Dennis Schridde 2017-09-22 16:39:50 UTC
(In reply to Ian Stakenvicius from comment #10)
> Firefox 56 and 52.4 are eight days away; the official fix will hit the
> gentoo repo then.

Could we, until then, please have <www-client/firefox-56 depend on <media-libs/freetype-2.8.1 ?
Comment 12 Phil Stracchino (Unix Ronin) 2017-09-22 17:39:52 UTC
(In reply to Dennis Schridde from comment #11)
> (In reply to Ian Stakenvicius from comment #10)
> > Firefox 56 and 52.4 are eight days away; the official fix will hit the
> > gentoo repo then.
> 
> Could we, until then, please have <www-client/firefox-56 depend on
> <media-libs/freetype-2.8.1 ?

You'll be fine as long as you don't have media-libs/freetype keyworded unstable.  The stable version is 2.8.
Comment 13 manwe 2017-09-22 17:43:21 UTC
firefox-55 is in unstable and allows freetype-2.8.1
Comment 14 Lee Trager 2017-09-22 19:10:52 UTC
This also effects Thunderbird. Downloading to freetype-2.8 fixes the issue for both Firefox and Thunderbird.
Comment 15 tt_1 2017-09-23 08:16:08 UTC
I just tested the fix for firefox from the mozilla overlay with the patchset 52.2-patches-04.tar.xz and stable freetype-2.8 on arm, and have to mention that in this combinations the fonts are broken as well. 

I can provide a screenshot upon request (mostly because I just downgraded to patches-03), same goes for further testing of patches.
Comment 16 Jory A. Pratt gentoo-dev 2017-09-23 12:41:50 UTC
(In reply to tt_1 from comment #15)
> I just tested the fix for firefox from the mozilla overlay with the patchset
> 52.2-patches-04.tar.xz and stable freetype-2.8 on arm, and have to mention
> that in this combinations the fonts are broken as well. 
> 
> I can provide a screenshot upon request (mostly because I just downgraded to
> patches-03), same goes for further testing of patches.

You are using a patchset that is not intended for use. The patchset is based on the soon to be 52.4 release which includes one of the two patches.
Comment 17 Perfect Gentleman 2017-09-26 07:08:58 UTC
(In reply to tt_1 from comment #15)
> I just tested the fix for firefox from the mozilla overlay with the patchset
> 52.2-patches-04.tar.xz and stable freetype-2.8 on arm, and have to mention
> that in this combinations the fonts are broken as well. 
> 
> I can provide a screenshot upon request (mostly because I just downgraded to
> patches-03), same goes for further testing of patches.

check patches in Arch for those packages.
Comment 18 tt_1 2017-09-26 07:31:58 UTC
You'd have to avoid the firefox ebuilds from the overlay and all is fine. Mozilla does not seem to intend to fix both bugs on the next release, so the gentoo mozilla team somehow decided to prepack a patch tarball named -04 which includes the fix for 1400721 and does not include the fix for 1393467, because this one will be fixed for the next release. There is not much wrong with prepacking patch tarballs, but it is a bit of a strange idea to bump the patchset to an ebuild for which it is not suitable. 

So to make it clear, if you want to test the fixes you'd have to apply both patches to 52.3.0, otherwise fonts are broken without even upgrading to freetype-2.8.1
Comment 19 Paul Kollen 2017-12-26 03:30:03 UTC
This bus also affects Thunderbird.
Comment 20 Oleg Makarenko 2017-12-26 08:05:22 UTC
Seems to be fixed in Thunderbird 52.5.0 and Firefox 57.0.1.