[Fontconfig] TTF fonts etc.

Ciprian Popovici ciprian at zuavra.net
Fri Oct 10 21:05:34 EST 2003


On Fri, 3 Oct 2003 00:28:24 +0200 JB <somnambulist at inbox.ru> wrote:
> Let's say I have just installed linux (slackware 9.1),  the latest
> XFree86 and fontconfig 2.2.0 (all clean installs) and haven't
> configured anything or done anything else with my linuxbox. Where do I
> go from here? Tthe fonts look scaly and weird from start and websites
> don't look as good as they do in Windows. I just want the fonts to
> look "right". 

There are several issues/steps to be taken.

1. Get the most widely used TTF fonts out there, either from a Windows
install of some kind, or from the dedicated SourceForge project.

2. Install the TTF fonts:
   * place them into a dir, run mkfontdir+mkfontscale in that dir.
   * tell X to take that dir into account; this can mean editing one of
     /etc/X11/fs/config or /etc/X11/XF86Config, plus
     /etc/fonts/local.conf, or messing with 'xset +fp' commands.
   * make sure the TTF fonts are the only ones with that name (ie. the
     only "Arial" font is the TTF one) or just place your TTF dir first
     in the above config files or xset font path so it takes precedence.
   * run 'fc-cache -fv' as root
   * run X and check the output of xlsfonts.

3. Next start beautifying the fonts. First there's the widget matter.
   GTK v1 based apps CAN NOT anti-alias fonts so you're stuck with
   "scaly" and stair-edged fonts. It's a problem especially if you get
   the precompiled official Mozilla for instance, which is based on
   GTK1. Better look for alternative builds based on GTK v2. The same
   issue may appear for static-built Opera which comes with its own QT.
   Run ldconfig on the browser executable and see what libs it links
   with dinamically (if any); same goes for any app, actually.

   GTK v2 based apps are ok, but remember to enable anti-aliasing by
   setting the env variable GDK_USE_XFT=1. Pretty much the same
   goes for QT apps: QT_XFT=1.

4. Tweaking is next. There are many places which allow tweaking. The
   browser configuration is one place. You can mess with the fonts.alias
   and make some fonts be replaced with nicer ones. You can use qtconfig
   and do some font substitution there too. The control panels for Gnome
   and KDE have some more font options themselves. Finally, edit
   /etc/fonts/local.conf or ~/.fonts.conf and add some tweaks to your
   heart's desire; myself I set all fonts below 12px as non-anti-aliased
   and everything bigger with AA, plus some other nice tricks like
   much more flexible font substitution based on all kinds of font
   characteristics.

Final tip: if you compile stuff yourself, make sure to enable XFT
support in everything. Something like Pango can affect all your GTK v2
installations.

-- 
Ciprian Popovici




More information about the Fontconfig mailing list