Following Search Paths


Mac OS X puts resources such as fonts, frameworks, and preference data in various places. When Mac OS X needs those resources, it searches known locations in a specific order until it locates the resource. This is called the search path. Understanding the system search path is invaluable when troubleshooting system problems.

The order in which Mac OS X searches for resources is

  1. User (~/Library)

  2. Local (/Library)

  3. Network (/Network/Library)

  4. System (/System/Library)

  5. Classic (/System Folder)

NOTE

The search order above is comprehensive, but the Network and Classic paths are skipped if not available, as is the case in many circumstances.


A good example of how search paths work involves fonts, which can reside in many locations. If you have multiple fonts of the same name installed, Mac OS X will load the first one it finds in the search path, depending upon the application requesting the resource. This order also applies to preferences and other resources in the Library folders.

MORE INFO

Refer to Knowledge Base document 106417, "Mac OS X: Font Locations and Their Purposes."


Using Font Book to Understand Search Paths

For an example of resource paths, look at how Mac OS X uses fonts and how Font Book makes it easy for you to install fonts in public or private locations. Anyone can use the Finder to drag fonts into ~/Library/Fonts and make those fonts available to their user account, but fonts installed in that location are not available to other users on the computer. This may be exactly how you intend for those fonts to be installed: you might want to install licensed fonts for only one specific user. However, most fonts are licensed for a computer system, so you might want to install them in a location that is accessible to all users.

An administrator user can install fonts in all of the system search path locations, but the /System/Library/Fonts folder is reserved for system fonts, so most of the time you will place fonts in /Library/Fonts or ~/Library/Fonts. Font Book makes it simple to install fonts in these central locations, so it's an effective tool for installing new fonts or troubleshooting font problems.

When Font Book reads your fonts, it queries all locations in the search path for valid resources of that type. If you encounter problems with a corrupt or damaged font, you can track back through the search path to identify the problem font. First, remove all fonts from ~/Library/Fonts, because that is the first location in the search path. If that does not resolve the problem, remove all fonts from /Library/Fonts. When you find the font store with the corrupt font, perform split-half searches to identify the problem font. You will learn about split-half searches in Lesson 14, "Troubleshooting."

Removing a Font

You can use the Font Book utility to watch what happens when you move a font to the Trash.

1.

Log in as Apple Admin.

If you are still logged in with another account using Fast User Switching, log out from that account so the only account currently logged in is the Apple Admin account.

2.

Quit all applications to ensure that no fonts are in use.

Note that you cannot quit Dashboard, so it will remain active in the Dock.

3.

Open Font Book (/Applications).

It may take a while for Font Book to display the list of fonts since it must first compile them by looking in all the locations of the search path. The User collection is listed as "Off" since there are no fonts installed solely for the active user in ~/Library/Fonts.

4.

In the Collection column, click Computer.

Font Book displays all fonts installed for all users of the computer in /Library/Fonts.

5.

In the Font column, click Arial.

6.

Choose File > Export Fonts, and use the defaults to save to the Documents folder with the name of Exported Fonts.

This creates a backup copy of the Arial font.

7.

Choose File > Show Font Files (Command-R).

This opens a Finder window revealing the current location (/Library/Fonts) of the selected Arial font. Position this window so that you can see both the Finder window and the Font Book window simultaneously.

8.

Returning to Font Book, choose File > Remove "Arial" family, then click Remove when asked if you are sure.

The Arial font disappears from the Font Book window as well as the Finder window. It is no longer available to users of this computer, unless they have their own copy installed in their home folder, as shown in the following steps.

Adding a Font to Be Used by One User Only

You can use Font Book to install a font in your own Fonts folder.

1.

In Font Book's Collection column, click User.

2.

Choose File > Add Fonts (Command-O).

3.

In the dialog that appears, navigate to the Exported Fonts folder created in step 6 of the previous exercise.

4.

Double-click Arial.

Arial should now appear in the User's font list.

5.

Choose File > Show Font Files (Command-R).

This opens a Finder window revealing the current location (~/Library/Fonts) of the selected Arial font.

Confirming That the Font Is Unavailable to Other Users

If you log in as a different user, you don't have access to the fonts in user Apple Admin's Fonts folder.

1.

Log in as Martha Flowers.

2.

Open TextEdit (/Applications).

3.

Choose Format > Font > Show Fonts (Command-T).

4.

Confirm that the Arial font is not in TextEdit's Font pane.

5.

Log in as Apple Admin.

6.

In Font Book's Collection column, click User.

7.

Select Arial, choose File > Remove "Arial" family, then click Remove when asked if you are sure.

8.

In Font Book's Collection column, click All Fonts, choose File > Add Fonts, then choose the exported copy of Arial.

Once you have confirmed that Arial is once again available to all users, you can delete the Exported Fonts folder.




Apple Training Series Mac OS X Support Essentials
Apple Training Series: Mac OS X Support Essentials v10.6: A Guide to Supporting and Troubleshooting Mac OS X v10.6 Snow Leopard
ISBN: 0321635345
EAN: 2147483647
Year: 2003
Pages: 233

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