|
||||||||||
|
|
4. Making Fonts Available To XThere are a number of ways fonts can be added to X. Firstly, XFree86 has a font path which is just a list of several directories or font servers where it searches for fonts. A font server is just a background process that makes fonts available to XFree86. An advantage of font servers is that they can send fonts to remote displays. Recently, xfs ( the ``X font server'' ) has been patched to support TrueType fonts, and run as a stand-alone program. The patched version ships with RedHat and RedHat-based distributions, and is included in XFree86 4.0 and newer. xfs is actually just the standard font server that comes with XFree86. It's source code is part of the XFree86 source tree. However, distributions have recently been shipping a version that runs in stand-alone mode. The stand-alone X font server, with the TrueType support patch ( the TrueType support takes place via a font server called xfsft ) is probably the nicest font management solution currently available. Its advantages include:
Because different distributions ship with different configurations, it is not true that one size fits all. We can split users up into three groups:
4.1. The font pathXFree86 finds your fonts by searching a font path, a list of directories ( or servers -- we'll explain this further later. ) containing fonts. When an application requests a font, it searches through the directories in your font path one at a time until the font is found. To make fonts available requires you to set your font path. You can add a directory to your font path with the command xset fp+ directory Once you have done this, you need to ask the X server to re-scan for available fonts with the command
4.2. Installing Type 1 Fonts4.2.1. Run Type1instThe easiest way to make Type 1 fonts available to X is with the help of the Type1inst utility. This is a perlscript that automatically creates the fonts.dir and fonts.scale files that you need for X to use the fonts. Simply CD to the directory, and run type1inst. cd directory type1inst 4.2.2. If You Have the xfs PackageNow you need to add the fonts to your font path. If you already have the stand-alone Section 4.4 running, you do this by editing your xfs configuration file. RedHat users can just use chkfontpath. the format is chkfontpath --add directory Your fonts will be available to X after you restart xfs, or tell it to reload by sending a SIGHUP. You may need to run xset fp rehash as well. Your fonts should now be available to X. Now you just run xset fp rehash and X will be able to find the new fonts. 4.2.3. If You Don't Have The xfs PackageIn this case, you need to add the directory containing your new fonts to the font path, as described previously. 4.3. True Type FontsAdding TrueType fonts is a little more difficult, because you need to have a font server that is capable of serving TrueType fonts. Two font servers that do this are xfstt and xfs. xfstt is a TrueType font server. While it's easy to configure, and quite useful, it appear that xfs is becoming more popular. The main advantage of xfs over xfstt is that it supports both Type 1 and TrueType fonts. 4.3.1. xfsttTo set up xfstt, just download it and install it. Once you install it, you need to do the following:
4.4. xfsSome of the newer Linux distributions ship with the X font server xfs configured to run as a stand alone program. Notably, Redhat and all the redhat based distributions use this modularised xfs with TrueType compiled in. Debian also ship xfs, but the version they ship in stable ("potato") doesn't have built in true type support, though the one in testing ("woody") does. Running xfs as a stand alone server has several benefits, especially if it is compiled with TrueType support. The main advantage is that since the font server is no longer attached to the X server, it is possible to serve fonts to remote displays. Also, it makes it much easier to modify the font path. 4.4.1. The xfs PathAs a font server, xfs has it's own font path. One might wonder where this fits into the picture. It works like this: you can place the xfs font server in XFree86's font path, by adding unix/:port to the XFree86 font path. Once you do this, any font in the xfs font path automatically becomes available to XFree86. The xfs font path is determined by the xfs configuration file, which is /etc/X11/fs/config on Redhat, and /etc/X11/xfs/config on Debian. Redhat users do not need to explicitly edit this file, they can use the chkfontpath utility. The syntax is simple:
4.4.2. Installing a Font Into xfsTo prepare a font for xfs, you need to follow the following steps:
| |||||||||
|
|
|
Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account Document on this page is part of "Font HOWTO". See Index Page for more info about Authorship and Copyright. 1999-2008 Linuxinfor.com. No rights reserved. |