Project 16A: Installing TrueType Fonts Using the Easy Method

 < Day Day Up > 



This first font installation method is the easier, and newer, of the two, and it requires almost no effort on your part. For the sake of convenience, I will refer to the installation process for such fonts as “the easy method.”

Fonts installed using the easy method can be used by the fontconfig font subsystem, which handles the fonts for the vast majority of applications installed on your system. Such fonts will be available to GNOME and KDE applications, to Mozilla, and, with a tad more tinkering, to OpenOffice.org. These fonts are also available to your system for customizing GNOME and KDE. Basically, if you’re not trying to install fonts for use with the GIMP, this easy method is the method to use.

Slightly different installation steps are required depending on whether you install the fonts locally (for use only by the user who installs them) or globally (for use by all users on the computer). To keep things easy, I will begin with the local installation process, as that is by far the easiest of all.

Getting the Font Files

The Internet is awash in free fonts. For this project, I will point you to the www. fontfreak.com site, which has a very nice collection of fonts. Once you get to the FontFreak splash page, click ENTER, which will lead you to the main page. Once there, click the button on the left that says PC Fonts, which will bring you to the first page of PC fonts. You can browse through the various pages until you find some fonts to your liking. Which fonts you download is completely up to you.

As you will also need fonts for Project 16B, you might as well download them now too. All in all, for the two projects, you will need eight fonts, which you should download to your Home folder (not to one of the subfolders). Be sure to unzip your font files before going on to the installation steps.

16A-1: Installing Fonts Locally Using the Easy Method

For the first step of this project, let’s use one of the fonts that you downloaded. After you’ve decided which font to use, follow these steps:

  1. Open two new Nautilus windows by clicking the Home folder launcher on your GNOME Panel twice.

  2. In the Location box of one of the Nautilus windows, type fonts:/// and press ENTER. Once you’ve done this, the window will be filled with the font icons you have installed on your system.

  3. From the other open Nautilus window (your Home folder window), select the unzipped font you want to install, and drag it to the fonts:/// folder window. The first time you do this, a hidden .fonts subfolder will automatically be created in your Home folder.

    Note 

    You will have noticed that when you dragged your new font from your Home folder window to the fonts:/// window, the icon for that new font file did not immediately appear. If you don’t like this lack of immediate feedback, you can check your .fonts folder by typing

    ~/.fonts in the Location box of one of the Nautilus windows. This will show you what  fonts you have installed locally — at this point there should be only one. 

  4. Open a Terminal window (do not become root), and type the following:

    fc-cache ~/.fonts/

Make sure there is a space between fc-cache and the tilde (~), and that there is no space between ~/ and .fonts. Then press ENTER. This updates your font cache so that your system will know that the new fonts are there and completes the installation process. The fonts are then available for use, though you will have to quit and restart any programs you have open before you can access the fonts in those programs.

16A-2: Alternative Approach to Installing Fonts Locally Using the Easy Method

If you prefer truly immediate feedback on your installation progress, you can try the following variation of the installation process, which yields the same results as in 16A-1. However, because this installation method uses the .fonts folder that is created in step 3 of 16A-1, you must go through the process in 16A-1 with at least one font file prior to trying this installation method. Let’s use two more of the fonts you downloaded.

  1. Assuming that you have already closed the two windows from 16A-1, open two new Nautilus windows by clicking the Home folder launcher on your GNOME Panel twice.

  2. In one of the open Nautilus folders, type ~/.fonts/ and press ENTER.

  3. In the other open Nautilus window, your Home folder window, highlight both of the fonts you want to install by holding down the CTRL key and then clicking the icon for each font. Then release the CTRL key, right-click either of the highlighted fonts, and select Copy Files in the pop-up menu.

  4. In the .fonts window, right-click any open space in the window, and select Paste Files from the pop-up menu. The fonts will then appear in the Nautilus window.

  5. Open a Terminal window (do not become root), and type the following: fc-cache ~/.fonts/

    Make sure there is a space between fc-cache and the tilde (~), and that there is no space between ~/ and .fonts. Then press ENTER.

As I mentioned before, this alternative procedure yields exactly the same results as the procedure in 16A-1. The only difference is that you will immediately see that your fonts have been copied to the .fonts folder. Which method you choose in the future is, therefore, strictly a matter of personal preference.

16A-3: Uninstalling Fonts Installed Locally Using the Easy Method (Optional)

