GNU/Linux Desktop Survival Guide by Graham Williams |
|||||
Let's assume you are not using a font server.
A good guide to setting up fonts in X is available from http://egads.ertius.org/~rob/font_guide.txt. The following provides a summary!
We assume you are using xserver-xfree86 version 4.1 or later.
First install x-ttcidfont-conf and defoma.
Then add the following to the top of the Files section of /etc/X11/XF86Config-4, so that TrueType fonts are available.
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID" FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" |
After installing any new TrueType fonts while in X be sure to run
$ xset fp rehash |
The order of fonts in the Files section has an impact on what fonts are used by XFree86. Be sure to give Type1 fonts (often rendered poorly in XFree86) a low priority by placing the following line at the end of the list of FontPaths:
FontPath "/usr/lib/X11/fonts/Type1" |
Another trick is to avoid XFree86 rescaling fonts by giving a higher priority to the unscaled fonts, by placing the following two lines relatively higher in the lits of FontPaths:
FontPath "/usr/lib/X11/fonts/100dpi:unscaled" FontPath "/usr/lib/X11/fonts/75dpi:unscaled" |
Direct from the above web page:
Now that it's all setup, install some font packages. ttf-bitstream-vera is a rather nice set of fonts, and is Free (http://www.debian.org/intro/free) enough to go into Debian itself. It's not in woody yet, but you can download the .deb from http://http.us.debian.org/debian/pool/main/t/ttf-bitstream-vera/ttf-bitstream-vera_1.10-3_all.deb (or your local mirror) and install it with "dpkg -i ttf-bitstream-vera_1.10-3_all.deb" (as root). sid and sarge users are just an "apt-get install ttf-bitstream-vera" away from it. Another option is ttf-freefont, which is in all three current versions of Debian. For Japanese and other non-roman languages, you might want to try these fonts: tfm-arphic-bsmi00lp, tfm-arphic-bkai00mp, tfm-arphic-gbsn00lp, tfm-arphic-gkai00mp, hbf-jfs56, hbf-cns40-b5, hbf-kanji48, ttf-baekmuk and ttf-thryomanes. Another alternative is to install Microsoft's Corefonts. They removed the fonts from their website, but the msttcorefonts package will download them for you from a mirror. Note that these are NOT Free (in the Debian sense), but you're permitted to at least use and download them. Both of these packages (and the other ttf-* packages in Debian) should now Just Work, and appear available to all X programs that use the regular "core" font system. This includes things like xterm, emacs and most other non-KDE and non-GNOME applications. Now, run "xfontsel" and select either "Microsoft" or "Bitstream" in the fndry menu (click on the word "fndry"). Now look at the ungrayed out entries in the "fmly" menu. You should have a bunch of either Microsoft fonts (Verdana, Trebuchet, etc) or some Bitstream ones (or both). For KDE2.2 and GNOME1.4 (with libgdkxft0, which is a hack to get GTK 1.2 to do anti-aliased font rendering), you need to setup Xft1, as well. Xft1 is highly deprecated, and is basically only used by GNOME1.4 and KDE2.2. For GNOME2 and KDE3, you need to setup "fontconfig" which Xft2 uses to find fonts. I'll get to that in a minute. Edit /etc/X11/XftConfig and add a line like dir "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" before the other dir lines. I don't have any xft1 stuff on my machine anymore, so I'm not sure if you need to restart X or not before this change will take effect. I seem to remember that "xftcache" would update the Xft1 cache, but it'd be good if someone could confirm that for me. Now, for fontconfig, which does *not* exist in woody. You shouldn't need to install anything extra for this, since all the packages using fontconfig will Depend on it (indirectly) already. First, look in /etc/fonts/fonts.conf. There should be a line like the one below. If not, open up /etc/fonts/local.conf and add this <dir>/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType</dir> just after the <fontconfig> line. Fontconfig should pick these up immediately, and "fc-list" should list your new fonts. Another neat feature of fontconfig is that you can just drop fonts in ~/.fonts/ and all your fontconfigified programs will have access to them immediately. |