Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm switching from Fedora 8 to Ubuntu 9.04, and I can't seem to get it to get a good font anti-aliasing to work. It seems that Ubuntu's fontconfig tries to keep characters in integral pixel widths. This makes text more difficult to read, when 1 pixel is too thin and 2 pixels is too thick.

Check the image below. In Fedora, when fontconfig anti-aliasing is enabled, fonts have their thickness proportional to the font size. Below, the thickness is different for 8, 9 and 10pt sizes. In Ubuntu, on the other hand, even when anti-aliasing is enabled, all 8, 9 and 10pt sizes have 1 pixel thickness. This makes reading larges amount of text difficult.

Comparing Fedora 8 and Ubuntu 9.04 font anti-aliasing.

I'm using the very same home directory, and I already checked that X resources are the same in both systems:

~% xrdb -query | grep Xft
Xft.antialias:  1
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.rgba:       none

GNOME settings:

~% gconftool-2 -a /desktop/gnome/font_rendering
 antialiasing = grayscale
 hinting = full
 dpi = 96
 rgba_order = rgb

So, the question is: What should I change in the new box (Ubuntu) in order to get anti-aliasing like in the old box (Fedora)?

share|improve this question
5  
Is it just me who thinks that the Ubuntu fonts are much sharper and readable than the Fedora fonts? The Fedora fonts look way too blurry IMHO. –  Yaba Aug 12 '10 at 10:02
    
I actually like the one on the right more. The one on the left is way too blurry. To each his own, though. ;) –  Sasha Chedygov Aug 12 '10 at 10:03
1  
@Yaba, @musicfreak: If you have CRT monitors or have a low resolution, the ones on the left may look too blurry. Otherwise, they better reflect the size of the font. Look at how the thickness of the lines in the right image suddenly jump from 1px to 3px as you increase the font size. This is also bad when it is being projected. The text doesn't become more readable as you increase the font size until it is too big (when it jumps to 3px). –  Juliano Aug 12 '10 at 13:44
1  
Also, in the Ubuntu sample, look at how there is a missing pixel in the "k" in "quick" in the third text line, making it look like it was two glyphs, a "|" and a "<". –  Juliano Aug 12 '10 at 13:49
1  
@Juliano Then I have the first available Laptop with a built in CRT monitor :-) –  Yaba Aug 20 '10 at 17:24
show 1 more comment

3 Answers

up vote 27 down vote accepted

There is an old trick to make fonts smoother on Ubuntu (and pretty much every distro running Gnome):

Open up .fonts.conf under your home directory (~/.fonts.conf) and paste this in:

<?xml version="1.0" ?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
   <fontconfig>
      <match target="font">
         <edit name="autohint" mode="assign">
            <bool>true</bool>
         </edit>
      </match>
</fontconfig>

Before:

alt text

After:

alt text

share|improve this answer
    
EXACTLY what I was looking for! I played a lot with this file, with 'antialias', 'hinting', 'hintstyle', 'rgba' and 'lcdfilter' options, and nothing helped. 'autohint' did it! Just a note: you must have rgba=none for autohint to work correctly. Seems like autohint is enabled by default in Fedora, but not in Ubuntu. –  Juliano Jul 20 '09 at 1:31
1  
+1. Insane that this isn't surfaced in the font preferences in some way. –  Kent Boogaart Aug 17 '09 at 19:11
1  
Sad reflection on the GNOME philosophy that you even have to ask this question. –  sml Jul 20 '10 at 18:59
    
@Juliano Auto-hinting works correctly with sub-pixel rendering, so there is no need for rgba=none. –  Adam Byrtek May 30 '11 at 19:20
    
@Adam: Are you talking about now or about when this question was asked, back in 2009 (Ubuntu 9.04)? –  Juliano May 31 '11 at 1:04
show 1 more comment

As John said it, the ~/.fonts.conf file is useful to tweak your font configuration.

I eventually figured out how it works after reading this article :

http://www.kilobitspersecond.com/2009/04/17/ubuntu-font-hinting-you-a-cautionary-tale/

share|improve this answer
add comment

The latest versions of Ubuntu allows changing these settings via Preferences > Appearance > Fonts > Details

I find Medium hinting to be the most pleasing on my LCD screen.

share|improve this answer
    
Yes, the hinting option is already known. The "autohint" option, as mentioned by John T, is the option that is missing in that dialog, including in the latest version of Ubuntu. –  Juliano Aug 12 '10 at 13:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.