Regardless of whether you used the installation method outlined in 16A-1 or 16A-2, you can uninstall any fonts installed locally via the easy method by doing the following:

  1. Open the .fonts folder in your Home folder by typing ~/.fonts/ in the Location box of a Nautilus window, and drag the fonts you want to remove to the Trash.

  2. Open a Terminal window (do not become root), and then type fc-cache ~/.fonts/ and press ENTER.

16A-4: Installing Individual Fonts Globally Using the Easy Method

The fonts you have installed thus far can only be used by you when you log in under your usual username. If, however, you want to install fonts that can be used by you and everyone else who uses your computer, the process is slightly different. We’ll use only one of the fonts you downloaded for this part of the project.

The font folder for globally installed fonts is in root territory, so you will need to become root to install fonts in this way. Follow these steps:

  1. Open a Terminal window and become root by using the su command.

  2. Copy the file you want to install globally to the global font folder by typing the following command and pressing ENTER: cp /home/username/fontname.ttf /usr/share/fonts/

    Be sure to include spaces between cp and /home, and between .ttf and /usr. Also, be sure to use your username instead of username, and the name of your font in place of fontname. For example, if your username is thucuc, and your font is called arachnid, the first command would be cp /home/thucuc/arachnid.ttf /usr/share/fonts/

  3. Go back to the Terminal, and type in fc-cache /usr/share/fonts/ and press ENTER to update the fonts cache and thereby complete the installation process. You still need to be root to do this.

16A-5: Installing Several Fonts Globally Using the Easy Method

If you want to install several fonts globally at the same time, you can do so quite easily. The process is essentially the same as in 16A-4, with a slight variation.

  1. Create a new subfolder in your Home folder window called ezglofonts.

  2. Place all of the fonts you want to install via this method into the new ezglofonts folder. Let’s use two of your new fonts for now.

  3. Open a Terminal window and become root by using the su command.

  4. Copy all of the fonts in your ezglofonts folder to the main global font location by typing the following command and pressing ENTER: cp /home/username/ezglofonts/*.ttf /usr/share/fonts/

    Note that you do not need to type in the names of the fonts, as the wildcard character (*) is essentially telling your system to copy all files ending in .ttf within the ezglofonts folder. You should replace username with your own username, of course.

  5. Go back to the Terminal, and type fc-cache /usr/share/fonts and press ENTER to update the fonts cache. You still need to be root to do this.

Now that you are done, you can back up the font files in the ezglofonts folder to CD or floppy and then trash the files. Keep the folder, however, so that you can use it again in the future.

16A-6: Uninstalling Fonts Installed Globally Using the Easy Method (Optional)

If want to remove any fonts that you installed using the global installation method in 16A-5, you can do so rather easily in the following manner:

  1. Open a Terminal window and become root.

  2. Type rm /usr/share/fonts/fontname.ttf and press ENTER. Be sure to substitute the name of the font you want to remove for the word fontname.

  3. Update your font cache by typing fc-cache /usr/share/fonts/ and pressing ENTER.

16A-7: Making Fonts Available to OpenOffice.org Applications

If you want to make the fonts installed either locally or globally using the easy method available to OpenOffice.org applications, you will have to go through a few extra steps. Fortunately, these steps are not very difficult.

  1. Go to the Main menu and select Office > OpenOffice.org Printer Setup.

  2. When the Printer Administration window opens, click the Fonts button at the bottom of the window.

  3. The Fonts window will then open. Click the Add button at the bottom right of the window.

  4. The Add Fonts window will then open. In the Source directory input box, type either /home/username/.fonts/ (with no space between the backslash and the period!) to make locally installed fonts available, or type /usr/share/fonts/ to make globally installed fonts available. A list of the fonts in the spec- ified folder will then appear, though it might take a few seconds. If they do not appear after that, then just click in the input box again and they will.

  5. If you want to make all of the fonts available, just click Select All and then click the OK button. If you only want to make some of the fonts available, hold down the CTRL key and select the fonts you want to install by clicking them. (If you only want to install one of the fonts, of course, you needn’t hold down the CTRL key.) Once you are done selecting the fonts, click the OK button.

  6. An installation progress window will open for the briefest of moments, after which you will see a tiny window saying that x number of fonts have been installed. Click OK.

You can also remove fonts for use by OpenOffice.org while in the Fonts window by selecting the fonts you want to remove and then clicking Remove.



 < Day Day Up > 



Linux for Non-Geeks. A Hands-On, Project-Based, Take-It-Slow Guidebook
Linux for Non-Geeks: A Hands-On, Project-Based, Take-It-Slow Guidebook
ISBN: 1593270348
EAN: 2147483647
Year: 2003
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net