Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I used the answers to this question to tune the subpixel font hinting in the Unity interface. However, the text rendered inside Firefox , Chrome or evince doesn't use subpixel anti-aliasing. Sadly these three applications are the one which need it the most.

Subpixel font hinting is enabled almost everywhere else.

How to activate it for these applications ?

share|improve this question

2 Answers 2

up vote 4 down vote accepted
+50

Firefox seems not to read the GTK configuration, but it does will honor your ~/.fonts.conf which basically contains the font configuration, including the sub-pixel order.

This is an example .fonts.conf which comes from a 2005 blog post which may help out, what you most likely want to change is the rgba value (sub-pixel order) to match your LCD and maybe the antialias value.

<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig>
<match target="font">
    <edit mode="assign" name="autohint">
        <bool>false</bool>
    </edit>
</match>
<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>
share|improve this answer
    
There was already a .fonts.config with some minor differences, especially on the autohint key which was not set. It's now working with autohint=false. Not sure why.. but it's working. –  Antoine Lecaille Oct 20 '13 at 19:49
    
This does the job for FF et Chrome, but evince is still using a grayscale anti-aliasing. –  Antoine Lecaille Oct 20 '13 at 19:56
    
Fixed my 14.04 install which somehow had it turned off when I switched to using kde-desktop. –  Alan De Smet Sep 18 at 2:03

There are two places where you can alter the fonts appearance:

1. Run dconf and find org.gnome.settings-daemon.plugins.xsettings schema. Hinting, antialiasing and RGBA order can be set there. These settings affect GTK and Unity applications.
2. Take a look at /etc/fonts/conf.d folder. It actually contains symlinks from /etc/fonts/conf.avail. For example, if you want to change your hinting style from slight to full, remove one symlink and add another.

sudo rm /etc/fonts/conf.d/10-hinting-slight.conf
sudo ln -s /etc/fonts/conf.avail/10-hinting-full.conf /etc/fonts/conf.d/

In your case check whether 10-no-sub-pixel.conf symlink exists in /etc/fonts/conf.d folder. If yes, remove it and add 10-sub-pixel-rgb.conf symlink as described earlier.
These settings affect non-GTK applications like Firefox and some other.

If you need some proven resources about fonts configuration you can look at https://wiki.ubuntu.com/Fonts (mostly consists of custom ~/.fonts.conf and quite old). Another great resource is https://wiki.archlinux.org/index.php/Font_Configuration (contains multiple hints and up to date).

BTW Direct editing of /etc/fonts/fonts.conf is not recommended. You'd better add /etc/fonts/local.conf or ~/.fonts.conf with your custom settings which will prevail over the settings in /etc/fonts/fonts.conf.

share|improve this answer

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.