19 October 2006

Solving Font Problems

Depending on your system configuration and the HTML renderer used you might have problems with font quality in Liferea. For starters: Liferea supports two HTML renderers GtkHTML2 and Gecko (Mozilla/Firefox/XulRunner). The idea is to be as portable as possible and alternatively load either the GtkHTML2 or Gecko plugin to do the rendering. Now both renderers support different font engines and might have access to different sets of fonts.

How Liferea supplies font settings

The only easy and reliable way for Liferea to set a font for both supported renderers is to set it via a style definition in the generated HTML. Now the question remains which font definition is used. Liferea as a GTK, but GNOME-related, program reuses the GNOME document font setting. So if you are a GNOME user you can configure the Liferea font settings in the GNOME font preferences.

When you do not use GNOME and never set the GNOME preference you have the following alternatives:
  • Rely on the default font choice of the renderer.
  • Use gconf-editor to manually edit the GNOME document font preference /desktop/gnome/interface/font_name.
  • Provide a user defined CSS stylesheet with a default font.
Font Naming Conventions

When manually configuring fonts using gconf-editor you must follow the GTK naming scheme for fonts: <font name>,<font size in pt>, for example "Sans,11". When defining fonts using a user defined stylesheet you have to use the default HTML font family class names.

Not using the GNOME font

If you do not want to change the GNOME document font setting, but also want another font for Liferea you can manually set the GConf key /apps/liferea/browser-font. This setting will overrule the GNOME setting.

Anti-Aliasing Problems

As long as you use GtkHTML2 you can be sure that the GNOME anti-aliasing settings will be used in Liferea. But with Gecko you might get blurred or grainy rendering. It's hard to tell what is the exact reason in such a case. And there is no general hint how to workaround it. But you could try to disable/uninstall bitmap fonts so that Gecko won't have the chance to use them or you could try to find a better setting by experimenting with a user defined stylesheet.


Michel said...

In Liferea 1.0.x it seems that Liferea only honors the Application font setting, not the Document font setting. I tried bumping it up to 14 with no effect.

Lars Lindner said...

Fixed with 1.2-RC3. Thanks for your patch!