As part of my quest for "perfect" fonts in Linux on my LCD monitor, I stumbled across some patches that David Turner of freetype.org put out in 2006. They modify cairo and libXft to use significantly better subpixel rendering techniques. The patches I found to work were from Jaganath's page. I started getting annoyed when I would update Fedora and these libraries would be overwritten, requiring me to download, patch and recompile updated source code. So, I figured out how to make RPM packages instead, which suprisingly took very little time to figure out and are much more portable and generally easy to deal with. In many cases, the rendering now looks superior to any other OS I've seen. Jim Bevenhall's page provides similar packages.
For Fedora 11, I have redesigned how the packages work. They used to replace the original packages. Now, they use ldconfig to override the existing packages. This makes installation and uninstallation a breeze, and Fedora updates to the original packages shouldn't stop the modified packages from working. I chose the suffix "freeworld" because it seemed like that is the agreed upon suffix in the FOSS world for stuff like this. I am no longer providing the freetype packages, as those are already available at rpmfusion.org. Once you install rpmfusion, you would do this:
yum install freetype-freeworld.i586yum install freetype-freeworld.x86_64 (if you are running x64, I recommend installing both)Then, download these packages and in the download directory do:
yum install *.rpm
Keep in mind that the cairo packages also have an additional tweak to make them respect fontconfig settings (~/.fonts.conf and/or /etc/fonts/local.conf). This means that hinting type, antialiasing, etc. must be configured through those files, not through gnome-appearance-properties.
Sample Image:

« Fedora 12 – KDE4 Smooth Tasks Packages Available Font Testing Page »

