How to salvage OS X when fonts go awry

Mar 29, '06 05:22:00AM

Contributed by: HeelToe

For weeks I have had Font issues. I must have either made some mistake or chosen the wrong option with Font Book, but a number of apps that relied on specific system fonts were beginning to regularly crash, or display awkwardly in a different font. This is a technical hint, but I used this to get back to normal. This may also work with earlier versions of OS X, but I know it works with Tiger.

To prepare, enable Remote Logins via ssh (in the Sharing System Preferences panel) just in case. Make sure you can login from remote before proceeding!

[robg adds: This hint is quite dangerous, as it involves removing system fonts from a live machine. Proceed at your own risk, and probably only after exhausting other methods...]

First, (as root) run:

 $ sudo rm -rf /Library/Fonts/*
Yes, quite extreme. At this point, you either get lucky and Terminal continues to run, or it crashes on you. If it crashes, I hope you made sure you can get in via ssh. If not, you'll be booting single-user, and mounting the root filesystem read/write just to continue.

So, assuming Terminal is still working, or you're logged in via ssh, copy fonts from /System/Library/Fonts:
 $ rsync -av --delete /System/Library/Fonts/ /Library/Fonts/
Important: Ensure you have the trailing / on each path, as this tells rsync to sync the contents of one directory to another. At this point, Terminal may again crash. If you've made it this far, you can probably re-open Terminal and it will find its fonts. If not, use ssh.

Next, you need to remove all the 0 length files from /Library/Fonts:
 $ cd /Library/Fonts
 $ ls -l | grep ' 0 '
This should give you a list. Remove each with
 $ rm font_filename
You will need to use 'or " around the filenames if there are spaces in the filenames. Now, open Font Book. One by one, go through the "Computer" fonts group, selecting each font that has a dot next to it. Use Edit: Resolve Duplicates. Quit Font Book.

Insert your Tiger install disc, and do this:
 $ cd /Volumes/Mac\ OS\ X\ Install
 $ find . -name AdditionalFonts.pkg
 $ open /path/to/AdditionalFonts.pkg
Install the additional fonts to the system.

Double check there are no duplicates to remove, reboot, and your system should be OK as far as fonts go. If you happen to use Microsoft Office, open Font Book and add all the Fonts in the Microsoft Office Fonts directory (/Applications/Microsoft Office 2004/Office/Fonts).

One note, I had some fonts for which the dot would not go away after Edit: Resolve Duplicates. For these, I actually hit the delete key and said OK. The fonts did not go away, but the dot did. YMMV.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060323201534331