Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.5: How to reset user and/or all font caches System 10.5
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.]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[41,093 views]  

10.5: How to reset user and/or all font caches | 5 comments | Create New Account
Click here to return to the '10.5: How to reset user and/or all font caches' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: How to reset user and/or all font caches
Authored by: Nectar on Wed, Oct 31 2007 at 8:46AM PDT
No need for the sudo lsof dance. You can determine the name of the per-user caches directory as follows:
$ getconf DARWIN_USER_CACHE_DIR
/var/folders/W+/W++N636LEWe9v2go06a4dk+++TM/-Caches-/
Similarly, the name of the per-user temporary directory can be obtained using DARWIN_USER_TEMP_DIR:
$ getconf DARWIN_USER_TEMP_DIR
/var/folders/W+/W++N636LEWe9v2go06a4dk+++TM/-Tmp-/


[ Reply to This | # ]
10.5: How to reset user and/or all font caches
Authored by: jelmore49 on Thu, Nov 1 2007 at 8:40AM PDT
i didn't know about the getconf trick. Nice!

Also, the "sudo" can be omitted from the shell script to delete the user's font cache folder. It is necessary for the second one, as you're going into multiple users' folders.

[ Reply to This | # ]
10.5: How to reset user and/or all font caches
Authored by: Doc Drang on Fri, Nov 16 2007 at 12:13AM PST
The arguments to the cut command may not be right for your system—they weren't for mine. I suggest running the lsof pipeline with the two greps, and copying (by mouse) the name of the directory to be deleted from that output.

---
Doc Drang
http://www.leancrew.com/all-this

[ Reply to This | # ]

10.5: How to reset user and/or all font caches
Authored by: jelmore49 on Mon, Nov 19 2007 at 4:06PM PST
My co-worker found the best way to do it -- using the build it commandline utility for ATS, atsutil.

For current user (log out or reboot afterwards):
atsutil databases -removeUser
For all users and system font cache (reboot afterwards):
atsutil databases -remove


[ Reply to This | # ]
10.5: How to reset user and/or all font caches
Authored by: fnordulicious on Sun, Feb 17 2008 at 4:02PM PST
It might also be a good idea to restart ATSServer after clearing its caches.

$ atsutil server -shutdown
ATSServer shutdown
$ atsutil server -ping
ATSServer is running
There will be a pause when doing the ping as ATSServer restarts. You can run
sudo fs_usage -e
to track its filesystem access once it starts, to see if the cache clearing fixed its behavior.

[ Reply to This | # ]