View previous topic :: View next topic |
Author |
Message |
PirahnaBreaks n00b
Joined: 04 Mar 2006 Posts: 21
|
Posted: Sun May 21, 2006 9:31 pm Post subject: New Xft/Cairo Subpixel rendering patches |
|
|
Just to start off, check out the screenshot to see why I'm interested. David Turner has cranked out patches for freetype2, libXft, and cairo to produce this ClearType-like shinyness, and hopefully clean up some of the nasty artifacts that the current subpixel rendering exhibits.
I'm thinking about attempting to patch up my Gnome 2.14 installation, but I'm wondering if somone more experienced wants to take the plunge first - heck, I don't even know if the libXft patch will apply cleanly against the (only) version in portage.
Original blog post here. |
|
Back to top |
|
|
kmare l33t
Joined: 20 Nov 2004 Posts: 619 Location: Thessaloniki, Greece
|
Posted: Sun May 21, 2006 11:46 pm Post subject: |
|
|
wow! i read about those patches a few days ago, but i didn't see them in action!!! I'd like to see a patch as well... _________________ Never argue with an idiot. They will only pull you down to their level, then beat you with experience. |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Mon May 22, 2006 6:36 am Post subject: |
|
|
Works fine. Pathed Cairo, libXft, and freetype today. Looks great, really cleans up the fonts. They are quite vibrant now. Aside from changing the filenames in the patch, they all applied cleanly. The only one that needed to be changed was the freetype patch to remove the stem quantization.
Since that is small, I will post it here. The other two, you will have to change the filenames so they point to the correct ones.
Code: |
--- freetype-2.1.10/src/autofit/aflatin.c 21 Mar 2006 16:30:04 -0000 1.34
+++ freetype-2.1.10/src/autofit/aflatin.c 4 Apr 2006 13:11:06 -0000
@@ -1313,14 +1313,14 @@
* We snap the width of vertical stems for the monochrome and
* horizontal LCD rendering targets only.
*/
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
+ if ( mode == FT_RENDER_MODE_MONO )
hints->other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
/*
* We snap the width of horizontal stems for the monochrome and
* vertical LCD rendering targets only.
*/
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
+ if ( mode == FT_RENDER_MODE_MONO )
hints->other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/*
|
Its really a great upgrade _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
PirahnaBreaks n00b
Joined: 04 Mar 2006 Posts: 21
|
Posted: Mon May 22, 2006 7:19 am Post subject: |
|
|
Did you pull upstream versions and do the configure-make dance, or did you hack up an ebuild? |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Mon May 22, 2006 9:12 am Post subject: |
|
|
no, you dont need to pull cvs. Just copy the ebuilds to your overlay and apply the patches. _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
Proton Apprentice
Joined: 16 Mar 2003 Posts: 195 Location: Estoril, Portugal
|
Posted: Fri May 26, 2006 1:14 am Post subject: |
|
|
These are some excellent patches, I've been using them since I saw that blog entry. Text looks really good now, finally!
One little problem though: I'm on a 64-bit system, so I have a set of binary precompiled libraries for 32 bit compatibility. libXft is one of them, and being precompiled, it doesn't have the patches. I'd really like a patched version of it, so that I have a nice-looking Firefox too (I use 32-bit Firefox because of Flash and Java).
Anyone have any idea how I can compile or get a 32-bit version of libXft.so.2 that I can use to replace the current unpatched one I have?
Thanks _________________ Sérgio @ Portugal
IST - LEIC |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Fri May 26, 2006 2:27 am Post subject: |
|
|
I tried the patches, but I think something didn't work because I didn't notice a single difference. What did you guys do exactly to get it to work? |
|
Back to top |
|
|
Proton Apprentice
Joined: 16 Mar 2003 Posts: 195 Location: Estoril, Portugal
|
Posted: Fri May 26, 2006 11:53 am Post subject: |
|
|
widremann wrote: | I tried the patches, but I think something didn't work because I didn't notice a single difference. What did you guys do exactly to get it to work? |
Remember you have to activate subpixel rendering in your desktop manager, or in ~/.fonts.conf. This might help. _________________ Sérgio @ Portugal
IST - LEIC |
|
Back to top |
|
|
Proton Apprentice
Joined: 16 Mar 2003 Posts: 195 Location: Estoril, Portugal
|
Posted: Fri May 26, 2006 12:43 pm Post subject: |
|
|
I wonder if anyone who compiled their libXft with this patch for AthlonXP 32-bit (or plain i686/i586) could get me the binary? I'd like to give it a try and see if it works with the other 32-bit compatibility libraries I have installed.
The file should be /usr/lib/libXft.so.2 (most likely a symlink to /usr/lib/libXft.so.2.1.2)
Thanks! _________________ Sérgio @ Portugal
IST - LEIC |
|
Back to top |
|
|
kanzelsberger n00b
Joined: 23 Mar 2004 Posts: 31 Location: Banska Bystrica, Slovakia
|
Posted: Fri May 26, 2006 1:12 pm Post subject: Subpixels |
|
|
That looks fantastic, hope it gets into mainstream use soon! _________________ Pixel image editor - http://www.kanzelsberger.com |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Fri May 26, 2006 2:42 pm Post subject: |
|
|
Proton wrote: | widremann wrote: | I tried the patches, but I think something didn't work because I didn't notice a single difference. What did you guys do exactly to get it to work? |
Remember you have to activate subpixel rendering in your desktop manager, or in ~/.fonts.conf. This might help. |
It is activated. After my travail with bad fonts last year, I know how to work the config files (including a bunch of stuff not given in that wiki). I enabled subpixel rendering as well as hinting (I tried hintslight and hintfull, but neither made a difference). I also tried enabling the autohinter, but that didn't make a difference either. I'm pretty sure I install the libraries in the right place (./configure --prefix=/usr). Anything else I might have missed? |
|
Back to top |
|
|
knefas l33t
Joined: 21 Dec 2003 Posts: 828
|
Posted: Fri May 26, 2006 3:01 pm Post subject: |
|
|
widremann wrote: | ... (including a bunch of stuff not given in that wiki). ... | So, when you've got time, why don't add it to the wiki, so that others can benefit? |
|
Back to top |
|
|
nesl247 Veteran
Joined: 15 Jun 2004 Posts: 1614 Location: Florida
|
Posted: Fri May 26, 2006 3:19 pm Post subject: |
|
|
Anyone have an overlay for this? Also, is the fontconfig patch for fontconfig 2.4, or for the one in portage? (I am using nxsty's fontconfig overlay) |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Fri May 26, 2006 5:07 pm Post subject: |
|
|
knefas wrote: | widremann wrote: | ... (including a bunch of stuff not given in that wiki). ... | So, when you've got time, why don't add it to the wiki, so that others can benefit? |
Good idea, actually. Too bad I don't have a lot of time... |
|
Back to top |
|
|
kmare l33t
Joined: 20 Nov 2004 Posts: 619 Location: Thessaloniki, Greece
|
Posted: Tue May 30, 2006 10:08 am Post subject: |
|
|
I just manually applied the patch. It works just great! Hopefully the patent issues will be solved soon so this patch will be applied upstream by default... it's well worth it... _________________ Never argue with an idiot. They will only pull you down to their level, then beat you with experience. |
|
Back to top |
|
|
nesl247 Veteran
Joined: 15 Jun 2004 Posts: 1614 Location: Florida
|
Posted: Tue May 30, 2006 12:32 pm Post subject: |
|
|
Anyone care to make an overlay? |
|
Back to top |
|
|
kmare l33t
Joined: 20 Nov 2004 Posts: 619 Location: Thessaloniki, Greece
|
Posted: Tue May 30, 2006 8:40 pm Post subject: |
|
|
ok.. here's the ebuild just for libXft:
http://hal.csd.auth.gr/~pioann/libXft.tar.bz2
It's only for libXft and not cairo and freetype (to disable the quantization). But it works just fine for me. Just untar the file under your overlay in the x11-libs directory. Also remember to enable sub-pixel hinting...
here's my .fonts.conf file if any of you are interested:
Code: | <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" >
<const>hintfull</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
</match>
</fontconfig>
|
_________________ Never argue with an idiot. They will only pull you down to their level, then beat you with experience. |
|
Back to top |
|
|
nesl247 Veteran
Joined: 15 Jun 2004 Posts: 1614 Location: Florida
|
Posted: Tue May 30, 2006 9:15 pm Post subject: |
|
|
Thanks.. I was trying to figure out what needed to be patched, but there was no: do this, then that, etc.. |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Tue May 30, 2006 11:30 pm Post subject: |
|
|
kmare wrote: | ok.. here's the ebuild just for libXft:
http://hal.csd.auth.gr/~pioann/libXft.tar.bz2
It's only for libXft and not cairo and freetype (to disable the quantization). But it works just fine for me. Just untar the file under your overlay in the x11-libs directory. Also remember to enable sub-pixel hinting...
here's my .fonts.conf file if any of you are interested:
Code: | <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" >
<const>hintfull</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
</match>
</fontconfig>
|
|
Doesn't make a damn bit of difference, even with your fonts.conf. Turning on auto-hinting seems to help some, but then the glyphs are at times misshapen and most importantly, the kerning is terrible with, e.g., Tahoma for Qt apps especially.
Why do the font gods hate me? |
|
Back to top |
|
|
kmare l33t
Joined: 20 Nov 2004 Posts: 619 Location: Thessaloniki, Greece
|
Posted: Wed May 31, 2006 1:14 am Post subject: |
|
|
Well, it's working for me and i'm really happy about it. Maybe you should also apply (as reported before) that patch to freetype:
Code: | diff -u -r1.34 aflatin.c
--- src/autofit/aflatin.c 21 Mar 2006 16:30:04 -0000 1.34
+++ src/autofit/aflatin.c 4 Apr 2006 13:11:06 -0000
@@ -1344,14 +1344,14 @@
* We snap the width of vertical stems for the monochrome and
* horizontal LCD rendering targets only.
*/
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
+ if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
/*
* We snap the width of horizontal stems for the monochrome and
* vertical LCD rendering targets only.
*/
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
+ if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/* |
and also apply the patch for cairo (which i didn't test yet):
http://turnerdavid.neuf.fr/freetype/patches/cairo-1.0.4-lcd_rendering.patch.
Hope it'll work for you as well.. _________________ Never argue with an idiot. They will only pull you down to their level, then beat you with experience. |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Wed May 31, 2006 2:41 am Post subject: |
|
|
kmare wrote: | Well, it's working for me and i'm really happy about it. Maybe you should also apply (as reported before) that patch to freetype:
Code: | diff -u -r1.34 aflatin.c
--- src/autofit/aflatin.c 21 Mar 2006 16:30:04 -0000 1.34
+++ src/autofit/aflatin.c 4 Apr 2006 13:11:06 -0000
@@ -1344,14 +1344,14 @@
* We snap the width of vertical stems for the monochrome and
* horizontal LCD rendering targets only.
*/
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
+ if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
/*
* We snap the width of horizontal stems for the monochrome and
* vertical LCD rendering targets only.
*/
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
+ if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/* |
and also apply the patch for cairo (which i didn't test yet):
http://turnerdavid.neuf.fr/freetype/patches/cairo-1.0.4-lcd_rendering.patch.
Hope it'll work for you as well.. |
The FreeType patch did the trick. I always miss something. I'll apply the cairo patch later, but things seem to be working quite well now in any case. |
|
Back to top |
|
|
Sachankara l33t
Joined: 11 Jun 2004 Posts: 696 Location: Stockholm, Sweden
|
Posted: Wed May 31, 2006 8:25 am Post subject: |
|
|
Hmm... The fonts on that screenshot are all fuzzy on my laptop screen. Looks similar to the way Windows renders its fonts - ie, butt ugly...
The fonts might be smooth, but they look way too smooth. This patch set will not make the fonts more readable in any way, and especially not for people with reduced eyesight. _________________ Gentoo Hardened Linux 2.6.21 + svorak (Swedish dvorak) |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Wed May 31, 2006 12:37 pm Post subject: |
|
|
Sachankara wrote: | Hmm... The fonts on that screenshot are all fuzzy on my laptop screen. Looks similar to the way Windows renders its fonts - ie, butt ugly...
The fonts might be smooth, but they look way too smooth. This patch set will not make the fonts more readable in any way, and especially not for people with reduced eyesight. |
Have you actually seen ClearType on Windows XP? Because if you have, you'd know that it's probably the clearest, least-blurry anti-aliasing available on any OS. |
|
Back to top |
|
|
Sachankara l33t
Joined: 11 Jun 2004 Posts: 696 Location: Stockholm, Sweden
|
Posted: Wed May 31, 2006 3:19 pm Post subject: |
|
|
Yes I have. They are full of ugly coloured lines of red and green. Looks okay on a CRT monitor, but not on a TFT. _________________ Gentoo Hardened Linux 2.6.21 + svorak (Swedish dvorak) |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Wed May 31, 2006 7:44 pm Post subject: |
|
|
widremann wrote: | Sachankara wrote: | Hmm... The fonts on that screenshot are all fuzzy on my laptop screen. Looks similar to the way Windows renders its fonts - ie, butt ugly...
The fonts might be smooth, but they look way too smooth. This patch set will not make the fonts more readable in any way, and especially not for people with reduced eyesight. |
Have you actually seen ClearType on Windows XP? Because if you have, you'd know that it's probably the clearest, least-blurry anti-aliasing available on any OS. |
Yeah, thats FUD. _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
|