Category: Linux


This patch makes Freetype's (http://www.freetype.org) Truetype interpreter render fonts similarly to MS Cleartype.  It is not perfect, and needs some work on certain fonts, however, in my opinion it renders much, much better than the bi-level Freetype hinting does when doing subpixel rendering.  Anything previous to this that I've worked on is simply a hack.  This is the real thing finally.

This patch is different than all previous so-called "cleartype fixes" for Linux.  The reason is that the MS truetype interpreter does subpixel filtering, but also subpixel hinting, which has never been done before in Freetype.  ("Subpixel hinting" means that the outlines of the letters are rounded to subpixel boundaries instead of pixel boundaries.  "Subpixel filtering" means that the part of the renderer that chooses which pixels to light up does so with the idea of subpixel boundaries instead of pixel boundaries.)   The Freetype library has hitherto only done subpixel filtering, and WHOLE pixel hinting.  This looks great when using non-antialised fonts (circa Win98), but looks bad on legacy fonts when doing antialiasing and subpixel filtering, because the legacy fonts were designed with the idea of bi-level (monochrome) hinting in mind, not subpixel (antialiased) hinting.  The MS TT interpreter in Windows XP and later works around this by ignoring certain Truetype instructions contained in the font.  This patch attempts to duplicate that functionality.  Modern free fonts like Liberation and DejaVu also look good with this too, because they were designed with subpixel hinting in mind.

Another benefit to this is that this is modifying the default (native) hinter of Freetype, which all programs should use by default.  This means that oo.org, WINE, Xft, Qt and just about everything else will be using this by default.  In other words, almost all programs will render fonts the same good way.   

Please feel free to make suggestions and criticisms of the approach and implementation. My goal is to make this patch quality and accurate, and get it into the freetype tree if possible. There are plenty of improvements that can still be made, in features and implementation.   This is an all-in-one patch that should cleanly patch freetype-2.4.2, enable LCD filtering, subpixel rendering, and the new subpixel hinting.


Latest Versions (2010-09-06)

strongly recommended to:

Please make sure you have done these things before asking why something isn't working.  Here is a good resource that explains how to set up and modify a /etc/fonts/local.conf to your personal taste:

http://wiki.archlinux.org/index.php/Font_Configuration

 


(Updated 2010-09-06)  PACKAGE UPDATE – This update fixes the LD_PRELOAD issues in the recent packages.  Let me know if problems continue!  Also, I will soon have an updated patch that will be cleaner, allow enabling / disabling with a #define macro, and some additional features, including the ability to tweak the hinting on specific fonts, sizes, and glyphs.   I will then see about submitting it to Freetype.

(Updated 2010-09-03)  PACKAGE AND PATCH UPDATE – This version includes updates that the Gentoo people did for 2.4.2 (http://forums.gentoo.org/viewtopic-p-6350322.html#6350322), as well as a tweak that I made on the synthetic emboldening that Freetype does.  This should make synthetically emboldend fonts look spectacular compared to the default.  Basically, it disables emboldening in the Y direction, which was causing a lot of smeary looking fonts.   Here is a sample of this enhacement, using Andale Mono, which has no bold version available:

 

http://www.infinality.net/fedora/linux/13/x86_64/freetype-subpixel-2.4.2-2.fc13.x86_64.rpm   

http://www.infinality.net/fedora/linux/13/i386/freetype-subpixel-2.4.2-2.fc13.i386.rpm   

http://www.infinality.net/files/subpixel-hinting-20100903-1.patch

 

(Updated 2010-06-17) http://www.infinality.net/fedora/linux/13/x86_64/freetype-subpixel-2.3.12-3.fc13.rpm    Also…. It's strongly recommended to use this /etc/fonts/local.conf, and to remove/disable your ~/.fonts.conf, not to mention using the cairo and libXft packages available at that link.

 

(Updated 2010-04-24) http://www.infinality.net/files/subpixel-hinting-20100424-1.patch

There are a few more tweaks I need to make the patch acceptable for inclusion into Freetype.  In the meantime here are the Fedora 13 RPMS.  They safely install alongside the system freetype, and use LD_PRELOAD to override system libraries.  You may get LD_PRELOAD warnings / errors when running from command-line.  These will go away eventually once this patch is in freetype.

 

Here is a DejaVu Sans sample, rendered with Freetype, using this patch:

Here is a Tahoma sample, rendered with Freetype, using this patch:

 

 Here is an Arial sample, rendered with Freetype, using this patch:

 

Here is a Liberation Sans sample, rendered with Freetype, using this patch:

My /etc/fonts/local.conf

Here is the current version of my local.conf file.  

 (2010-08-29)  I updated this to clean up some inaccurate comments, as well as streamline a few things.  Not a major change.

 (2010-08-16)  This assumes use of my subpixel hinting patch or package for freetype!  It also assumes that you are not using a ~/.fonts.conf file.  If you have one, you can disable it by doing:  mv ~/.fonts.conf ~/.fonts.conf.disabled.

 (2010-09-03)   This is updated to reflect changes in my patch located here (http://www.infinality.net/blog/?p=67).  I've fixed some replacements for fonts that just suck, and removed replacements for bold fonts, given the new enhancements to the freetype synthetic emboldening.

This is a really old version of my .fonts.conf.   I'm leaving it here, as I think it may be useful to some people.

Font Testing Page

 I use this page to visually check fonts.  It’s kinda hacky and sloppy but it works.  Maybe it would be useful to others, so I’m linking it:

http://www.infinality.net/files/font.html

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.i586
yum 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

If running x86_64, I recommend installing x86_64 and i386 packages, in case you have some x86 binaries that you would also like to look nice.
 
Update June 13, 2009:  Due to problems with some application startup scripts overriding ldconfig with forced LD_LIBRARY_PATH settings, I've added LD_PRELOAD functionality to /etc/profile.d/ in these packages.  It should make more applications use the better rendering, but may spit out errors when it can't load a library for various reasons.  If you don't want this LD_PRELOAD functionality, create a file /etc/sysconfig/fonts with PRELOAD=0 in it.  Also, the cairo packages include LD_PRELOAD functionality for the freetype from rpmfusion.org, as I assume anyone installing these packages also will be installing the modified freetype (otherwise it's pretty pointless ;) )
 