Hi,
are those patches for cairo and xft listed here:
http://www.freetype.org/freetype2/patches/rogue-patches.html
will do the same thing as yours? or there’s something different?
Thannks!
Fwiw, the rpm.livna.org repo publishes a parallel-installable freetype-freeworld package, that includes bytecode interpreter and subpixel rendering support.
Hey, I was wondering if you we’re building these RPM’s for Fedora 10 x64?
Thanks
I have downloaded:
cairo-1.8.4.tar.gz, freetype-2.3.7.tar.gz, libXft-2.1.13.tar.gz
If you can provide me with the .spec files for each to patch, I would happily build x64 RPM’s for F10.
Hi,
I was wondering if you are able to create Fedora 10 x64 rpms?
Thanks
Yep… these are really old. I haven’t updated them. FYI, these *are* x86_64 rpms.
LVG… these are essentially based on the rogue patches from freetype.org. They have been modified as time went on as they didn’t apply cleanly to newer software. I believe cairo and qt are making them default, where if freetype has the patented stuff enabled, cairo and qt will use them.
Justyn… the spec files are contained within the src.rpm files. Check into rpm building on Google to find out details.
Hello. Could you, please, update the packages?
Updated the packages for Fedora 11, with both x86 and x86_64 versions. Enjoy!
Hi, thank you very much for providing these packages. They really are a blessing as I too cannot stand the out of the box appearance of fonts in Fedora.
Do you, by the way, also provide spec files for these packages? I couldn’t find them on your page, but I’d be grateful if you did.
Cheers,
Tobi
Hey Tobi- Sure, no problem. I’ve now added the src.rpm files. I should have done that before!
Thanks a lot.
Hey. I really appreciate the packages, thanks a lot!
I’ve got a very simple /etc/fonts/local.conf, ~/fonts.conf, and ~/.Xresources. All they do is set the filter to ‘lcddefault’ and set slight hinting. And everything works great! Except…Banshee.
Banshee is slight-hinting, but it’s still using the unfiltered subpixel rendering, so it stands out very painfully on an otherwise very nice desktop.
I wanted to make sure it was not, for example, a GTK# problem with all Mono apps. But, MonoDevelop, F-Spot, and Gnome-Do use lcddefault-filtering just fine. It’s only Banshee that has the problem.
I thought maybe it had something to do with Cairo-sharp, but it seems to be a uniquely Banshee problem. Oh well. Everything else still looks great!
Yeah, I’ve run into a couple apps like that, mainly Opera. For some reason, the authors of some programs think they know more about what you want than you do.
The issue is that the executable is actually a shell script (/usr/lib/banshee-1), and it overrides ldconfig by forcibly setting LD_LIBRARY_PATH. Change the LD_LIBRARY_PATH line in that startup script to this:
export LD_LIBRARY_PATH=/usr/lib64/freetype-freeworld:/usr/lib64/cairo-freeworld:/usr/lib64:/usr/lib64/banshee-1${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
(or if you use 32 bit, it might be like this)
export LD_LIBRARY_PATH=/usr/lib/freetype-freeworld:/usr/lib/cairo-freeworld:/usr/lib:/usr/lib/banshee-1${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
I’d like to figure out a more elegant way of dealing with these rogue apps, as the next time you update banshee, it will likely get overwritten and you’ll have to patch it again.
Cheers-
Moony
Ok.. I think I figured it out. If I add this to ~/.bashrc it preloads the tweaked libraries. This should get you past the Banshee issue without modifying its startup script. I need to figure out if there are any negative repercussions first, but I will then add this to the packages so it happens automagically:
export LD_PRELOAD=/usr/lib64/freetype-freeworld/libfreetype.so.6.3.20:/usr/lib64/cairo-freeworld/libcairo.so.2.10800.6:/usr/lib64/libXft-freeworld/libXft.so.2.1.13:$LD_PRELOAD
thank you very much for your hard work.
font rendering is really needed i can’t figure out why fedora ain’t applying it by default like ubuntu,
anyway, i’m running through some problems and the rendering is not applying ,, i’ve installed all your packages and i guess i need to configure
my ~/.Xresources and /etc/fonts/local.conf
i took Xresoruces configuration from your blog :
Xft.autohint: false
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintslight
Xft.hinting: true
Xft.antialias: true
Xft.dpi: 96
Xft.rgba: rgb
but for the local.conf :
http://www.infinality.net/files/fonts-config-1.0-5.noarch.rpm
it is really depending on the “mod-fonts-1.0-21.noarch.rpm” you provided before
which i can’t use because it doesn’t support the arabic language.
but when i use local.conf only.
the problem is fixed in few apps like firefox and it reads both arabic and english succefully with font rendering.
i’m wondering if you have any local.conf file not depending on the previous “mod-fonts-1.0-21.noarch.rpm”
cauz im sure my problem is on local.conf ^^ .
thanks again,
They seem to work well enough; Banshee now picks up the settings. Thanks!
However, make sure to bump the version number next time, so your repository can push it as an update. That’d be extra handy.
Thanks for posting the packages for F11.
According to this thread:
http://forums.fedoraforum.org/showthread.php?t=186789
in FedoraForum, pixman and fontconfig needed to be patched too, is this no longer necessary?
In that thread there are also patched pixman & fontconfig patches available, do you know if they are the same/compatible with your cairo/libxft ?
In the past I’ve never needed to update pixman or fontconfig in order to get nice looking LCD fonts. I checked out the fontconfig src.rpm in that thread, and it looks like it is only changing a couple things in /etc/fonts/conf.d/. Since /etc/fonts/local.conf and ~/.fonts.conf will override anything in conf.d, and you’re probably manually setting things in those 2 files anyway, to me it makes sense to just leave conf.d alone and put customizations in /etc/fonts/local.conf.
SaRi- Yes, I should put a warning on the fonts-config and mod-fonts packages that they are only set up to tweak the English and European languages. I don’t know enough about Arabic to even attempt adjusting the glyphs! Sorry! You may want to try my old .fonts.conf here: http://www.infinality.net/blog/?p=3 or try going starting out with the one here: http://www.isolationism.com/wp-content/uploads/2006/12/fonts.conf
After the July 26th Fedora update, problems with Banshee’s LD_PRELOAD hack have come back for me.
That is, when launching Banshee, it now ignores the freeworld packages again, giving me lame LCD filtering.
But, preload must still work, because when I run ‘banshee-1′ from a terminal, everything looks great.
But if I launch Banshee using GNOME-Do, Alt+F2, or the Panel Menu, it launches as if it is ignoring the LD_PRELOAD settings in /etc/profile.d/.
What’s up? Gnome-session and panel were updated recently, but I don’t know how to find out what changed.
If I launch Banshee by doing “/bin/bash /usr/bin/banshee-1″ from Alt+F2, then it doesn’t work.
But, if I do “/bin/bash -l /usr/bin/banshee-1″ from the Run Command, then it does work. Maybe gnome-panel no longer launches programs using the Bash login profile?
Or maybe I’ve messed up my system some how, but can’t see why. Short term, you can fix it by prepending “/bin/bash -l” to your Banshee entry in the Sound & Video menu.
In addition, when I do ‘echo $LD_PRELOAD’, libXft-freeworld appears twice, even though it only has one entry in /etc/profile.d/. Not sure about that one.
And when this happens, by the way, I notice something odd.
Not only is my LCD filtering broken, but so are my Fontconfig matching rules.
(I have rules to hint and smooth fonts only at certain sizes. These are lost when Banshee fails to do the Preload thing).
I know for a fact that you aren’t patching Fontconfig.
So this can’t be a fontconfig problem, but perhaps the rule-matching code is in Freetype or Cairo?
In any case, my matching rules (which work by pixelsize) don’t seem to work when Banshee fails to load your packages…
Do you make other changes that have nothing to do with LCD filtering? If so, perhaps you should push those changes upstream.
Weird. I was getting the same behavior in KDE. What do you have when you do: echo $LD_PRELOAD ? Is cairo listed in there anywhere? For some reason it was not for me. I reinstalled the cairo-freeworld package, and it then appeared. Not sure what is up with that. But it was getting that issue with launching Banshee from the menu as well, even afterwards. I rebooted the system and things then worked. I believe it has something to do with how profiles are loaded in /etc/profile.d. So, if your LD_CONFIG is looking OK, try rebooting. If that doesn’t help things, I’m not sure what it would be. It’s possible I’m doing something wrong in the installation script of the RPM.
Also, I do make a tweak on cairo-freeworld to make it respect whatever is set in .fonts.conf and /etc/fonts/local.conf. By default it ignores some things in there, which I’ll never understand why. So, yes, it does do stuff not directly related to LCD filtering, which may be what you are seeing. Not sure that they would patch it upstream. Some probably consider the current behavior of cairo “a feature”.
Ok, I’ve udpated the packages to handle the LD_PRELOAD stuff slightly differently. Unfortunately, to get it working properly, you will have to remove the existing packages, and then install these (as opposed to upgrading the packages in place). Do this:
yum remove cairo-freeworld.* libXft-freeworld.*
yum install cairo-freeworld libXft-freeworld
All updates after this should NOT require this painful step. It’s due to me not understanding exactly what %post and %postun do in spec files. Let me know if you still have issues. Banshee works for me both ways now.
Also, because of profile changes, you should reboot after installing these. Sux, I know, but shouldn’t be necessary in the future!
I had to reinstall anyway, since for some reason I noticed yesterday that my /etc/profile.d/ didn’t have any of the *-freeworld links in them.
Once I reinstalled the packages, I noticed that cairo-freeworld and libXft-freeworld entries were both added to /etc/profile.d/ again, and everything seems to work great. Thanks!
Hmm. Why does installing merely an update to fontconfig suddenly remove all of the /etc/profile.d overrides? Do Fedora updates seek out and destroy your package?
And now I’m back at square one. Except strangely GTK programs still look okay, and now Firefox and Thunderbird are ignoring subpixel rendering and using greyscale no matter what.
Not sure… my stuff is unaffected, and I’m on the latest updates from Fedora. Did the problem persist? Did reinstalling work? Anyone else have the same issue?
Weird. Seems to work find for me, and I’m on the latest Fedora updates. Did the problem go away? Does reinstalling fix it?
Anyone else having the same issues?
Well, after about 15 hours of banging my head against the desk until my eyeballs pop out, trying to get decent-looking fonts in Fedora 11, I found this site.
When I try and download the files, I get the following message:
“You dumb bastard
That file does not exist
What is wrong with you, man”
Man, you are EVIL.
This is the final straw. The end. You made me cry and I can’t take any more.
I am going to defect to Windows 7. And its all your fault!!
Oh man, that is hilarious! It was an error in my index script. I wonder how long it was like that….
Should work now. Best of luck.
Hi Moony,
Thanks for that! You have saved me for the moment from defecting from Fedora. I take back everything I said – you are a VERY NICE MAN.
I did find the section on your site with the howto to add your repo and downloaded the patches but haven’t noticed any difference – figure I’ll have to try further tweaking of the config files.
I may be back!
Cheers,
itsjustarumour
Thank you!
I keep getting a yum error after installing the repo for F12:
Loaded plugins: presto, refresh-packagekit
http://www.infinality.net/fedora/linux/12/i386/repodata/primary.xml.gz: [Errno 14] Downloaded more than max size for http://www.infinality.net/fedora/linux/12/i386/repodata/primary.xml.gz: 6842 > 6207
The actual size of the file in your repodata directory is 6207. ‘ls -l’ reports it as 7419.
I also just tried downloading the primary.xml.gz and dropping it in /var/cache/yum/f12/i386/infinality or whatnot, but that didn’t work either and gives the same error.
Sorry about that… shows what happens when you don’t eat your own dog food. I’m using my own repository myself now, so I should be able to spot any errors pretty quickly. Let me know if it’s still broken. (I’m using x86_64, so I’m not sure how well the i386 works.)
Hi Moony,
I wonder if you have had the chance to check the fonts on Ubuntu’s karmic; to me it’s fonts out of the box are almost pefect.
I followed your tutorial hoping to get the same effect in Fedora and althou I got closer to it I still see some artefacts in fedora’s fonts.
Do you have any ideas of what I can do do at compilation time to get the same rendering I get in ubuntu?
In the URL you can see the differences between my F12 and Karmic running on KVM. Do you see the differences or is it just me?
Cheers!
Hi, thanks for making these packages. They have made the fonts on my Fedora install must better. Have you looked at the font packages which are here:
http://www.fedoraforum.org/forum/showthread.php?t=186789&page=11
Are they the same or are there any differences between those and yours?
Thanks!
Hey mrgrieves- The font rendering in Ubuntu Karmic (from your screenshot) looks basically identical to what my Fedora system looks like (FIR subpixel, slight hinting). The rendering in your Fedora looks like the default subpixel rendering, with full hinting, i.e., yucky.
I don’t use Gnome regularly, so I can’t say for sure what the issue would be, but you may want to make sure your ~/.Xresources file looks like this:
And your ~/.fonts.conf should look something like this:
<!DOCTYPE fontconfig SYSTEM ‘fonts.dtd’>
<fontconfig>
<!– These are the base settings for all rendered fonts.
We modify them for specific fonts later. –>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
<edit mode="assign" name="autohint" >
<bool>false</bool>
</edit>
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle" >
<const>hintslight</const>
</edit>
</match>
</fontconfig>
I’m guessing that the packages are not being picked up by gnome for some reason. Make sure you also have the freetype-freeworld package installed from rpmfusion.org along with the cairo-freeworld and libXft-freeworld from my site.
Hey bub181- I’m not sure, since I only use my packages. I imagine they are similar, in that they both ultimately came from David Turner’s patches. I also add a cairo patch to mine that make it respect ~/.fonts.conf, which cairo doesn’t seem to do by default.
Hello Moony,
Thank you for the time and effort in building these rpms. My Fedora 12 desktop looks so much better !
Please note, for Nvidia users, that the nouveau video driver results in ugly fonts; installing the Nvidia driver from RPMfusion solves the problem.
Thanks again and Happy New Year.
Hi.
I’m gonna say thx too, tho I’m just building the packages, and don’t know its outcome yet, but as it can hardly get worse than the actual state, I’m looking forward to relogin
Oh, and bout specs…
post = triggered after installation of a package (updating font caches, icon caches, desktop menus…)
postun = triggered after uninstallation (same reasons obv
)
Hi there,
I’ve installed the packages, but evince and okular both still seem to be using greyscale antialiasing. Am I doing something wrong?
I’ve installed cairo-freeworld, libXft-freeworld, and fonts-config. Do I need to do more than that to get evince and okular using RGB?
Ta.
James
That’s weird, OpenOffice is not respecting my subpixel settings. Anyone else having problems with it? I’m on Fedora 12. I heard about ‘recompiling OOo to make it respect cairo settings’. What? I give up. Coming back to Ubuntu.
Also, bug reports about subpixel hinting are open in Bugzilla for ages. Red Hat couldn’t care less about desktops.
Thank you very much for these F12 packages. I use these patches on other systems (FreeBSD) and I am really glad to find similar RPMS and SRPMS for Fedora.
One question, though: I thought you also had to add the ‘lcdfilter’ mode to .fonts.conf? Here is the .fonts.conf I am using (taken from FreeBSD forums):
rgb
true
hintslight
true
lcddefault
Anyway, these packages are working great. Thank you for creating and maintaining them!
Yes, I have the lcdfilter parameter in my local.conf right now. I’m not sure if its required, since it’s “default”, but it can’t hurt to specify.
Also worthy of note, I’m currently working on a patch to freetype that makes it render very similarly to Cleartype:
http://www.infinality.net/files/wine-wordpad-2010-03-10.png
God bless you man. Could you please take a look at this post http://forums.fedoraforum.org/showpost.php?p=1342896&postcount=161. I don’t know how to fix that, maybe you can help me.
Hello!!! I’ve installed this patch to my Fedora 12 – it looks very good, Thank you! But I want to know, will be avaliable the same packages for Fedora 13?
Unlikely that this will make it into F13. My goal is to get it directly into freetype, at which point, it will end up in every Linux distro eventually. I’m debating creating some F13 packages, however I think my time would be better spent finishing the patch and getting it into freetype!
I should make it clear that what I am trying to get into freetype is in fact this patch: http://www.infinality.net/blog/?p=67
The F13 packages for Xft and cairo will be forthcoming….