10.5: How to reset user and/or all font caches

Oct 31, '07 07:30:03AM

Contributed by: jelmore49

As a person whose work requires me to deal with fonts all day, I was naturally curious about the state of Apple Type Services (ATS) framework in Leopard: primarily, whether or not font cache corruption will be an issue.

While my limited testing shows some improvements in the stability of ATSServer when handling large numbers of fonts, what it focused on is this: how do I reset ATS's font caches in Leopard if they become corrupt? It appears as if there is no central ATS font cache in /Library » Caches » com.apple.ATS any more; in Leopard, those caches are now per-user, and stored in /private » var » folders. The directory names for a particular user within the 'folders' folder are hashed or randmoly-generated to provide security, but I was able to come up with the following one-line shell scripts for deleting the ATS cache folders.

To delete the ATS cache folder for the current user:

sudo rm -rf `lsof | grep com.apple.ATS/annex.aux \
| grep Finder | cut -c 66-139`
To delete the ATS cache folder for all users:
sudo rm -rf /private/var/folders/*/*/-Caches-/com.apple.ATS
After running this script, the machine should be restarted so that the caches can rebuild.

[robg adds: Please note the use of both sudo and rm -rf. If there are any typos in the above, or if you try to type them by hand and make a minor error, the results could be very bad. I tested both on my 10.5 test machine, and no damage was done. Still, please be cautious here.]

Comments (5)

Mac OS X Hints