[HOWTO] Tuning of fonts

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[HOWTO] Tuning of fonts

Postby zugunder » Jul 28th, '13, 00:43

So you set up your system, but you do not like how the fonts look in your installation. They typically are almost OK in native KDE applications like Konqueror, etc, but are really awful in GTK-based apps and MCC.

I want to point out from the very beginning – the settings I found suitable personally for me on my particular piece of hardware may not be optimal for you for a number of reasons, such as your personal perception, your screen, video card and its drivers. So I suggest to take my settings as a reference and to change them according to your demands.

The first thing you might want to do is to activate subpixel hinting in System Settings – Application Appearance – Fonts – Anti-aliasing – Configure. Most likely, the result won’t be exactly what you want (or maybe no result at all) because of lacking support of of font hinting by the system. To activate it, you need to have installed libfreetype6 (lib64freetype6 for 64-bit systems). I heard that in the most recent versions of this free library hinting is fully supported, but the general recommendation here is to take this library from the Tainted repository – this one should definitely work.

After you have it installed you can adjust hinting parameters according to your taste. As far as I know, the default setting “RGB” works best on the most screens, but you may be interested to change it and take a look what happens.

The next problem you may face is color “fringing” - colored (blue or yellow) shadows on the sides of the letters. As far as I know, they only appear on LCD (not CRT) screens that are nowadays just the regular type of screen everywhere. The recommendation here is to set a so called “LCD filter” which will kind of blur the fonts’ edges and remove the fringing. In my case the problem was solved by creating a file called 10-lcd-filter.conf:

Code: Select all
<fontconfig>
<match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
</fontconfig>


and placing it into etc/fonts/conf.d and in etc/fonts/conf.avail (maybe it is only necessary in only one of them, but since I am not sure where exactly, I put it into the both – no harm was made).

lcddefault should work fine, but in case it does not, there are more options:
lcdlight - a lighter filter for too bold or fuzzy fonts,
lcdlegacy - the old original Cairo filter,
lcdnone disables filtering entirely.

Even after all you’ve done so far the fonts still may not look perfect (or acceptable, depending on your requirements). In this case you may consider changing default fonts in applications you are using the most, such as Firefox or LO Writer, for example. As you may notice, different fonts look different under the same settings. In my case the best results were with Serif fonts, but since I do not like them too much, I tried several other fonts, so I ended up with changing the default fonts to Liberation Sans.

So now what I have on my Mageia 3 64-bit KDE system is:
1. lib64freetype6 from Tainted
2. Slight hinting enabled
3. LCD filter with lcddefault setting
4. Liberation Sans font as default

Some more possible options, such as fiddling with byte code interpreter, BCI (which did not give good results in my case however) and A LOT of explanations may be found here:
https://wiki.archlinux.org/index.php/Font_Configuration#Hinting

This theme was also discussed on this forum here:
https://forums.mageia.org/en/viewtopic.php?f=7&t=660

Hope these hints were helpful and good luck!
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: [HOWTO] Tuning of fonts

Postby artificeprime » Jul 31st, '13, 00:18

Hi zugunder. Cool tutorial. Thanks for this. 8-)

Here are a couple of observations I made implementing it on one of my systems:

1. I already had libfreetype6 from tainted installed by default. Note that I selected to add the tainted repos during install, but I suspect the non-tainted version might also be installed by default otherwise.

2. Regarding the proper destination of your LCD-filter XML-code snippet, /etc/fonts/conf.d/ contains mostly symlinks pointing to files in /etc/fonts/conf.avail/ and /usr/share/fontconfig/conf.avail/ anyway, so yeah, while harmless, what you've done does seem redundant. It'd be better to leave your actual file in just one of the conf.avail/ dirs and symlink it into /etc/fonts/conf.d/, that way you only have to edit it once if you decide to change something. Another candidate location might be to create a fontconfig hierarchy in /usr/local/share/ mirroring the one in /usr/share/ and symlinking from there, but see next paragraph.

IMHO, an even better (if not best) place for your code snippet would be in ~/.config/fontconfig/fonts.conf. I noticed while adjusting my sub-pixel hinting, that it was this file that KDE's System Settings modified. Your code nicely complements the file's existing contents, and (barring it isn't clobbered should KDE modify the file again) placing it here has the added benefits of being adjustable per-user (I run several multiuser machines) as well as surviving OS updates, upgrades, and re-installs without having to replace the file or worry about breaking its symlink(s).

Anyhoo, I'll post any further observations I might happen across. Thanks for this again. :)
CPU: P4 3.2GHz (Northwood); Mobo: Intel D865PERL; RAM: 3GiB DDR400; VPU: ATI Radeon HD4650 (1GiB); Display: Samsung SyncMaster 206BW LCD; Sound: integrated ICH5 AC'97; OS: Mageia 5 (i586)
User avatar
artificeprime
 
Posts: 56
Joined: May 21st, '11, 21:00
Location: Erickson, BC, Canada

Re: [HOWTO] Tuning of fonts

Postby ozky » Mar 16th, '15, 12:46

No need to manually create lcdfilter setting file,all fontconfig xml/settings files are located in /usr/share/fontconfig/conf.avail only need to symlink it to /etc/fonts/conf.d.
Code: Select all
ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/11-lcdfilter-default.conf
Image
Mageia user
User avatar
ozky
 
Posts: 581
Joined: Jul 2nd, '11, 08:48
Location: Nakkila Finland


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest

cron