Update June 17, 2010:  Fedora 13 Packages are available!

 
 
 
Source RPMs for those interested in building the package themselves:
 
 

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:

This project attempts to replicate the new taskbar functionality of Windows 7 in KDE4 / Plasma.  Aside from that, it’s still a nice replacement for the default KDE4 task list.  The source appears to be updated often, but packages may not always be up to date here.  For the bleeding edge, you should build it yourself:   http://kde-look.org/content/show.php/Smooth+Tasks?content=101586

(UPDATE:  Apparently this only works on my system at the moment… looking into the issue with the package…. stay tuned.)

http://www.infinality.net/fedora/linux/12/

Source from:  http://www.kde-look.org/content/show.php?content=107158&forumpage=9

http://www.infinality.net/fedora/linux/12/

Fedora 12 has updated audacious to version 2.1, but there is a problem with the LADSPA plugin not saving its settings (See: http://jira.atheme.org/browse/AUDPLUG-2 ) and the game console music plugin crashing (http://jira.atheme.org/browse/AUDPLUG-40 ).   I’ve built audacious-plugin packages that fix this issue after reading about the workarounds mentioned on the pages.

http://www.infinality.net/fedora/linux/12/

Fedora 12 RPMS

Fedora 12 RPMS have been added to the repository.  QtCurve-common package is now obsolete, as it is included in the gtk2 package.  This gets past some goofy dependency issues.   Let me know if you experience any issues with the F12 packages!

http://www.infinality.net/fedora/linux/

http://www.infinality.net/fedora/linux/

I've created a repository for my posted rpms, for both my and your convenience.  I'm still working out how to get Apache indexes turned on so it looks normal-  for some reason they aren't working, even when the .htaccess is set up properly.  I have some poor man's indexes I created from a shell script though, so it's now browseable.   Currently it has RPMS for Fedora 11, 12 and 13.

Install this file and you can then do stuff like "yum install cairo-freeworld libXft-freeworld qtcurve*".  I can't guarantee this will always be up to date, but I'll try to keep it as current as I keep my own system.

 

Last updated on June 17, 2010.

infinality-repo-1.0-1.noarch.rpm

QtCurve is an excellent style for Gnome and KDE.  IMO it really makes Linux look professional:

http://www.kde-look.org/content/show.php?content=40492 

Here is a src.rpm I use to build qtcurve for fedora, as well as the RPMS. Can’t guarantee they will always be up-to-date, but it is at least a good starting point. This was created from a modified spec file I found floating around online.   I believe it was for ArchLinux.
 

I renamed the packages to fall into line more with Fedora’s naming conventions.  If you’ve installed older packages of mine you should probably do a "yum remove *QtCurve*" before installing packages built with this, although I did put "Obsoletes" lines into the spec file.

i386 Packages
x86_64 Packages

noarch Package (required)

 

Source RPM:

qtcurve.src.rpm
 

Powered by WordPress | Theme: Motion by 85ideas.