Enable Smooth fonts on Ubuntu Linux
Ubuntu Linux has an option for font smoothing that isn’t turned on by default for some strange reason. This makes fonts significantly smoother, enough to be very noticable.
To enable this option, you need to edit the .fonts.conf file in your home directory. To create and open the file, run this command and paste in the xml data below it.
gedit ~/.fonts.conf
Paste in this text:
<?xml version=”1.0″ ?>
<!DOCTYPE fontconfig SYSTEM “fonts.dtd”>
<fontconfig>
<match target=”font”>
<edit name=”autohint” mode=”assign”>
<bool>true</bool>
</edit>
</match>
</fontconfig>
You’ll have to log out and back in to see the difference.
Here’s an image of the before:

And here’s an image of the after:
![]()
Definitely looks smoother, and is much more readable on my laptop screen.
Tested on: Ubuntu Dapper and Ubuntu Edgy.
Update: Some angry people on digg have pointed out that the original source for this was this Ubuntu Forums post. While I didn’t find it there, I’m going to link back to it, just to be fair.
Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:
| Similar Articles | Featured Wiki Articles |
| Latest Software Reviews | Quick Linux Tips |
| Geek Arcade | Popular Forum Threads |


Yes, that “strange reason” you are wondering about is that Apple has a patent on what it called “subpixel font-hinting”, i.e. basically the use of RGB colors to create smooth gradients across areas the size of a fraction of a pixel. Linux distros, including Ubuntu, turn this technology off by default because distributing it in the US with it turned on would violate Apple’s intellectual property.
Brent, thanks for the info… I wasn’t aware of that. Good to know.
Does it works on Debian unstable? (i don’t wanna try
)
I call BS. It’s not disabled due to patents – if that was they case, they could not have that function at all.
I don’t know about for gnome, but for KDE it can be enabled in the settings…
What about:
dpkg-reconfigure fontconfig-config? It creates/links the proper configuration files in /etc/fonts/conf.d, making it system-wide.
ScottE
US software patents are very wierd. Basically you can patent concepts. The upshot is that sophisticated technologies cannot ‘officially’ be used to do particular things that they’re easily capable of. Software patents are BS!!
Gnome lets you enable and configure the type of antialias. In fact, it comes enabled by default.
You are going to have to come up with a link backing up what your saying, because I don’t beleive you either that it’s patents.
It wouldn’t be present in the software I figure. If it’s aviable optionally it would be a compile time option and would require you recompile the library to enable it. That is generally how these things are done.
It may be disabled because of performance reasons, or it hurts readability on low-resolution displays or something like that. Or it can be disabled ‘just because’ that is how it’s shipped from the upstream programmer and that’s it.
Just in case anyone wants to make this mod apply to all users I place this file in /etc/fonts/local.conf
This also fixes any problems that might occur when programs run as root fail to pick up the font settings.
If publishing it were due to patents, they wouldn’t be able to use it – period. Someone else would be able to provide it, but by simply shipping it IN their technology, they’d be violating the patent.
It’s not that difficult and it’s not a patent thing, it’s just easier for them to use normal anti-aliasing by default instead of detecting whether or not the user has an LCD and which color order that LCD uses … System > Preferences > Font. In the Font Preferences window, click on the “Details…” button to use sub-pixel instead of just standard anti-aliasing.
not much difference , but a good way to start improving the defaults
linux needs a huge face lift so it can catch up to windows , not to mention mac, (looks wise)
gnome is leading the way but when you compare it to osx interface, it looks outdated,
KDE is ok but trailing behind gnome ,it still has that 1995 feel to it , i don’t like it ,
Have you ever used Beryl-Compiz? It blows Vista away.
not much difference
@ ScottE, nate, nationofgreg, and Bob:
http://www.freetype.org/patents.html
Try Googling freetype + patents
A 2 word websearch could have prevented your pointless posts.
If you had read that page you would have realized that it has nothing to do with font smoothing. The two patents that Apple holds are on OpenType-specific hinting embedded in font files. Enabling use of the data is a compile-time option in FreeType. FreeType will also guess based on the glyph shapes in other fonts that lack the data, and in OpenType fonts if the support is compiled-out. I’d bet a dollar Ubuntu ships it “free”.
It has nothing to do with smoothing or sub-pixel hinting AT ALL.
AFAIK, freetype has it’s own hinting method that is supposed to replace the Apple hinting algorithm. They say the freetype algorithm is getting better all the time but upon enabling the Apple hinting method in CentOS (by editing a confi file and rebuilding the frretype package) I noticed a huge difference, i.e, fonts looked much better with hinting turned on.
[continued] On the other hand, the SuSE fonts don’t seem to suffer from this limitation. The SuSE fonts look great in SuSE 9 w/o hinting enabled. Go figure.
System – Preferences – Appearance, Fonts, and enable smoothing there… no need to tinker with the terminal.
The closing quote in is a right-double-quote not a standard quotation mark.
Anyone copying-and-pasting will need to fix that otherwise the xml will not be valid and this won’t work (should be ).
Brent at al — Yes, Apple does have a patent relating to the use of a Byte Code Interpreter for TrueType Fonts. Most TrueType Fonts contain additional information in the form of byte code that a good Byte Code Interpreter can use to better render fonts at small sizes. Rendering Fonts using the Byte Code Interpreter is often also called “native hinting”.
And yes, most distros do disable the byte code interpreter found in freetype. BUT NOT UBUNTU IN HARDY HERON. For some reason, Ubuntu intentionally activates the patented Byte Code Interpreter. You can easily see this yourself. Run the following command:
sudo apt-get install build-essential
apt-get source libfreetype6
You can now review the source and patches. One of the patch activates the byte code interpreter. If you are worried about Patent Infringement, you must recompile the libfreetype6 package with the patch removed.
To get around patents, it is my understanding that the freetype group developed the “auto hinter”. You can use EITHER the patented byte code interpreter or the autohinter but not both. To use autohinting, use the hint in this post, or just run the following command:
sudo dpkg-reconfigure fontconfig-config
then choose “autohinter”, then choose “always”, then choose “no”
Some fonts may look better using the patented byte code interpreter, Other fonts look better using the autohinter.
After reading other posts on the net, I get the impression that David Turner, one of the main freetype developers, prefers the use of the autohinter over the patented bytecode interpreter. But I suspect it boils down to personal preference. see http://www.osnews.com/story/18.....-Freetype/
My fonts are already excellent in Ubuntu 8.04 using slight hinting from settings. No reason for anything better. Way better than Windows too.
A great resource is the “Comprehensive Ubuntu Font Configuration Guide: Gutsy 7.10 edition”. The guide is also relevant to Hardy Heron.
See http://www.ubuntutips.net/node/35
Subpixel hinting looks horrible on CRT. That is why it is not turned on by default. It is only good for LCD. On a CRT you should use antialiasing without subpixel hinting, otherwise the edge of the fonts will be colored.
Hi dude,
Thank you. I tried your tip and it worked like a charm. Now my fonts look really very good.
Just in case anyone reads this far… AFAIK:
There are no patents on subpixel antialiasing (i.e. using the RGB pattern to get higher horizontal resolution), and this can easily be enabled.
The problem is when you want to use ‘hinting’ which tries to align the letters to the pixels so they look sharper. Fonts contain hinting programs that say how to do this, but it breaks some annoying patent to use it so instead freetype uses an auto-hinter. I.e. it guesses. This doesn’t work so well and leads to things like letters touching each other, and weird bold letters that shouldn’t be.
Freetype *can* use the hinting programs (ignoring the patent) but it is disabled in ubuntu. This is pretty annoying, especially for people who don’t live in the US.