Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 2.73 / 5
  You rated: 3 / 5 (11 votes cast)
 
[73,402 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 whoever 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 Oct 31, '07 08:46:19AM
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 Nov 01, '07 08:40:42AM

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 Nov 16, '07 12:13:07AM
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 Nov 19, '07 04:06:05PM
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 Feb 17, '08 04:02:00PM
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 | # ]