Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 303421 - Add Freetype LCD filtering support back to x11-libs/cairo-1.8.8
Summary: Add Freetype LCD filtering support back to x11-libs/cairo-1.8.8
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 06:58 UTC by Ron MacNeil
Modified: 2010-09-10 20:43 UTC (History)
3 users (show)

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


Attachments
Updated ebuild (cairo-1.8.8.ebuild,3.12 KB, text/plain)
2010-02-04 06:59 UTC, Ron MacNeil
Details
Patch to go in files/ (cairo-1.8.8-freetype-lcdfilter-support.patch,29.98 KB, patch)
2010-02-04 06:59 UTC, Ron MacNeil
Details | Diff
Screenshot (screenshot-slight.png,237.54 KB, image/png)
2010-02-04 12:06 UTC, Ron MacNeil
Details
Screenshot (CJK text) (Screenshot-slight-jp.png,287.38 KB, image/png)
2010-02-04 12:06 UTC, Ron MacNeil
Details
Patch to go in files/ (cairo-1.8.8-freetype-lcdfilter-support.patch,29.93 KB, patch)
2010-02-08 08:15 UTC, Ron MacNeil
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ron MacNeil 2010-02-04 06:58:24 UTC
Freetype LCD filtering support was removed from Cairo back in 2008. [1]

So currently we have the (optional, via the 'cleartype' use flag) files/cairo-1.2.4-lcd-cleartype-like.diff which hard-codes a single (patent-infringing [2]) filtering implementation directly into cairo.

If we agree that:
1. It's 2010 and real LCD filtering support is long-overdue
2. The Right Thing(tm) is for cairo to use the Real(tm) Freetype LCD filtering
3. ...according to the fontconfig 'lcdfilter' setting (just like 'hintstyle' etc.)
4. ...with the choice of whether to use patented LCD filtering or not centralised in one place: Freetype.

Then the attached patch and updated ebuild delivers.  It just replaces the freetype LCD filtering support that was removed from cairo.


[1] http://cgit.freedesktop.org/cairo/commit/?id=5d887ad5dca5af0f8216830d1b04d08a5aba9bee
[2] http://david.freetype.org/cleartype-patents.html
Comment 1 Ron MacNeil 2010-02-04 06:59:06 UTC
Created attachment 218361 [details]
Updated ebuild
Comment 2 Ron MacNeil 2010-02-04 06:59:41 UTC
Created attachment 218363 [details, diff]
Patch to go in files/
Comment 3 Ron MacNeil 2010-02-04 07:05:14 UTC
Note that this patch makes Cairo respect your 'lcdfilter' setting.  For example try something like:

$ cat ~/.Xdefaults 
Xft.antialias: 1
Xft.rgba: rgb
Xft.lcdfilter: lcddefault
Xft.hinting: 1
Xft.autohint: 1
Xft.hintstyle: hintslight
Comment 4 Ron MacNeil 2010-02-04 12:06:09 UTC
Created attachment 218389 [details]
Screenshot
Comment 5 Ron MacNeil 2010-02-04 12:06:54 UTC
Created attachment 218391 [details]
Screenshot (CJK text)
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2010-02-08 05:40:26 UTC
Where did your patch come from?
Comment 7 Ron MacNeil 2010-02-08 08:15:23 UTC
Created attachment 218887 [details, diff]
Patch to go in files/
Comment 8 Ron MacNeil 2010-02-08 08:37:46 UTC
Hi Doug,

From somewhere random found with Google, which I realise might not be a good answer.

So I've recreated the patch from the Cairo git diff...

http://cgit.freedesktop.org/cairo/commit/?id=5d887ad5dca5af0f8216830d1b04d08a5aba9bee

...with a two-line change making the default filtering algorithm FIR5 (new) instead of LEGACY (old).

The new patch is also less disruptive in that it doesn't add anything to the public API, whereas the old one did (cairo_font_options_get/set_lcd_filter).

Regards,
Ron
Comment 9 Dror Levin (RETIRED) gentoo-dev 2010-03-26 18:12:36 UTC
*** Bug 306053 has been marked as a duplicate of this bug. ***
Comment 10 Dror Levin (RETIRED) gentoo-dev 2010-03-26 18:23:33 UTC
It would be great if the patch attached here or on bug 306053 could be applied, bringing font rendering in gentoo on par with other distributions.
Comment 11 Dror Levin (RETIRED) gentoo-dev 2010-03-26 22:33:34 UTC
I've added cairo-1.8.8-r1 to the tree with a new USE flag: lcdfilter, which applies the patch from Ubuntu, and takes precedence over the cleartype USE flag (if both are enabled then the lcdfilter patch gets applies and the cleartype patch doesn't).
Comment 12 Chema 2010-09-10 19:35:33 UTC
This has disappeared from version 1.10.0, would work this patch on that new version?
Comment 13 Giacomo Perale 2010-09-10 20:43:01 UTC
(In reply to comment #12)
> This has disappeared from version 1.10.0, would work this patch on that new
> version?
> 


Upstream already includes the patch.