Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 578122 - x11-libs/cairo - add patch make LCD_FILTER_DEFAULT the actual default
Summary: x11-libs/cairo - add patch make LCD_FILTER_DEFAULT the actual default
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alexandre Rostovtsev (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-23 18:55 UTC by cristiano04
Modified: 2017-01-29 07:08 UTC (History)
4 users (show)

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


Attachments
Makes LCD_FILTER_DEFAULT the actual default (cairo-lcdfilter-make-default-default.patch,983 bytes, patch)
2016-03-23 18:56 UTC, cristiano04
Details | Diff
ebuild (cairo-1.14.6.ebuild,4.74 KB, text/plain)
2016-03-23 18:57 UTC, cristiano04
Details
cairo-1.14.6.ebuild (cairo-1.14.6.ebuild,4.74 KB, text/plain)
2016-03-23 18:57 UTC, cristiano04
Details
cairo-1.14.4.ebuild (cairo-1.14.4.ebuild,4.67 KB, text/plain)
2016-03-23 18:58 UTC, cristiano04
Details
cairo-1.14.2-r1.ebuild (cairo-1.14.2-r1.ebuild,4.67 KB, text/plain)
2016-03-23 18:58 UTC, cristiano04
Details
cairo-1.14.2.ebuild (cairo-1.14.2.ebuild,4.62 KB, text/plain)
2016-03-23 18:59 UTC, cristiano04
Details
cairo-lcdfilter-make-default-default.patch (cairo-lcdfilter-make-default-default.patch,983 bytes, patch)
2016-03-23 18:59 UTC, cristiano04
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cristiano04 2016-03-23 18:55:21 UTC
Forcing LCD filtering in the Cairo backend by setting cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_SUBPIXEL); inexplicably enables the gruesome LCD_FILTER_LEGACY algorithm.

This patch corrects this silly behaviour and considerably improves font rendering.

P.S.: Adding an extra fontconfig-ultimate USE flag that applies the patch available in https://github.com/bohoomil/fontconfig-ultimate/tree/master/cairo wouldn't hurt either.

Reproducible: Always




First picture: poppler + cairo-qt backend to enable subpixel rendering. Terrible fringes because it defaults to the legacy filter.
Second picture: poppler + cairo-qt backend + cairo with this patch. Proper LCD filter, no fringes.

http://screenshotcomparison.com/comparison/166497
Comment 1 cristiano04 2016-03-23 18:56:43 UTC
Created attachment 428850 [details, diff]
Makes LCD_FILTER_DEFAULT the actual default
Comment 2 cristiano04 2016-03-23 18:57:03 UTC
Created attachment 428852 [details]
ebuild
Comment 3 cristiano04 2016-03-23 18:57:57 UTC
Created attachment 428854 [details]
cairo-1.14.6.ebuild
Comment 4 cristiano04 2016-03-23 18:58:31 UTC
Created attachment 428856 [details]
cairo-1.14.4.ebuild
Comment 5 cristiano04 2016-03-23 18:58:57 UTC
Created attachment 428858 [details]
cairo-1.14.2-r1.ebuild
Comment 6 cristiano04 2016-03-23 18:59:13 UTC
Created attachment 428860 [details]
cairo-1.14.2.ebuild
Comment 7 cristiano04 2016-03-23 18:59:45 UTC
Created attachment 428862 [details, diff]
cairo-lcdfilter-make-default-default.patch

Makes LCD_FILTER_DEFAULT the actual default
Comment 8 cristiano04 2016-11-06 18:19:54 UTC
This is still relevant. I have just successfully applied the patch to cairo-git. There are literally no downsides to applying this patch.
Comment 9 cristiano04 2016-11-06 18:21:55 UTC
(In reply to cristiano04 from comment #8)
> This is still relevant. I have just successfully applied the patch to
> cairo-git. There are literally no downsides to applying this patch.

Rationale for this patch can be found here: https://bugs.freedesktop.org/show_bug.cgi?id=10301#c95
Comment 10 Matt Turner gentoo-dev 2016-11-06 20:15:17 UTC
(In reply to cristiano04 from comment #8)
> This is still relevant. I have just successfully applied the patch to
> cairo-git. There are literally no downsides to applying this patch.

If there are "literally no downsides" then please have the patch applied upstream.

Patching live ebuilds is a mess. epatch_user works though. Feel free to do that. See https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Advanced#Using_epatch_user
Comment 11 cristiano04 2016-11-07 02:58:48 UTC
(In reply to Matt Turner from comment #10)
> (In reply to cristiano04 from comment #8)
> > This is still relevant. I have just successfully applied the patch to
> > cairo-git. There are literally no downsides to applying this patch.
> 
> If there are "literally no downsides" then please have the patch applied
> upstream.
> 
> Patching live ebuilds is a mess. epatch_user works though. Feel free to do
> that. See
> https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/
> Advanced#Using_epatch_user

Did you not read the issue linked in comment 9? Besides, you could hide it behind a USE flag. The only thing this patch does is replace LCD_FILTER_LEGACY, which should never be used under any circumstances, with LCD_FILTER_DEFAULT. It's not removed, simply no longer the default LCD filter.
Current Cairo, as used by poppler's qt backend, will default to FT_LCD_FILTER_LEGACY, since they removed cairo_font_options_set_lcd_filter(), which in turn results in hideous colour fringes.

I am aware I can patch it myself with epatch, since that's precisely what I did when I submitted the fixed ebuilds.

Here's an example of what I'm talking about, look at the i's and the l's, and then compare them: http://screenshotcomparison.com/comparison/166497
The original post explains it perfectly.

As for making them merge it upstream, it wouldn't fix previous ebuilds, and they ignore the bug tracker.
Comment 12 Matt Turner gentoo-dev 2017-01-29 07:08:05 UTC
(In reply to cristiano04 from comment #11)
> As for making them merge it upstream, it wouldn't fix previous ebuilds, and
> they ignore the bug tracker.

Use the mailing list.