2

When I log into a session which uses the Blackbox window manager the fonts look different (read worse) compared to how they are rendered in Unity. Does anyone know if it is possible to achieve the same font rendering with other window managers by setting the appropriate values in ~/.fonts.conf? If the answer is yes what settings should I use - is there a way to retrieve the current settings that affect font rendering? I use Ubuntu 11.10 by the way.

3

I found a solution here:

http://lovingthepenguin.blogspot.com/2011/07/fixing-ugly-qt-fonts-in-openbox-fluxbox.html

It turns out, however, that I only need to set hintstyle and rgba since the other settings are the same as the default ones. Add the following lines to ~/.Xresources (or ~/.Xdefaults if you start X from the console) and restart X Windows:

Xft.hintstyle: hintslight
Xft.rgba: rgb

Edit 2014-10-26: Debian 7 uses different default values so use these settings to make sure the fonts look good:

Xft.antialias: true
Xft.autohint: false
Xft.dpi: 96
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xft.rgba: rgb

Edit 2016-01-10: Some applications, like Chromium, use fontconfig settings instead. The Xft values above corresponds to the following XML in ~/.fonts.conf:

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

    <match target="font">
        <edit mode="assign" name="autohint">
            <bool>false</bool>
        </edit>
    </match>

    <match target="font">
        <edit mode="assign" name="dpi">
            <double>96.0</double>
        </edit>
    </match>

    <match target="font">
        <edit mode="assign" name="hinting">
            <bool>true</bool>
        </edit>
    </match>

    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintslight</const>
        </edit>
    </match>

    <match target="font">
        <edit mode="assign" name="lcdfilter">
            <const>lcddefault</const>
        </edit>
    </match>

    <match target="font">
        <edit mode="assign" name="rgba">
            <const>rgb</const>
        </edit>
    </match>
</fontconfig>

In Debian I have also noticed that to get the same character shapes you also need to set DPI to 100 instead of 96*.

*https://unix.stackexchange.com/questions/165250/why-is-a-ten-point-font-smaller-in-debian-compared-to-ubuntu

  • An alternative (although more heavy-weight) solution is to start gnome-settings-daemon but that will affect GUI theming as well. – August Karlstrom Nov 11 '11 at 16:03
  • This worked for me! – auraham Jan 10 '17 at 0:32
  • @auraham Nice! I have noticed that some applications, like for instance Chromium, take font settings from ~/.fonts.conf instead. – August Karlstrom Jan 10 '17 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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