View previous topic :: View next topic |
Author |
Message |
spatz Retired Dev
Joined: 21 Sep 2002 Posts: 61 Location: Israel
|
Posted: Sat Mar 27, 2010 12:25 pm Post subject: New sub-pixel hinting (ClearType-like) patch in cairo |
|
|
Hi all,
Yesterday I added x11-libs/cairo-1.8.8-r1 to the tree with a new patch that is applied when the lcdfilter USE flag is on. This patch is taken from Ubuntu and what it does is enable ClearType-like sub-pixel font hinting in cairo (and therefore in applications which use cairo, e.g. firefox). This was reported in bug 303421 (among others).
This new flag overrides the cleartype USE flag that cairo has had for a while. Now lcdfilter takes precedence over cleartype, so if you have both enabled the lcdfilter patch will be applied.
The patch causes cairo to respect fontconfig preferences, so now you can configure the sub-pixel hinting based on font, size, weight, etc. and there are 4 filters available: lcddefault, lcdlight, lcdlegacy and lcdnone. Refer to fontconfig documentation for more information (man fonts-conf).
Please test and provide feedback, I'd like to hear what you think of it in comparison to the cleartype USE flag, and also in general. So if you're running ~arch just sync and then run Code: | echo x11-libs/cairo lcdfilter >> /etc/portage/package.use
emerge -1 x11-libs/cairo |
Thanks |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sat Mar 27, 2010 6:26 pm Post subject: |
|
|
Where in fonts.conf do I put lcddefault, etc.? Does that replace rgba for sub-pixel hinting, or does it get its own XML node? |
|
Back to top |
|
|
spatz Retired Dev
Joined: 21 Sep 2002 Posts: 61 Location: Israel
|
Posted: Sat Mar 27, 2010 6:33 pm Post subject: |
|
|
For example, you can put this snippet in your ~/.fonts.conf:
Code: | <match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match> |
(replace lcddefault with your preference).
It doesn't replace rgba - that preferences simply controls the sub-pixel geometry (e.g. rgb or bgr etc.), and that depends on your monitor. |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sat Mar 27, 2010 6:35 pm Post subject: |
|
|
Thanks. I'm emerging right now. Will see what happens.
Does lcdfilter affect Qt-based applications? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Mar 27, 2010 6:35 pm Post subject: Re: New sub-pixel hinting (ClearType-like) patch in cairo |
|
|
spatz wrote: | causes cairo to respect fontconfig preferences |
Looking through your patch, I don't see the equivalent of cairo-respect-fontconfig.patch
widremann, the fonts thread is required reading. |
|
Back to top |
|
|
spatz Retired Dev
Joined: 21 Sep 2002 Posts: 61 Location: Israel
|
Posted: Sat Mar 27, 2010 6:50 pm Post subject: Re: New sub-pixel hinting (ClearType-like) patch in cairo |
|
|
Yes, I didn't want to include that patch since upstream hasn't even commented on it and other distributions don't apply it.
I don't want to make the tree a testing ground. I'm willing to apply patches but only to a certain degree, and this patch is too adventurous in my taste. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Mar 27, 2010 7:01 pm Post subject: Re: New sub-pixel hinting (ClearType-like) patch in cairo |
|
|
spatz wrote: | other distributions don't apply it. |
Oh yes they do - Mandriva for a start (proof RPM).
From the Mandriva .spec file:
Code: | # gw patches to handle LCD subpixel hinting
# http://bugs.freedesktop.org/show_bug.cgi?id=10301
Patch4: cairo-04_lcd_filter.dpatch
# http://bugs.freedesktop.org/show_bug.cgi?id=11838
# http://bugs.freedesktop.org/show_bug.cgi?id=13335
# https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/209256
# http://forums.fedoraforum.org/showthread.php?p=1094309#post1094309
Patch5: cairo-respect-fontconfig.patch |
|
|
Back to top |
|
|
anshuljain n00b
Joined: 05 Apr 2010 Posts: 4 Location: Bangalore, India
|
Posted: Mon Apr 05, 2010 10:46 am Post subject: |
|
|
Actually, Mandriva has the cairo-respect-fontconfig patch just present in their packages. They do not activate it by default. Heck, it does not even build against the latest Cooker. PLF, which is supposed to handle such "patent ambiguities" also refuses to maintain this patch (and the other Ubuntu patches) for reasons which would be a lot to mention in this post I know of all this history, as I had submitted these patches to Mandriva, which found its way into their official packages, but turned off by default.
FWIW, I keep a track of the Ubuntu patches+Arch ones, especially the ones by PaulBredbury(you're Brebs on Fedoraforums.org and brebs on Arch, right?) and put them in my unofficial Mandriva and Opensuse subpixel rendering packages. Thanks for all your hardwork! Distros like Mandriva, Opensuse and Fedora tend to stick very very closely with upstream ones, and rarely if ever look into Ubuntu/Arch/Gentoo patches.
Thankfully, I'm able to easily maintain and host these on Opensuse through their excellent Opensuse Build Service.
Regards
Anshul |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Mon Apr 05, 2010 11:35 am Post subject: |
|
|
anshuljain wrote: | They do not activate it by default. |
You mean "apply the patch" by default. And, arghh, you're right. In my enthusiasm I didn't notice the "%if" wrapper around:
Code: | %if %build_plf
%patch4 -p1
%patch5 -p1
%endif |
I'm too used to such code blocks being indented
Who teaches these idiots how to program? Next, they'll be treating errors as things to be blissfully ignored... Oops.
Quote: | Heck, it does not even build against the latest Cooker. |
What do you mean by "it"? I just did a quick check, and my cairo-respect-fontconfig.patch successfully patches cairo 1.9.6 (which is currently the version in Cooker), and the resulting patched cairo compiles OK, just as it has with all the stable-release versions since it was made about 2 years ago.
Quote: | you're Brebs on Fedoraforums.org and brebs on Arch, right? |
Dammit, I'm really a secret agent, and you're blowing my cover! Meet me at rendezvous point P02 at midday for debriefing - I'll be the one with a silver briefcase and a BO problem.
Quote: | Distros like Mandriva, Opensuse and Fedora tend to stick very very closely with upstream ones, and rarely if ever look into Ubuntu/Arch/Gentoo patches. |
That's sooo blinkered. Upstream are quite capable of making stupid decisions and sitting on bug-fixing patches while they ponder, er, the infinite nothingness of whitespace as an example. And any distro can produce useful patches - even the kiddie-run ones like Arch and Lunar (I'm running Lunar, so consider the Hell I'm in).
My ~/.fonts.conf, which contains some tweaks from various sources, and which I'm quite happy with right now, is currently maintained & updated here |
|
Back to top |
|
|
anshuljain n00b
Joined: 05 Apr 2010 Posts: 4 Location: Bangalore, India
|
Posted: Tue Apr 06, 2010 5:30 am Post subject: |
|
|
My apologies, by "it" I meant the ubuntu subpixel patches, and not your cairo-respect-fontconfig patch. That works properly. I am now faced with a problem of the Ubuntu patches not working in cairo 1.9.6 I guess I'm gonna have to wait for Lucid or the next rev to re-base their patches.
Your name is pretty easy to locate in the forums, if there's a brebs commenting on fonts, then its gonna be you I'm a BIG time font rendering junkie as well...mostly around in the Mandriva or Opensuse forums. MDV's decision to not support subpixel hinting for cairo, fontconfig and xft through a PLF switch made me quit as their MUG (Mandriva User Group) rep from India. |
|
Back to top |
|
|
bi3l Apprentice
Joined: 06 Feb 2003 Posts: 268 Location: France
|
Posted: Tue Apr 06, 2010 5:23 pm Post subject: |
|
|
What is the difference between the patch in portage and the one from the font thread, if any ? _________________ OGMRip - LCD filtering (Wiki) |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Tue Apr 06, 2010 7:48 pm Post subject: |
|
|
cairo-1.8-lcd_filter.patch.bz2 is 04_lcd_filter.patch
Ubuntu's large patch for libXft is not applied.
As already mentioned in this thread, cairo-respect-fontconfig.patch is not applied. Who cares about fixing bugs anyway?
So basically, it's a timid, half-assed, first step towards introducing the kind of decent heavily-tweaked font rendering that Ubuntu have led the way in for years, whilst upstream remain paralysed by the (presumed) patent threat. |
|
Back to top |
|
|
spatz Retired Dev
Joined: 21 Sep 2002 Posts: 61 Location: Israel
|
Posted: Tue Apr 06, 2010 8:12 pm Post subject: |
|
|
PaulBredbury wrote: | As already mentioned in this thread, cairo-respect-fontconfig.patch is not applied. Who cares about fixing bugs anyway?
So basically, it's a timid, half-assed, first step towards introducing the kind of decent heavily-tweaked font rendering that Ubuntu have led the way in for years, whilst upstream remain paralysed by the (presumed) patent threat. |
As already mentioned in this thread, no one applies cairo-respect-fontconfig.patch. Who cares about the facts anyway?
If you have complaints about that, turn to the freedesktop bug.
So basically, it's an attempt to make the situation better by applying yet another patch while upstream refuses to acknowledge anything is wrong. Thanks for the support though, it's appreciated. |
|
Back to top |
|
|
bi3l Apprentice
Joined: 06 Feb 2003 Posts: 268 Location: France
|
Posted: Wed Apr 07, 2010 8:01 am Post subject: |
|
|
spatz wrote: | As already mentioned in this thread, no one applies cairo-respect-fontconfig.patch. Who cares about the facts anyway? |
Non-gnome users amongst others.
spatz wrote: | If you have complaints about that, turn to the freedesktop bug. |
Guess who is the author of comment 8.
spatz wrote: | So basically, it's an attempt to make the situation better by applying yet another patch while upstream refuses to acknowledge anything is wrong. Thanks for the support though, it's appreciated. |
Paul contributes to the font thread since january 2007 and I personnaly maintain the LCD filtering patchset for gentoo since june 2008. It would have been nice to ask for the support of all the contributors to the font thread before commiting this incomplete patch.
Anyway, your attempt to make the situation better is much appreciated. _________________ OGMRip - LCD filtering (Wiki) |
|
Back to top |
|
|
spatz Retired Dev
Joined: 21 Sep 2002 Posts: 61 Location: Israel
|
Posted: Wed Apr 07, 2010 11:26 am Post subject: |
|
|
bi3l wrote: | Paul contributes to the font thread since january 2007 and I personnaly maintain the LCD filtering patchset for gentoo since june 2008. It would have been nice to ask for the support of all the contributors to the font thread before commiting this incomplete patch.
Anyway, your attempt to make the situation better is much appreciated. |
I've been mostly following (gentoo) bugs and not the forums, perhaps I should have checked them as well.
Anyway, I have no problem with criticism (on the contrary, I welcome it) as long as it's constructive and respectful, but comments like "who cares about fixing bugs anyway?" are neither.
The lcd_filter.patch is useful regardless of the respect-fontconfig.patch and so I applied it. Of course it could be more useful to apply both, but there's a cost to everything and I wouldn't want to diverge from upstream too much, as I've explained. The patch is behind a USE flag, so if you don't like it just disable it. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Apr 07, 2010 12:35 pm Post subject: |
|
|
spatz wrote: | but there's a cost to everything |
cairo-respect-fontconfig.patch doesn't break anything. I've suggested it recently to Arch Linux users.
Not once, not ever, has cairo-respect-fontconfig.patch had the merest hint suggested by anyone that it breaks anything. Except for a bit of initial surprise that fontconfig doesn't get overruled by the ridiculously over-simplistic font settings that xorg already has.
But it does fix things. Use the URL link I just gave, and read.
spatz wrote: | I've been mostly following (gentoo) bugs and not the forums, perhaps I should have checked them as well. |
Gee, ya think? |
|
Back to top |
|
|
spatz Retired Dev
Joined: 21 Sep 2002 Posts: 61 Location: Israel
|
Posted: Wed Apr 07, 2010 1:31 pm Post subject: |
|
|
PaulBredbury wrote: | spatz wrote: | I've been mostly following (gentoo) bugs and not the forums, perhaps I should have checked them as well. |
Gee, ya think? |
Nah, I take that back. I'll go back to ignoring you. Good luck with that attitude. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Tue May 11, 2010 5:26 pm Post subject: |
|
|
As only a hopefully-relevant info snippet, PCLinuxOS 2010 includes my cairo-respect-fontconfig.patch unconditionally - from cairo rpm (mirror):
Code: | Patch4: cairo-respect-fontconfig.patch
...
%changelog
...
* Fri Nov 06 2009 Texstar 1.8.8-1pclos2010
- gcc update
- 1.8.8
- add patch 4 |
|
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Thu Oct 21, 2010 8:04 am Post subject: |
|
|
PaulBredbury wrote: | As already mentioned in this thread, cairo-respect-fontconfig.patch is not applied. |
Well well... I have not been able to find anything in the changelog. Could someone tell where about we are to date on this issue ?
At least as far as gentoo's cairo-1.8.10 is concerned ?
And what about any progression of upstream's position regarding the patent threat.
PaulBredbury wrote: | ...it's a timid, half-assed, first step... |
In other words... is it reaching a bold 3/4-assed situation... |
|
Back to top |
|
|
|